# OpenVPN Client Command Line Interface
[TOC]
###### tags: `vpn`
---
## 安裝
### Debian, Ubuntu
Ensure that apt supports the https transport:
```shell
$ apt install apt-transport-https
```
Install the OpenVPN repository key:
```shell
$ curl -fsSL https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/openvpn-repo-pkg-keyring.gpg
```
Install the proper repository by replacing **`$DISTRO`** with the release name depending on your Debian/Ubuntu distribution:
```shell
$ curl -fsSL https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-$DISTRO.list >/etc/apt/sources.list.d/openvpn3.list
```
Supported distributions:
| Distribution | Release | `$DISTRO` | Architecture |
| ------------ | ------- | ---------- | ------------ |
| Debian | 9 | `stretch` | amd64 |
| Debian | 10 | `buster` | amd64, arm64 |
| Debian | 11 | `bullseye` | amd64, arm64 |
| Ubuntu | 18.04 | `bionic` | amd64, arm64 |
| Ubuntu | 20.04 | `focal` | amd64, arm64 |
| Ubuntu | 21.10 | `impish` | amd64, arm64 |
| Ubuntu | 22.04 | `jammy` | amd64, arm64 |
The **`openvpn3`** package can be installed:
```shell
$ apt update && apt install openvpn3
```
### Fedora, Red Hat Enterprise Linux, CentOS
| Distribution | Release | Architecture |
| --------------------------------- | --------------- | ---------------------- |
| Fedora | 35, 36, Rawhide | aarch64, s390x, x86_64 |
| Red Hat Enterprise Linux / CentOS | 7 | x86_64 |
| Red Hat Enterprise Linux | 8 | aarch64, x86_64 |
| Red Hat Enterprise Linux | 9 | aarch64, x86_64 |
Install both the **Fedora EPEL repository** and the yum **`copr`** module first if running **Red Hat Enterprise Linux** or its clones:
```shell
$ yum install yum-plugin-copr
```
**Fedora** releases usually have the yum/dnf copr module preinstalled, instructions for enabling **Fedora EPEL** can be found [here](https://fedoraproject.org/wiki/EPEL).
Enable the OpenVPN 3 Copr repository:
```shell
$ yum copr enable dsommers/openvpn3
```
Install the OpenVPN 3 Linux client:
```shell
$ yum install openvpn3-client
```
## 使用
Importing a configuration file:
```shell
$ openvpn3 config-import --config ${MY_CONFIGURATION_FILE}
```
```shell
$ openvpn3 session-start --config-path ${path}
```
```shell
$ openvpn3 session-manage --session-path /net/openvpn/v3/sessions/..... --disconnect
```
未完,待續。
## References
- [Connecting to Access Server with Linux](https://openvpn.net/vpn-server-resources/connecting-to-access-server-with-linux/)
- [OpenVPN 3 Linux](https://community.openvpn.net/openvpn/wiki/OpenVPN3Linux)
- [man page](https://github.com/OpenVPN/openvpn3-linux/blob/master/docs/man/openvpn3.1.rst)