Hi,
I have installed an OpenVPN server successfully on my server and I am using it with the network-manager on my laptop.
Here is the server.conf:
port 1194
proto udp
dev tun
ca ca.crt
cert MyVPN.crt
key MyVPN.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
persist-key
persist-tun
verb 3
And my local config of the network-manger:
[vpn]
ca=/openvpn/ca.crt
cert=/openvpn/user.crt
cert-pass-flags=1
comp-lzo=yes
connection-type=tls
key=/openvpn/user.key
port=1194
remote=myip.net
tunnel-mtu=1500
service-type=org.freedesktop.NetworkManager.openvpn
[ipv4]
dns=8.8.8.8;
dns-search=
method=auto
Now I want to connect to my OpenVPN server from a other computer with the command line. So I copied ca.crt, user.crt and user.key to /etc/openvpn and created the client.conf in /etc/openvpn/client.conf:
port 1194
remote myip.net
proto udp
dev tun
ca ca.crt
cert user.crt
key user.key
comp-lzo
status openvpn-status.log
verb 3
tun-mtu 1500
#mssfix 1400
dhcp-option DNS 8.8.8.8
Then I start OpenVPN with openvpn --config client.conf --tls-client, here is the output of the console:
openvpn --config client.conf --tls-client
Thu Feb 16 11:29:14 2017 disabling NCP mode (--ncp-disable) because not in P2MP client or server mode
Thu Feb 16 11:29:14 2017 WARNING: file 'user.key' is group or others accessible
Thu Feb 16 11:29:14 2017 OpenVPN 2.4.0 [git:master/f5bf296bacce76a8+] x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Dec 29 2016
Thu Feb 16 11:29:14 2017 library versions: OpenSSL 1.0.2k 26 Jan 2017, LZO 2.08
Thu Feb 16 11:29:14 2017 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Thu Feb 16 11:29:14 2017 TUN/TAP device tun0 opened
Thu Feb 16 11:29:14 2017 TUN/TAP TX queue length set to 100
Thu Feb 16 11:29:14 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]IP
Thu Feb 16 11:29:14 2017 Socket Buffers: R=[212992->212992] S=[212992->212992]
Thu Feb 16 11:29:14 2017 UDP link local (bound): [AF_INET][undef]:1194
Thu Feb 16 11:29:14 2017 UDP link remote: [AF_INET]IP
Thu Feb 16 11:29:14 2017 TLS: Initial packet from [AF_INET]IP:1194, sid=ee22c562 44024d16
Thu Feb 16 11:29:14 2017 VERIFY OK: depth=1, C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=MyOrganizationalUnit, CN=Fort-Funston CA, name=EasyRSA, emailAddress=me@myhost.mydomain
Thu Feb 16 11:29:14 2017 VERIFY OK: depth=0, C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=MyOrganizationalUnit, CN=MyVPN, name=EasyRSA, emailAddress=me@myhost.mydomain
And here the server log:
Feb 16 05:31:19 vpn ovpn-server[7045]: IP:1194 TLS: Initial packet from [AF_INET]IP:1194, sid=e2cc1cac 36412abf
Feb 16 05:31:19 vpn ovpn-server[7045]: IP:1194 VERIFY OK: depth=1, C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=MyOrganizationalUnit, CN=Fort-Funston CA, name=EasyRSA, emailAddress=me@myhost.mydomain
Feb 16 05:31:19 vpn ovpn-server[7045]: IP:1194 VERIFY OK: depth=0, C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=MyOrganizationalUnit, CN=client, name=EasyRSA, emailAddress=me@myhost.mydomain
Feb 16 05:31:19 vpn ovpn-server[7045]: IP:1194 TLS_ERROR: BIO read tls_read_plaintext error: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac
Feb 16 05:31:19 vpn ovpn-server[7045]: IP:1194 TLS Error: TLS object -> incoming plaintext read error
Feb 16 05:31:19 vpn ovpn-server[7045]: IP:1194 TLS Error: TLS handshake failed
Feb 16 05:31:19 vpn ovpn-server[7045]: IP:1194 SIGUSR1[soft,tls-error] received, client-instance restarting
Any idea what is going wrong?