This page aims to present the configuration of a private VPN network with OpenVPN. A VPN (Virtual Private Network) allows remote access to a local network transparently as if you were connected directly to the local network. To do this, the VPN will establish a secure and encrypted communication tunnel among the internet traffic to allow exchanges. The interest of a VPN is multiple, it allows (non-exhaustive list):
In my case, it is about being able to access a private local network from a remote PC connected to the internet via wifi via a mobile with 4G connection. This allows me to be able to access the resources of my local network wherever I am. Be careful, most of the configurations presented on the internet and in particular the pages listed below present a configuration where all the flow to the client's internet goes through the VPN network, this is surely interesting for certain needs but in my case it is a perfectly useless intermediary that slows down the client's internet access. However, if you are more interested in internet access via VPN, I advise you to read the pages indicated below in the sources.
In summary, the configuration presented on this page allows access to the resources of a local network via VPN but does not allow the client to access the Internet via the VPN (he can nevertheless access it with his own direct connection).
Installation and configuration was done on Mageia, but it should adapt quite easily to all distributions.
In the following operations:
The complete network topology is as follows
I create a VPN link between the tetiaroa station clearly visible at the top right with the mana server via the 4G mobile which shares its connection, internet, the box and a router.
The sources I used to write this page are:
For the installation, for once I was content to use the package provided with my distribution which we will install as
urpmi openvpn
you just need to adapt it to the package manager of your distribution.
For the principle of the certification authority, private and public keys to secure exchanges, I refer you to this page which gives the main principles.
Now we will set up the files to launch the configuration, we install the configuration files provided by the package by copying them under /etc/openvpn which was normally created when the package was installed
cp -r /usr/share/openvpn/easy-rsa /etc/openvpn
We edit the file /etc/openvpn/easy-rsa/vars and modify it as follows
# easy-rsa parameter settings
# NOTE: If you installed from an RPM,
# don't edit this file in place in
# /usr/share/openvpn/easy-rsa --
# instead, you should copy the whole
# easy-rsa directory to another location
# (such as /etc/openvpn) so that your
# edits will not be wiped out by a future
# OpenVPN package upgrade.
# This variable should point to
# the top level of the easy-rsa
# tree.
# on indique le chemin du répertoire easy-rsa
export EASY_RSA="/etc/openvpn/easy-rsa"
#
# This variable should point to
# the requested executables
#
export OPENSSL="openssl"
export PKCS11TOOL="pkcs11-tool"
export GREP="grep"
# This variable should point to
# the openssl.cnf file included
# with easy-rsa.
export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`
# Edit this variable to point to
# your soon-to-be-created key
# directory.
#
# WARNING: clean-all will do
# a rm -rf on this directory
# so make sure you define
# it correctly!
export KEY_DIR="$EASY_RSA/keys"
# Issue rm -rf warning
echo NOTE: If you run ./clean-all, I will be doing a rm -rf on
$KEY_DIR
# PKCS11 fixes
export PKCS11_MODULE_PATH="dummy"
export PKCS11_PIN="dummy"
# Increase this to 2048 if you
# are paranoid. This will slow
# down TLS negotiation performance
# as well as the one-time DH parms
# generation process.
export KEY_SIZE=2048
# In how many days should the root CA key expire?
export CA_EXPIRE=3650
# In how many days should certificates expire?
export KEY_EXPIRE=3650
# These are the default values for fields
# which will be placed in the certificate.
# Don't leave any of these fields blank.
export KEY_COUNTRY="FR"
export KEY_PROVINCE="Bretagne"
export KEY_CITY="BreizhCity"
export KEY_ORG="Funix"
export KEY_EMAIL="olivier.hoarau@funix.org"
export KEY_EMAIL=olivier.hoarau@funix.org
export KEY_CN=mana
export KEY_NAME=mana
export KEY_OU=funix
export PKCS11_MODULE_PATH=""
export PKCS11_PIN=1234
In practice I just indicated the path of easy-rsa, increased the key size to 2048 (instead of 1024) and entered all the information concerning the country, the region (province), the city (city), the organization, the email, the unique identification (common name), the name of the server and the organization (organizational unit). It would seem for a private network that it does not have a big impact if we put a little crazy values.
Note that everything related to PKCS#11 concerns physical equipment such as dongle, PCMCIA card, microSD or USB key with integrated encryption key "cryptographic tokens" which allows you to connect and which gives additional security, because without this physical key, no connection. For my part I don't have one, so I forget.
Now we check the version of openssl (which must be installed) by typing
openssl version
at my place it gives
OpenSSL 1.1.0l Sep 10, 2019
so in the /etc/openvpn/easy-rsa directory I created the following link
ln -s openssl-1.0.0.cnf openssl.cnf
The new configuration is created from the information provided in vars by typing
source vars
here is the result
NOTE: If you run ./clean-all, I will be doing a rm -rf on /etc/openvpn/easy-rsa/keys
For security reasons, we clean up to start from a blank configuration and delete any old keys found under /etc/openvpn/easy-rsa/keys by typing
./clean-all
We now generate the certificates of the certification authority with the command
./build-ca
here is the result
Generating a
RSA private key
...................................+++++
...............+++++
writing new private key to
'ca.key'
-----
You are about to be asked
to enter information that will be incorporated
into your certificate
request.
What you are about to
enter is what is called a Distinguished Name or a DN.
There are quite a few
fields but you can leave some blank
For some fields there will
be a default value,
If you enter '.', the
field will be left blank.
-----
Country Name (2 letter
code) [FR]:FR
State or Province Name
(full name) [Bretagne]:Bretagne
Locality Name (eg, city)
[BreizhCity]:
Organization Name (eg,
company) [Funix]:
Organizational Unit Name
(eg, section) [funix]:
Common Name (eg, your name
or your server's hostname) [mana]:
Name [mana]:mana
Email Address
[olivier.hoarau@funix.org]:
I hit Enter each time, because it takes the information entered in the vars file. As a reminder, the certification authority or trusted third party is used to authenticate public keys, in practice we create a personal certification authority that will not be recognized on the internet but it does not harm the operation, see here for more details.
Now we will create the server private key and certify it with the personal certification authority by typing
./build-key-server mana
here is the result
Generating a RSA private key
....................+++++
.............................................................+++++
writing new private key to 'mana.key'
-----
You are about to be asked to enter information that will be
incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished
Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [FR]:
State or Province Name (full name) [Bretagne]:
Locality Name (eg, city) [BreizhCity]:
Organization Name (eg, company) [Funix]:
Organizational Unit Name (eg, section) [funix]:
Common Name (eg, your name or your server's hostname) [mana]:
Name [mana]:
Email Address [olivier.hoarau@funix.org]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Using configuration from /etc/openvpn/easy-rsa/openssl.cnf
Can't open /etc/openvpn/easy-rsa/keys/index.txt.attr for
reading, No such file or directory
139865288554304:error:02001002:system library:fopen:No such file
or
directory:crypto/bio/bss_file.c:74:fopen('/etc/openvpn/easy-rsa/keys/index.txt.attr','r')
139865288554304:error:2006D080:BIO routines:BIO_new_file:no such
file:crypto/bio/bss_file.c:81:
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName
:PRINTABLE:'FR'
stateOrProvinceName :PRINTABLE:'Bretagne'
localityName
:PRINTABLE:'BreizhCity'
organizationName
:PRINTABLE:'Funix'
organizationalUnitName:PRINTABLE:'funix'
commonName
:PRINTABLE:'mana'
name
:PRINTABLE:'mana'
emailAddress
:IA5STRING:'olivier.hoarau@funix.org'
Certificate is to be certified until Jul 20 12:29:52 2031 GMT
(3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
Note that I left a blank field at the challenge password level. The interest of the latter is a little obscure, you will find an explanation here .
We now generate the private key for the openvpn client station which will be a thinkpad named tetiaroa and we certify the key
./build-key-pass tetiaroa
This is the result
Generating a RSA private key
..................................+++++
...........................+++++
writing new private key to 'tetiaroa.key'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----
You are about to be asked to enter information that will be
incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished
Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [FR]:
State or Province Name (full name) [Bretagne]:
Locality Name (eg, city) [BreizhCity]:
Organization Name (eg, company) [Funix]:
Organizational Unit Name (eg, section) [funix]:
Common Name (eg, your name or your server's hostname)
[tetiaroa]:
Name [mana]:tetiaroa
Email Address [olivier.hoarau@funix.org]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Using configuration from /etc/openvpn/easy-rsa/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName
:PRINTABLE:'FR'
stateOrProvinceName :PRINTABLE:'Bretagne'
localityName
:PRINTABLE:'BreizhCity'
organizationName
:PRINTABLE:'Funix'
organizationalUnitName:PRINTABLE:'funix'
commonName
:PRINTABLE:'tetiaroa'
name
:PRINTABLE:'tetiaroa'
emailAddress
:IA5STRING:'olivier.hoarau@funix.org'
Certificate is to be certified until Jul 20 12:33:48 2031 GMT
(3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
You must enter a password at the "PEM pass phrase" level, it will be useful when you launch the client connection. However, there too, it is useless to enter the challenge password. We will now add additional security that we may consider superfluous by encrypting the client's private key with the 3DES algorithm by typing
openssl rsa -in tetiaroa.key -des3 -out tetiaroa.3des.key
here is the result
Enter pass
phrase for tetiaroa.key:
writing RSA key
Enter PEM pass phrase:
Verifying - Enter PEM pass
phrase:
I entered the same password that was used when the client's private key was initially generated.
We will now set up a key exchange called Diffie-Hellman , this is an additional security that will allow the server and the client "to agree on a number (which they can use as a key to encrypt the following conversation) without a third agent (...) being able to discover the number, even after having listened to all their exchanges" (extract from the Wikipedia page on Diffie-Hellman )
To generate the Diffie Hellman parameters for the server we will type
./build-dh
here is the result
Generating DH parameters, 2048
bit long safe prime, generator 2
This is going to take a long time
........+...................................................................................................................................................................................................+............................
....................................................................+...........................................................+.........................................................................................................
....................................+.........................................................................................................................................+..................+.......................................
(...)
....................................................................................................................................................................................................................................+...............................................................................................................+.+..............................................................................................+...................................................
.................................+.........................................................++*++*++*++*
it's longer than the previous commands, I shortened the output above.
Now we will create an HMAC (Hash-Based Message Authentication Code) key which adds additional security against DoS (Denial of Service) attacks, the client will have to present the HMAC key known to the server to start the dialogue, otherwise it is rejected outright without going any further.
When someone tries to connect without being known, it could generate this kind of message on the server
Jul 24 11:12:02 mana.kervao.fr openvpn[26146]: TLS Error: cannot locate HMAC in incoming packet from [AF_INET]185.200.118.41:33825
To create this HMAC key we type
openvpn --genkey --secret keys/ta.key
Now we will find all the keys in the directory /etc/openvpn/easy-rsa/keys . Here is the detail of each of the keys
File | Used by | Content | Private |
ca.crt | server and clients | CA Certificate Authority Certificate | No |
ca.key | Key signing machine only | CA Certificate Authority Private Key | Yes |
dh2048.pem | server only | Diffie Hellman Parameters | No |
mana.crt | server only | Certificate of Mana | No |
mana.key | server only | Mana Private Key | Yes |
tetiaroa.crt | customer only | Tetiaroa Certificate | No |
tetiaroa.key | customer only | tetiaroa's private key | Yes |
your.key | server and clients | HMAC Private Key | Yes |
We will copy a default configuration file installed during the installation of the package by typing
cp /usr/share/openvpn/sample-config-files/server.conf /etc/openvpn
Here is its commented content
################################################ DNS servers provided by opendns.com.
# I comment these lines to
avoid using
# VPN DNS on the client
Note that lines starting with ; are comments. The following points from the server configuration file should be noted:
local 192.168.1.11
port 1194
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.1.0 255.255.255.0"
client-config-dir
ccd
route 192.168.43.0
255.255.255.0
;push
"dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS
208.67.220.220"
;push "redirect-gateway def1 bypass-dhcp"
user openvpn
group openvpn
now I will create the directory /etc/openvpn/ccd which will contain the tetiaroa file which will contain
iroute 192.168.43.0 255.255.255.0
In terms of routes, it will be quite minimalistic because we will not activate the IP masquerade on the server so that the client can access the Internet via VPN. However, the shorewall firewall will have to be configured. The topology of my network is recalled in the diagram presented above. On my box, I redirected the connections to port 1194 to my router, on my router they are redirected to my mana server with the address 192.168.1.11 which, as a reminder, has a network interface designated by eno2.
The following files will be modified (additions in italics)
contents of /etc/shorewall/interfaces
lan eno2 -
vpn tun0 -
contents of /etc/shorewall/policy
fw lan ACCEPT
vpn all ACCEPT
all all REJECT info
contents of /etc/shorewall/rules
ACCEPT fw lan icmpcontents of /etc/shorewall/tunnels
openvpn:1194 lan 0.0.0.0/0 vpn
contents of /etc/shorewall/zones
fw firewall
lan ipv4
vpn ipv4
systemctl
stop shorewall
systemctl start shorewall
For the installation, it's like for the server, you will have to install the openvpn package , under mageia
urpmi openvpn
On the server (and not the client) we will create the file /etc/openvpn/easy-rsa/keys/Default.txt which will contain
client
dev tun
proto udp
remote mana-noip 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ns-cert-type server
key-direction 1
cipher AES-256-CBC
compress lz4-v2
verb 1
mute 20
script-security 2
bash MakeOpenVPN.sh
here is the result
Enter the
name of an existing client:
tetiaroa
Public key found: tetiaroa
Private key found:
tetiaroa.3des.key
CA public key found:
ca.crt
tls-auth private key
found: ta.key
Done! tetiaroa.ovpn
generated successfully.
MakeOpenVPN.sh: line 73:
Step: command not found
This will create a complete configuration file tetiaroa.ovpn including the configuration and keys needed to connect. This file must be placed in the client's /etc/openvpn directory , you will need to make sure to transfer this file securely from the server to the client.
systemctl enable openvpn@server.service
here is the result
systemctl
enable openvpn@server.service
Created symlink
/etc/systemd/system/openvpn.target.wants/openvpn@server.service
→ /usr/lib/systemd/system/openvpn@.service.
To launch openvpn we will type
systemctl start openvpn@server.service
here is the result with journalctl and verbose mode 4
juil. 24 11:21:56 mana.kervao.fr systemd[1]: Starting OpenVPN
Robust And Highly Flexible Tunneling Application (Config:
server)...
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: Current
Parameter Settings:
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
config = 'server.conf'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: mode
= 1
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
persist_config = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
persist_mode = 1
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
show_ciphers = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
show_digests = DISABLED
juil. 24 11:21:56 mana.kervao.fr audit[1]: SERVICE_START pid=1
uid=0 auid=4294967295 ses=4294967295 msg='unit=openvpn@server
comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=?
terminal=? res=success'
juil. 24 11:21:56 mana.kervao.fr systemd[1]: Started OpenVPN
Robust And Highly Flexible Tunneling Application (Config:
server).
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
show_engines = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
genkey = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
key_pass_file = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
show_tls_ciphers = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
connect_retry_max = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: Connection
profiles [0]:
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
proto = udp
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
local = '192.168.1.11'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
local_port = '1194'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_port = '1194'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_float = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
bind_defined = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
bind_local = ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
bind_ipv6_only = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
connect_retry_seconds = 5
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
connect_timeout = 120
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
socks_proxy_server = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
socks_proxy_port = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tun_mtu = 1500
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tun_mtu_defined = ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
link_mtu = 1500
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
link_mtu_defined = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tun_mtu_extra = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tun_mtu_extra_defined = DISABLED
juil. 24 11:21:56 mana.kervao.fr kernel: audit: type=1130
audit(1627118516.126:193602): pid=1 uid=0 auid=4294967295
ses=4294967295 msg='unit=openvpn@server comm="systemd"
exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=?
res=success'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
mtu_discover_type = -1
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
fragment = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
mssfix = 1450
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
explicit_exit_notification = 1
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: Connection
profiles END
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_random = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ipchange = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: dev
= 'tun'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
dev_type = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
dev_node = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
lladdr = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
topology = 1
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_local = '10.8.0.1'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_remote_netmask = '10.8.0.2'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_noexec = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_nowarn = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_ipv6_local = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_ipv6_netbits = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_ipv6_remote = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
shaper = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
mtu_test = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
mlock = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
keepalive_ping = 10
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
keepalive_timeout = 120
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
inactivity_timeout = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ping_send_timeout = 10
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ping_rec_timeout = 240
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ping_rec_timeout_action = 2
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ping_timer_remote = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remap_sigusr1 = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
persist_tun = ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
persist_local_ip = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
persist_remote_ip = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
persist_key = ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
passtos = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
resolve_retry_seconds = 1000000000
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
resolve_in_advance = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
username = 'openvpn'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
groupname = 'openvpn'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
chroot_dir = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
cd_dir = '/etc/openvpn/'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
writepid = '/run/openvpn/server.pid'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
up_script = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
down_script = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
down_pre = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
up_restart = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
up_delay = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
daemon = ENABLED
juil. 24 11:21:56 mana.kervao.fr systemd-networkd[605]: tun0:
Gained carrier
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
inetd = 0
juil. 24 11:21:56 mana.kervao.fr systemd-udevd[9494]:
link_config: autonegotiation is unset or enabled, the speed and
duplex are not writable.
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: log
= DISABLED
juil. 24 11:21:56 mana.kervao.fr systemd-networkd[605]: tun0:
Gained IPv6LL
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
suppress_timestamps = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
machine_readable_output = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: nice
= 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
verbosity = 4
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: mute
= 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
gremlin = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
status_file = 'openvpn-status.log'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
status_file_version = 1
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
status_file_update_freq = 60
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: occ
= ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
rcvbuf = 0
juil. 24 11:21:56 mana.kervao.fr systemd-udevd[9494]: Process
'net_create_ifcfg' failed with exit code 1.
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
sndbuf = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: mark
= 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
sockflags = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
fast_io = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
comp.alg = 11
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
comp.flags = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route_script = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route_default_gateway = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route_default_metric = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route_noexec = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route_delay = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route_delay_window = 30
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route_delay_defined = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route_nopull = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route_gateway_via_dhcp = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
allow_pull_fqdn = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route 10.8.0.0/255.255.255.0/default (not set)/default (not set)
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
route 192.168.43.0/255.255.255.0/default (not set)/default (not
set)
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
management_addr = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
management_port = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
management_user_pass = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
management_log_history_cache = 250
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
management_echo_buffer_size = 100
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
management_write_peer_info_file = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
management_client_user = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
management_client_group = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
management_flags = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
shared_secret_file = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
key_direction = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ciphername = 'AES-256-CBC'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ncp_enabled = ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ncp_ciphers = 'AES-256-GCM:AES-128-GCM'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
authname = 'SHA1'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
prng_hash = 'SHA1'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
prng_nonce_secret_len = 16
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
keysize = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
engine = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
replay = ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
mute_replay_warnings = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
replay_window = 64
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
replay_time = 15
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
packet_id_file = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
use_iv = ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
test_crypto = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tls_server = ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tls_client = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
key_method = 2
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ca_file = '/etc/openvpn/easy-rsa/keys/ca.crt'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ca_path = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
dh_file = '/etc/openvpn/easy-rsa/keys/dh2048.pem'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
cert_file = '/etc/openvpn/easy-rsa/keys/mana.crt'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
extra_certs_file = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
priv_key_file = '/etc/openvpn/easy-rsa/keys/mana.key'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
pkcs12_file = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
cipher_list = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
cipher_list_tls13 = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tls_cert_profile = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tls_verify = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tls_export_cert = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
verify_x509_type = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
verify_x509_name = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
crl_file = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ns_cert_type = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_ku[i] = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
remote_cert_eku = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ssl_flags = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tls_timeout = 2
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
renegotiate_bytes = -1
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
renegotiate_packets = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
renegotiate_seconds = 3600
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
handshake_window = 60
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
transition_window = 3600
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
single_session = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_peer_info = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tls_exit = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tls_auth_file = '/etc/openvpn/easy-rsa/keys/ta.key'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tls_crypt_file = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
server_network = 10.8.0.0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
server_netmask = 255.255.255.0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
server_network_ipv6 = ::
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
server_netbits_ipv6 = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
server_bridge_ip = 0.0.0.0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
server_bridge_netmask = 0.0.0.0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
server_bridge_pool_start = 0.0.0.0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
server_bridge_pool_end = 0.0.0.0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_entry = 'route 192.168.1.0 255.255.255.0'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_entry = 'compress lz4-v2'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_entry = 'route 10.8.0.1'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_entry = 'topology net30'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_entry = 'ping 10'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_entry = 'ping-restart 120'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_pool_defined = ENABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_pool_start = 10.8.0.4
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_pool_end = 10.8.0.251
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_pool_netmask = 0.0.0.0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_pool_persist_filename = 'ipp.txt'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_pool_persist_refresh_freq = 600
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_ipv6_pool_defined = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_ipv6_pool_base = ::
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ifconfig_ipv6_pool_netbits = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
n_bcast_buf = 256
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tcp_queue_limit = 64
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
real_hash_size = 256
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
virtual_hash_size = 256
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
client_connect_script = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
learn_address_script = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
client_disconnect_script = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
client_config_dir = 'ccd'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
ccd_exclusive = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
tmp_dir = '/tmp'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_ifconfig_defined = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_ifconfig_local = 0.0.0.0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_ifconfig_remote_netmask = 0.0.0.0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_ifconfig_ipv6_defined = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_ifconfig_ipv6_local = ::/0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
push_ifconfig_ipv6_remote = ::
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
enable_c2c = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
duplicate_cn = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
cf_max = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
cf_per = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
max_clients = 1024
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
max_routes_per_client = 256
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
auth_user_pass_verify_script = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
auth_user_pass_verify_script_via_file = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
auth_token_generate = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
auth_token_lifetime = 0
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
port_share_host = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
port_share_port = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
client = DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: pull
= DISABLED
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]:
auth_user_pass_file = '[UNDEF]'
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: OpenVPN 2.4.9
x86_64-mageia-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL]
[MH/PKTINFO] [AEAD] built on Apr 28 2020
juil. 24 11:21:56 mana.kervao.fr openvpn[9490]: library
versions: OpenSSL 1.1.0l 10 Sep 2019, LZO 2.10
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: Diffie-Hellman
initialized with 2048 bit key
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: Outgoing Control
Channel Authentication: Using 160 bit message hash 'SHA1' for
HMAC authentication
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: Incoming Control
Channel Authentication: Using 160 bit message hash 'SHA1' for
HMAC authentication
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: TLS-Auth MTU
parms [ L:1622 D:1184 EF:66 EB:0 ET:0 EL:3 ]
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: ROUTE_GATEWAY
192.168.1.1/255.255.255.0 IFACE=eno2 HWADDR=79:2e:cb:62:8f:ce
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: TUN/TAP device
tun0 opened
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: TUN/TAP TX queue
length set to 100
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: do_ifconfig,
tt->did_ifconfig_ipv6_setup=0
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]:
/usr/sbin/ifconfig tun0 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: /usr/sbin/route
add -net 192.168.43.0 netmask 255.255.255.0 gw 10.8.0.2
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: /usr/sbin/route
add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: Data Channel MTU
parms [ L:1622 D:1450 EF:122 EB:406 ET:0 EL:3 ]
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: Could not
determine IPv4/IPv6 protocol. Using AF_INET
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: Socket Buffers:
R=[212992->212992] S=[212992->212992]
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: UDPv4 link local
(bound): [AF_INET]192.168.1.11:1194
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: UDPv4 link
remote: [AF_UNSPEC]
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: GID set to
openvpn
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: UID set to
openvpn
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: MULTI:
multi_init called, r=256 v=256
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: IFCONFIG POOL:
base=10.8.0.4 size=62, ipv6=0
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]:
ifconfig_pool_read(), in='tetiaroa,10.8.0.4', TODO: IPv6
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: succeeded ->
ifconfig_pool_set()
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: IFCONFIG POOL
LIST
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]:
tetiaroa,10.8.0.4
juil. 24 11:21:56 mana.kervao.fr openvpn[9491]: Initialization
Sequence Completed
You can get an idea of the server status by typing
systemctl status openvpn@server.service
here is the result
● openvpn@server.service - OpenVPN Robust And Highly Flexible Tunneling Application (Config: server)Now we see that the tunnel was created by typing on the server
ifconfig -a
we see the tun0 tunnel which has appeared
tun0:
flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu
1500
inet 10.8.0.1
netmask 255.255.255.255 destination 10.8.0.2
inet6
fe79::8e03:7e65:1ae7:933 prefixlen 64 scopeid
0x20<link>
unspec
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen
100 (UNSPEC)
RX packets 0
bytes 0 (0.0 B)
RX errors 0
dropped 0 overruns 0 frame 0
TX packets 12
bytes 726 (726.0 B)
TX errors 0
dropped 0 overruns 0 carrier 0 collisions 0
The server has the address in the VPN network 10.8.0.1 as indicated in its configuration file.
Now we are going to launch the connection on the client side, so we go to the client and type
openvpn --config /etc/openvpn/tetiaroa.ovpn
here is the result
2021-07-23 17:06:29
WARNING: Compression for receiving enabled. Compression has
been used in the past to break encryption. Sent packets are
not compressed unless "allow-compression yes" is also set.
2021-07-23 17:06:29
DEPRECATED OPTION: --cipher set to 'AES-256-CBC' but missing
in --data-ciphers (AES-256-GCM:AES-128-GCM). Future OpenVPN
version will ignore --cipher for cipher negotiations. Add
'AES-256-CBC' to --data-ciphers or
change --cipher
'AES-256-CBC' to --data-ciphers-fallback 'AES-256-CBC' to
silence this warning.
2021-07-23 17:06:29
OpenVPN 2.5.0 x86_64-mageia-linux-gnu [SSL (OpenSSL)] [LZO]
[LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Nov 9
2020
2021-07-23 17:06:29
library versions: OpenSSL 1.1.1k 25 Mar 2021, LZO 2.10
2021-07-23 17:06:29
WARNING: --ns-cert-type is DEPRECATED. Use --remote-cert-tls
instead.
2021-07-23 17:06:29 NOTE:
the current --script-security setting may allow this
configuration to call user-defined scripts
🔐 Enter Private Key
Password:
***********
2021-07-23 17:06:36
WARNING: this configuration may cache passwords in memory --
use the auth-nocache option to prevent this
2021-07-23 17:06:37
TCP/UDP: Preserving recently used remote address:
[AF_INET]94.11.100.53:1194
2021-07-23 17:06:37 UDP
link local: (not bound)
2021-07-23 17:06:37 UDP
link remote: [AF_INET]94.11.100.53:1194
2021-07-23 17:06:38
[mana-noip] Peer Connection Initiated with
[AF_INET]94.11.100.53:1194
2021-07-23 17:06:39
WARNING: Compression for receiving enabled. Compression has
been used in the past to break encryption. Sent packets are
not compressed unless "allow-compression yes" is also set.
2021-07-23 17:06:39
TUN/TAP device tun0 opened
2021-07-23 17:06:39
net_iface_mtu_set: mtu 1500 for tun0
2021-07-23 17:06:39
net_iface_up: set tun0 up
2021-07-23 17:06:39
net_addr_ptp_v4_add: 10.8.0.6 peer 10.8.0.5 dev tun0
2021-07-23 17:06:39
/etc/openvpn/update-resolv-conf tun0 1500 1553 10.8.0.6
10.8.0.5 init
dhcp-option DNS
208.67.222.222
dhcp-option DNS
208.67.220.220
2021-07-23 17:06:39
Initialization Sequence Completed
You will need to enter the password entered earlier when generating the client key. Note the address 94.11.100.53 which corresponds to the real IP address of the server on the Internet.
There too by typing
ifconfig -a
we see the tunnel that has been put in place
tun0:
flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>
mtu 1500
inet 10.8.0.6
netmask 255.255.255.255 destination 10.8.0.5
inet6
fe79::fe30:bced:5d5e:d40e prefixlen 64 scopeid
0x20<link>
unspec
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen
500 (UNSPEC)
RX packets 224
bytes 52524 (51.2 KiB)
RX errors 0
dropped 0 overruns 0 frame 0
TX packets 4433
bytes 413548 (403.8 KiB)
TX errors 0
dropped 0 overruns 0 carrier 0 collisions 0
The client ends up with the address 10.8.0.6 on the VPN network. And this is what it looks like on the server side
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]: MULTI:
multi_create_instance called
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 Re-using SSL/TLS context
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 LZ4v2 compression initializing
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 Control Channel MTU parms [ L:1622 D:1184
EF:66 EB:0 ET:0 EL:3 ]
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 Data Channel MTU parms [ L:1622 D:1450
EF:122 EB:406 ET:0 EL:3 ]
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 Local Options String (VER=V4): 'V4,dev-type
tun,link-mtu 1558,tun-mtu 1500,proto UDPv4,comp-lzo,keydir
0,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method
2,tls-server'
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 Expected Remote Options String (VER=V4):
'V4,dev-type tun,link-mtu 1558,tun-mtu 1500,proto
UDPv4,comp-lzo,keydir 1,cipher AES-256-CBC,auth SHA1,keysize
256,tls-auth,key-method 2,tls-client'
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 TLS: Initial packet from
[AF_INET]78.203.244.46:52136, sid=8fd78fcb 9aca764b
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 VERIFY OK: depth=1, C=FR, ST=Bretagne,
L=BreizhCity, O=Funix, OU=funix, CN=mana-noip, name=mana,
emailAddress=olivier.hoarau@funix.org
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 VERIFY OK: depth=0, C=FR, ST=Bretagne,
L=BreizhCity, O=Funix, OU=funix, CN=tetiaroa, name=tetiaroa,
emailAddress=olivier.hoarau@funix.org
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_VER=2.5.0
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_PLAT=linux
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_PROTO=6
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_NCP=2
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info:
IV_CIPHERS=AES-256-GCM:AES-128-GCM:AES-256-CBC
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_LZ4=1
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_LZ4v2=1
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_LZO=1
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_COMP_STUB=1
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_COMP_STUBv2=1
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 peer info: IV_TCPNL=1
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 Control Channel: TLSv1.2, cipher TLSv1.2
ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
78.203.244.46:52136 [tetiaroa] Peer Connection Initiated with
[AF_INET]78.203.244.46:52136
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 OPTIONS IMPORT: reading client
specific options from: ccd/tetiaroa
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 MULTI_sva: pool returned
IPv4=10.8.0.6, IPv6=(Not enabled)
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 MULTI: Learn: 10.8.0.6 ->
tetiaroa/78.203.244.46:52136
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 MULTI: primary virtual IP for
tetiaroa/78.203.244.46:52136: 10.8.0.6
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 MULTI: internal route
192.168.43.0/24 -> tetiaroa/78.203.244.46:52136
juil. 24 12:27:46 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 MULTI: Learn: 192.168.43.0/24 ->
tetiaroa/78.203.244.46:52136
juil. 24 12:27:47 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 PUSH: Received control message:
'PUSH_REQUEST'
juil. 24 12:27:47 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 SENT CONTROL [tetiaroa]:
'PUSH_REPLY,route 192.168.1.0 255.255.255.0,dhcp-option DNS
208.67.222.222,dhcp-option DNS 208.67.220.220,compress
lz4-v2,route 10.8.0.1,topology net30,ping 10,ping-restart
120,ifconfig 10.8.0.6 10.8.0.5,peer-id 0,cipher AES-256-GCM'
(status=1)
juil. 24 12:27:47 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 Data Channel: using negotiated
cipher 'AES-256-GCM'
juil. 24 12:27:47 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 Data Channel MTU parms [ L:1550
D:1450 EF:50 EB:406 ET:0 EL:3 ]
juil. 24 12:27:47 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 Outgoing Data Channel: Cipher
'AES-256-GCM' initialized with 256 bit key
juil. 24 12:27:47 mana.kervao.fr openvpn[4166]:
tetiaroa/78.203.244.46:52136 Incoming Data Channel: Cipher
'AES-256-GCM' initialized with 256 bit key
We find the address 78.203.244.46 which corresponds to the IP address of my 4G mobile on the internet.
Now from the client I can "ping" the server with its local network name ( mana in my example). The ip r command on the client will give
default via 192.168.43.1
dev wlp3s0 proto dhcp metric 600
10.8.0.1 via 10.8.0.5 dev
tun0 proto static metric 50
10.8.0.5 dev tun0 proto
kernel scope link src 10.8.0.6 metric 50
94.11.100.53 via
192.168.43.1 dev wlp3s0 proto static metric 600
192.168.1.0/24 via
10.8.0.5 dev tun0 proto static metric 50
192.168.43.0/24 dev wlp3s0
proto kernel scope link src 192.168.43.70 metric 600
192.168.43.1 dev wlp3s0
proto static scope link metric 600
The client's wifi interface being wlp3s0 and for the record
To mount an NFS directory from the server to the client, I added the following line to the server's /etc/hosts file
10.8.0.6 tetiaroa-vpn.kervao.fr tetiaroa-vpn
assuming that the assigned address remains fixed (this is configured in the server configuration file)
then in the /etc/exports file I added tetiaroa-vpn and took it into account with exportfs -a and that's it, we have access to all the network shares remotely via the VPN.
It will probably be necessary to modify the shorewall configuration in this way
in the /etc/shorewall/interfaces file we add the line
vpn tun0 -
in the file /etc/shorewall/zones we add
vpn ipv4
and in the file /etc/shorewall/rules
ACCEPT all vpn all
You can also use a VPN client with a graphical interface, this page lists a number of them. For those on mageia we can turn to drakvpn. For my part I chose NetworkManager which can be found on any distribution which allows you to directly take into account the tetiaroa.ovpn client file
Under plasma when you click on the configuration parameters at the Connections level , I click on the + to create a new connection then Import a VPN connection...
I designate my file /etc/openvpn/tetiaroa.ovpn the different fields are entered automatically and all you have to do is enter the password.
That's not all, you will have to click on the IPv4 tab then Routes... and check the box Use only for resources on this connection, otherwise all the internet flow will still go to the VPN tunnel.
The VPN network is also accessible from the Dashboard applet
[ Back to FUNIX home page ] |