sudo openvpn --auth-nocache --config Downloads/ubuntu.ovpn [sudo] password for chris: Fri Dec 15 09:34:04 2017 OpenVPN 2.4.3 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 3 2017 Fri Dec 15 09:34:04 2017 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08 Fri Dec 15 09:34:05 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]81.153.56.141:1194 Fri Dec 15 09:34:05 2017 UDP link local: (not bound) Fri Dec 15 09:34:05 2017 UDP link remote: [AF_INET]81.153.56.141:1194 Fri Dec 15 09:34:08 2017 [server] Peer Connection Initiated with [AF_INET]81.153.56.141:1194 Fri Dec 15 09:34:09 2017 TUN/TAP device tun0 opened Fri Dec 15 09:34:09 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0 Fri Dec 15 09:34:09 2017 /sbin/ip link set dev tun0 up mtu 1500 Fri Dec 15 09:34:09 2017 /sbin/ip addr add dev tun0 10.8.0.4/24 broadcast 10.8.0.255 Fri Dec 15 09:34:09 2017 Initialization Sequence Completed
The config works fine on Android, Windows, and Mac so I presume it’s an issue with Ubuntu 17.10
Is there a reason it’s not working? Here’s the server config;
dev tun proto udp port 1194 ca /etc/openvpn/easy-rsa/pki/ca.crt cert /etc/openvpn/easy-rsa/pki/issued/server.crt key /etc/openvpn/easy-rsa/pki/private/server.key dh /etc/openvpn/easy-rsa/pki/dh4096.pem topology subnet server 10.8.0.0 255.255.255.0 # server and remote endpoints # ifconfig 10.8.0.1 10.8.0.2 # Add route to Client routing table for the OpenVPN Server # push "route 10.8.0.1 255.255.255.255" # Add route to Client routing table for the OPenVPN Subnet # push "route 10.8.0.0 255.255.255.0" # your local subnet # push "route 0.0.0.0 " # Set your primary domain name server address for clients push "dhcp-option DNS 208.67.222.222" push "dhcp-option DNS 208.67.220.220" # Override the Client default gateway by using 0.0.0.0/1 and # 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of # overriding but not wiping out the original default gateway. push "redirect-gateway def1" client-to-client duplicate-cn keepalive 10 120 tls-version-min 1.2 tls-auth /etc/openvpn/easy-rsa/pki/ta.key 0 cipher AES-256-CBC auth SHA256 comp-lzo user nobody group nogroup persist-key persist-tun crl-verify /etc/openvpn/crl.pem status /var/log/openvpn-status.log 20 status-version 3 log /var/log/openvpn.log verb 1
However I cannot connect to to any servers or services e.g
192.168.1.100:6789
this IP works from all other devices, Android, Mac & Windows, just not Linux
Answer
I think this is just a syntax error. Linux does not like this part
– ifconfig 10.8.0.1 10.8.0.2
– push “route 10.8.0.1 255.255.255.255”
If you remove that from the server config I think it will work
Attribution
Source : Link , Question Author : eekfonky , Answer Author : jdopenvpn