root@ubuntu:/home/user# apt-get install openvpn
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpkcs11-helper1
Suggested packages:
resolvconf openvpn-systemd-resolved easy-rsa
The following NEW packages will be installed
libpkcs11-helper1 openvpn
0 to upgrade, 2 to newly install, 0 to remove and 0 not to upgrade.
Need to get 522 kB of archives.
After this operation, 1,343 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 libpkcs11-helper1 amd64 1.26-1 [44.3 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu focal/main amd64 openvpn amd64 2.4.7-1ubuntu2 [478 kB]
Fetched 522 kB in 2s (253 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libpkcs11-helper1:amd64.
(Reading database ... 187005 files and directories currently installed.)
Preparing to unpack .../libpkcs11-helper1_1.26-1_amd64.deb ...
Unpacking libpkcs11-helper1:amd64 (1.26-1) ...
Selecting previously unselected package openvpn.
Preparing to unpack .../openvpn_2.4.7-1ubuntu2_amd64.deb ...
Unpacking openvpn (2.4.7-1ubuntu2) ...
Setting up libpkcs11-helper1:amd64 (1.26-1) ...
Setting up openvpn (2.4.7-1ubuntu2) ...
Processing triggers for systemd (245.4-4ubuntu3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
root@ubuntu:/home/user#
Download OpenVPN configuration files for your tariff plan on the page: /tutorials.php
In this example, RSA configuration files for the "OpenVPN" tariff plan will be used /files/UDP/OpenVPN.zip
Download the OpenVPN configuration files from the service site with a browser, because Anti-DDoS tools will not allow you to do this through wget, curl and other download managers. It is assumed that the archive with the configuration files is saved in /home/user/Downloads. Directory listing:
root@ubuntu:/home/user# cd Downloads/
root@ubuntu:/home/user/Downloads# ls -la
total 328
drwxr-xr-x 2 user user 4096 May 13 19:28 .
drwxr-xr-x 16 user user 4096 May 13 18:17 ..
-rw-rw-r-- 1 user user 326554 May 13 19:28 ALL-OpenVPN.zip
root@ubuntu:/home/user/Downloads#
Unzip the downloaded archive with the unzip command. For convenience, the output of the command has been greatly reduced. In this example, we will use the RSA configuration file to connect to a server in Germany:
Go to the directory with the RSA configuration files:
root@ubuntu:/home/user/Downloads# cd ALL-OpenVPN/RSA/
root@ubuntu:/home/user/Downloads/ALL-OpenVPN/RSA# ls -la
total 260
drwxr-xr-x 2 root root 4096 May 8 02:26 .
drwxr-xr-x 5 root root 4096 May 8 02:24 ..
{abbreviated}
-rw-r--r-- 1 root root 9562 Apr 29 00:30 DE1-OpenVPN.ovpn
{abbreviated}
root@ubuntu:/home/user/Downloads/ALL-OpenVPN/RSA# pwd
/home/user/Downloads/ALL-OpenVPN/RSA
root@ubuntu:/home/user/Downloads/ALL-OpenVPN/RSA#
Connect to the VPN server you need with the command: openvpn configuration_file_name.ovpn In this example, this is Germany, configuration file DE1-OpenVPN.ovpn:
root@ubuntu:/home/user/Downloads/ALL-OpenVPN/RSA# openvpn DE1-OpenVPN.ovpn
Wed May 13 19:51:54 2020 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Sep 5 2019
Wed May 13 19:51:54 2020 library versions: OpenSSL 1.1.1f 31 Mar 2020, LZO 2.10
Enter Auth Username: [email protected] Enter Auth Password: **********
Wed May 13 19:52:42 2020 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Wed May 13 19:52:42 2020 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Wed May 13 19:52:42 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]5.9.170.232:2484
Wed May 13 19:52:42 2020 Socket Buffers: R=[131072->131072] S=[16384->16384]
Wed May 13 19:52:42 2020 Attempting to establish TCP connection with [AF_INET]5.9.170.232:2484 [nonblock]
Wed May 13 19:52:43 2020 TCP connection established with [AF_INET]5.9.170.232:2484
Wed May 13 19:52:43 2020 TCP_CLIENT link local: (not bound)
Wed May 13 19:52:43 2020 TCP_CLIENT link remote: [AF_INET]5.9.170.232:2484
Wed May 13 19:52:43 2020 TLS: Initial packet from [AF_INET]5.9.170.232:2484, sid=e1517dbc a507bec5
Wed May 13 19:52:43 2020 VERIFY OK: depth=1, C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=MyOrganizationalUnit, CN=Fort-Funston CA, name=EasyRSA, [email protected] Wed May 13 19:52:43 2020 VERIFY KU OK
Wed May 13 19:52:43 2020 Validating certificate extended key usage
Wed May 13 19:52:43 2020 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Wed May 13 19:52:43 2020 VERIFY EKU OK
Wed May 13 19:52:43 2020 VERIFY OK: depth=0, C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=MyOrganizationalUnit, CN=server, name=EasyRSA, [email protected] Wed May 13 19:52:46 2020 Control Channel: TLSv1.2, cipher TLSv1.2 DHE-RSA-AES256-GCM-SHA384, 4096 bit RSA
Wed May 13 19:52:46 2020 [server] Peer Connection Initiated with [AF_INET]5.9.170.232:2484
Wed May 13 19:52:47 2020 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Wed May 13 19:52:48 2020 PUSH: Received control message: 'PUSH_REPLY,route 192.168.9.0 255.255.255.0,redirect-gateway def1,dhcp-option DNS 192.71.244.22,dhcp-option DNS 54.39.94.211,block-outside-dns,route 192.168.9.1,topology net30,ping 10,ping-restart 120,ifconfig 192.168.9.6 192.168.9.5,peer-id 0,cipher AES-256-GCM'
Wed May 13 19:52:48 2020 Options error: Unrecognized option or missing or extra parameter(s) in [PUSH-OPTIONS]:5: block-outside-dns (2.4.7)
Wed May 13 19:52:48 2020 OPTIONS IMPORT: timers and/or timeouts modified
Wed May 13 19:52:48 2020 OPTIONS IMPORT: --ifconfig/up options modified
Wed May 13 19:52:48 2020 OPTIONS IMPORT: route options modified
Wed May 13 19:52:48 2020 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Wed May 13 19:52:48 2020 OPTIONS IMPORT: peer-id set
Wed May 13 19:52:48 2020 OPTIONS IMPORT: adjusting link_mtu to 1627
Wed May 13 19:52:48 2020 OPTIONS IMPORT: data channel crypto options modified
Wed May 13 19:52:48 2020 Data Channel: using negotiated cipher 'AES-256-GCM'
Wed May 13 19:52:48 2020 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed May 13 19:52:48 2020 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed May 13 19:52:48 2020 ROUTE_GATEWAY 10.0.2.2/255.255.255.0 IFACE=enp0s3 HWADDR=08:00:27:3c:c7:0a
Wed May 13 19:52:48 2020 TUN/TAP device tun0 opened
Wed May 13 19:52:48 2020 TUN/TAP TX queue length set to 100
Wed May 13 19:52:48 2020 /sbin/ip link set dev tun0 up mtu 1500
Wed May 13 19:52:48 2020 /sbin/ip addr add dev tun0 local 192.168.9.6 peer 192.168.9.5
Wed May 13 19:52:50 2020 /sbin/ip route add 5.9.170.232/32 via 10.0.2.2
Wed May 13 19:52:50 2020 /sbin/ip route add 0.0.0.0/1 via 192.168.9.5
Wed May 13 19:52:50 2020 /sbin/ip route add 128.0.0.0/1 via 192.168.9.5
Wed May 13 19:52:50 2020 /sbin/ip route add 192.168.9.0/24 via 192.168.9.5
Wed May 13 19:52:50 2020 /sbin/ip route add 192.168.9.1/32 via 192.168.9.5
Wed May 13 19:52:50 2020 Initialization Sequence Completed
OpenVPN will ask for a login and password to connect. They correspond to your username and password on the service website:
Enter Auth Username: <<< Enter your E-Mail from your personal account here
Enter Auth Password: <<< Enter your password here, the same as in your personal account
Do not close the console with the OpenVPN application until while you want to use OpenVPN connection.
If you want to disconnect from the OpenVPN server, in the terminal with the OpenVPN application, press the key combination Ctrl + C
Wed May 13 20:19:07 2020 Initialization Sequence Completed
^CWed May 13 20:19:09 2020 event_wait : Interrupted system call (code=4)
Wed May 13 20:19:09 2020 /sbin/ip route del 192.168.7.0/24
Wed May 13 20:19:09 2020 /sbin/ip route del 192.168.7.1/32
Wed May 13 20:19:09 2020 /sbin/ip route del 5.9.170.232/32
Wed May 13 20:19:09 2020 /sbin/ip route del 0.0.0.0/1
Wed May 13 20:19:09 2020 /sbin/ip route del 128.0.0.0/1
Wed May 13 20:19:09 2020 Closing TUN/TAP interface
Wed May 13 20:19:09 2020 /sbin/ip addr del dev tun0 local 192.168.7.6 peer 192.168.7.5
Wed May 13 20:19:09 2020 SIGINT[hard,] received, process exiting
root@ubuntu:/home/user/Downloads/ALL-OpenVPN/RSA#