I have encountered a strange problem I cannot understand...
I have an OpenVPN server installed in January on an Ubuntu Server 16.04-3 LTS for family use when away from home.
Now I am overseas and I connect from my laptop (Windows 7 x64) to my server only to find that there is no working DNS anymore!
When thus connected I can do no Internet related things.
Ping
www.sunet.se results in timeouts as does any web browsing.
But if I use ping 192.36.171.231 it works normally. So it looks like a DNS issue.
Note that if I use the same OVPN file to connect with my Android phone rather than the Win7 laptop there is no such problems, web browsing works just fine.
The Ubuntu server uses the network router as its DNS server (192.168.119.1).
And this in turn is set to use 208.67.222.222 and 208.67.220.220 as DNS servers.
What could be the reason for the different results between Windows and Android?
And how can I correct it?
I tried adding this to the /etc/network/interfaces file:
auto eth0
iface eth0 inet dhcp
dns-nameservers 208.67.222.222
dns-nameservers 208.67.220.220
Then I did:
invoke-rc.d networking restart
But still when I connect OpenVPN I get the same problem...
If I run ipconfig /all on my Win7 machine I see this, which I think belongs to OpenVPN:
Ethernet adapter XXX OpenVPN:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : TAP-Windows Adapter V9
Physical Address. . . . . . . . . : 00-FF-56-1B-E5-C0
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::74cb:69ac:c6e2:a264%19(Preferred)
IPv4 Address. . . . . . . . . . . : 10.8.0.2(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : den 24 mars 2018 12:35:50
Lease Expires . . . . . . . . . . : den 24 mars 2019 12:35:50
Default Gateway . . . . . . . . . :
DHCP Server . . . . . . . . . . . : 10.8.0.254
DHCPv6 IAID . . . . . . . . . . . : 654376790
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-17-BD-6A-0A-EC-9A-74-FB-B9-CF
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
I have configured the Ubuntu server NOT to use IPv6 and still there seems to be such in use on my Win7 machine anyway...
The OpenVPN server.conf file looks as follows:
port 1191
proto udp
dev tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key # This file should be kept secret
dh /etc/openvpn/keys/dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0 'nopool'
ifconfig-pool 10.8.0.2 10.8.0.127 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.119.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
tls-auth /etc/openvpn/keys/ta.key 0 # This file is secret
cipher AES-256-CBC
comp-lzo
max-clients 20
#user openvpn
#group nogroup
persist-key
persist-tun
status /etc/openvpn/log/openvpn-status.log
log /etc/openvpn/log/openvpn.log
verb 4
mute 10
explicit-exit-notify 1
push "explicit-exit-notify 1"
#Testing to use larger buffers for tunnel
push "sndbuf 262144"
push "rcvbuf 262144"