I have OpenVPN server running on a Windows 2012 server. It works perfectly and from my iPhone and iPad I can connect to the VPN, all my web traffic routes over the VPN and I can use the iOS Remote Desktop app to remote into devices on my network.
I installed the OpenVPN app on my Windows 10 laptop with the same client profile as the iOS devices and while it allows me to connect, I then can't access the internet or any of the devices on the LAN.
It seems the DNS is working as when I try to ping a domain name it resolves the IP, but then I get Request Timed Out.
I can't even ping the VPN gateway 10.8.0.1.
This is my server config:
port 1194
proto udp
dev tun
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.0.0 255.255.255.0"
push "redirect-gateway local def1"
push "dhcp-option DNS 8.8.8.8"
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
ca "C:\\Program Files (x86)\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files (x86)\\OpenVPN\\config\\server.crt"
key "C:\\Program Files (x86)\\OpenVPN\\config\\server.key"
dh "C:\\Program Files (x86)\\OpenVPN\\config\\dh1024.pem"
This is my client config:
client
dev tun
proto udp
remote xxx.xxx.xxx.xxx 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ns-cert-type server
comp-lzo
verb 3
And this is the log from my most recent connection:
Mon Jan 16 13:45:08 2017 OpenVPN 2.4.0 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Dec 27 2016
Mon Jan 16 13:45:08 2017 Windows version 6.2 (Windows 8 or greater) 64bit
Mon Jan 16 13:45:08 2017 library versions: OpenSSL 1.0.2i 22 Sep 2016, LZO 2.09
Enter Management Password:
Mon Jan 16 13:45:08 2017 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Mon Jan 16 13:45:08 2017 Need hold release from management interface, waiting...
Mon Jan 16 13:45:09 2017 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Mon Jan 16 13:45:09 2017 MANAGEMENT: CMD 'state on'
Mon Jan 16 13:45:09 2017 MANAGEMENT: CMD 'log all on'
Mon Jan 16 13:45:09 2017 MANAGEMENT: CMD 'hold off'
Mon Jan 16 13:45:09 2017 MANAGEMENT: CMD 'hold release'
Mon Jan 16 13:45:09 2017 MANAGEMENT: >STATE:1484574309,RESOLVE,,,,,,
Mon Jan 16 13:45:09 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]xxx.xxx.xxx.xxx:1194
Mon Jan 16 13:45:09 2017 Socket Buffers: R=[65536->65536] S=[65536->65536]
Mon Jan 16 13:45:09 2017 UDP link local: (not bound)
Mon Jan 16 13:45:09 2017 UDP link remote: [AF_INET]xxx.xxx.xxx.xxx:1194
Mon Jan 16 13:45:09 2017 MANAGEMENT: >STATE:1484574309,WAIT,,,,,,
Mon Jan 16 13:45:09 2017 MANAGEMENT: >STATE:1484574309,AUTH,,,,,,
Mon Jan 16 13:45:09 2017 TLS: Initial packet from [AF_INET]xxx.xxx.xxx.xxx:1194, sid=153bc069 fc314ff6
Mon Jan 16 13:45:10 2017 VERIFY OK: depth=1, C=UK, ST=...
Mon Jan 16 13:45:10 2017 VERIFY OK: nsCertType=SERVER
Mon Jan 16 13:45:10 2017 VERIFY OK: depth=0, C=UK, ST=...
Mon Jan 16 13:45:10 2017 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Mon Jan 16 13:45:10 2017 [server] Peer Connection Initiated with [AF_INET]xxx.xxx.xxx.xxx:1194
Mon Jan 16 13:45:11 2017 MANAGEMENT: >STATE:1484574311,GET_CONFIG,,,,,,
Mon Jan 16 13:45:11 2017 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Mon Jan 16 13:45:11 2017 PUSH: Received control message: 'PUSH_REPLY,route 192.168.0.0 255.255.255.0,redirect-gateway local def1,dhcp-option DNS 8.8.8.8,route 10.8.0.0 255.255.255.0,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.6 10.8.0.5'
Mon Jan 16 13:45:11 2017 OPTIONS IMPORT: timers and/or timeouts modified
Mon Jan 16 13:45:11 2017 OPTIONS IMPORT: --ifconfig/up options modified
Mon Jan 16 13:45:11 2017 OPTIONS IMPORT: route options modified
Mon Jan 16 13:45:11 2017 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Mon Jan 16 13:45:11 2017 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jan 16 13:45:11 2017 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jan 16 13:45:11 2017 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jan 16 13:45:11 2017 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jan 16 13:45:11 2017 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jan 16 13:45:11 2017 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jan 16 13:45:11 2017 WARNING: cipher with small block size in use, reducing reneg-bytes to 64MB to mitigate SWEET32 attacks.
Mon Jan 16 13:45:11 2017 interactive service msg_channel=536
Mon Jan 16 13:45:11 2017 ROUTE_GATEWAY 172.20.10.1/255.255.255.240 I=12 HWADDR=14:10:9f:ce:13:73
Mon Jan 16 13:45:11 2017 open_tun
Mon Jan 16 13:45:11 2017 TAP-WIN32 device [Ethernet 4] opened: \\.\Global\{27AC27A1-A13C-4E12-B90F-C2797B3E8157}.tap
Mon Jan 16 13:45:11 2017 TAP-Windows Driver Version 9.21
Mon Jan 16 13:45:11 2017 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.8.0.6/255.255.255.252 on interface {27AC27A1-A13C-4E12-B90F-C2797B3E8157} [DHCP-serv: 10.8.0.5, lease-time: 31536000]
Mon Jan 16 13:45:11 2017 Successful ARP Flush on interface [6] {27AC27A1-A13C-4E12-B90F-C2797B3E8157}
Mon Jan 16 13:45:11 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Mon Jan 16 13:45:11 2017 MANAGEMENT: >STATE:1484574311,ASSIGN_IP,,10.8.0.6,,,,
Mon Jan 16 13:45:16 2017 TEST ROUTES: 3/3 succeeded len=2 ret=1 a=0 u/d=up
Mon Jan 16 13:45:16 2017 C:\WINDOWS\system32\route.exe ADD 0.0.0.0 MASK 128.0.0.0 10.8.0.5
Mon Jan 16 13:45:16 2017 Route addition via service succeeded
Mon Jan 16 13:45:16 2017 C:\WINDOWS\system32\route.exe ADD 128.0.0.0 MASK 128.0.0.0 10.8.0.5
Mon Jan 16 13:45:16 2017 Route addition via service succeeded
Mon Jan 16 13:45:16 2017 MANAGEMENT: >STATE:1484574316,ADD_ROUTES,,,,,,
Mon Jan 16 13:45:16 2017 C:\WINDOWS\system32\route.exe ADD 192.168.0.0 MASK 255.255.255.0 10.8.0.5
Mon Jan 16 13:45:16 2017 Route addition via service succeeded
Mon Jan 16 13:45:16 2017 C:\WINDOWS\system32\route.exe ADD 10.8.0.0 MASK 255.255.255.0 10.8.0.5
Mon Jan 16 13:45:16 2017 Route addition via service succeeded
Mon Jan 16 13:45:16 2017 Initialization Sequence Completed
Mon Jan 16 13:45:16 2017 MANAGEMENT: >STATE:1484574316,CONNECTED,SUCCESS,10.8.0.6,xxx.xxx.xxx.xxx,1194,,
Any ideas where to start?
Please, could you show the Windows 10 client's routing table while connected?
According to the client log, the OpenVPN client did not add a static route to the OpenVPN server through the original default gateway (the one used before the connection establishes). This prevents OpenVPN client packets from reaching the server, because of the absence of a route to it. I suggest you to change the server config, replacing the line:
With one of these:
Reference:
With older versions of the OpenVPN-GUI, this was a symptom of the OpenVPN.exe file not running with administrative privileges, which were required in order to make changes to the routing table.
Connect and check the routing table with
netstat -rn
. If routes to your remote network(s) are not present, find the openvpn.exe binary and change it so that it runs as an Administrator.It may sound obvious, but have you tried disabling firewall in Windows 10? Another option is to double-check your addressing as according to your log it seems that your gateway address is 10.8.0.5, not 10.8.0.1.
You said that worked on your iOS devices and then you used the same profile for your computer.
In your server config, you don't have directive duplicate-cn which permit multiple clients to use the same certificate. Have you tried using this option ?
For those, like me, who switched to their own OpenVPN server from a 3rd party VPN provider, you need to uninstall ALL VPN clients you have on your system, including OpenVPN. Make sure you delete all the configs and registry entries. Then reinstall OpenVPN anew, clean and fresh. Those other VPN clients are probably based on OpenVPN client and share TAP adapter and configs and they are probably not the right ones.
Also, the auto installer for the server side helps deal with any possible mistakes in server config.