AGIS documentation

Openvpn client

Updated:

The documentation is currently available in Russian. The interface is translated; article texts are in the original language.

Set up your OpenVPN client and connect it to the VPN server.

First, install the OpenVPN package in the client machine as follows.

$ sudo yum install openvpn #CentOS 8/7/6
$ sudo apt install openvpn #Ubuntu/Debian
$ sudo dnf install openvpn #Fedora 22+/CentOS 8

On a desktop system, you also need to install the network-manager-openvpn package to make VPN settings from the graphical interface.

$ sudo yum install network-manager-openvpn #CentOS 8/7/6
$ sudo apt install network-manager-openvpn #Ubuntu/Debian
$ sudo dnf install network-manager-openvpn #Fedora 22+/CentOS 8

After installing the above packages, start the OpenVPN service, for now, enable it to automatically start at system boot and check its status to confirm that it’s up and running.

$ sudo systemctl start openvpn 
$ sudo systemctl enable openvpn
$ sudo systemctl status openvpn

Then download the .ovpn client file, copy it to the /etc/openvpn/ directory

Start the VPN client service, enable it, and check its status with the following commands.

$ sudo systemctl start openvpn@client.service
$ sudo systemctl enable openvpn@client.service
$ sudo systemctl status openvpn@client.service

Then confirm that a VPN tunnel interface has been created using the IP add command as shown.

$ ip add

Единый файл конфигурации клиента /etc/openvpn/client.conf с сертификатами и ключами для импорта

dev tun
persist-tun
persist-key
ncp-disable
cipher AES-256-CBC
auth SHA256
tls-client
client
# необходимо для DynDNS
resolv-retry infinite
# Внеший IP, на или за которым находится ваш сервер OpenVPN и порт (на сервере или роутере, за которым стоит сервер)
remote XX.XX.XX.XX 1194 udp4
verify-x509-name "agisServerCert" name
# user и пароль вводятся вручную, с консоли
#auth-user-pass
# user и пароль в файле pass.txt, который лежит в той же папке: /etc/openvpn
auth-user-pass pass.txt
remote-cert-tls server
explicit-exit-notify

# Далее идут сертификаты и ключи которые берутся из соответствующих файлов сгенерированных выше

# Из ca.crt
<ca>
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
</ca>

# Из client.crt
<cert>
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
</cert>

# Из client.key
<key>
-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----
</key>

# Из ta.key
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
...
-----END OpenVPN Static key V1-----
</tls-auth>

https://help.ubuntu.ru/wiki/openvpn
https://medium.com/@vantintttp/how-to-setup-openvpn-authentication-by-username-and-password-589a97cafd8b
https://howitmake.ru/blog/ubuntu/193.html
https://www.tecmint.com/install-openvpn-in-ubuntu/