I have a server running the newest Ubuntu with openvpn and apache2 installed. This server is located in a 192.168.1.* LAN behind a router, the router can reach the internet.

Machines inside the local network can ping and access the webserver on my Ubuntu Server.

Machines from the internet can ping and access the webserver on my Ubuntu Server.

The Ubuntu server itself from command line can't ping anything (other machines in internal network / router / internet). Also HTTP/apt-get, DNS lookups, etc does not work.

Here are the iptables:

carl@Server:~/security$ sudo iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 


carl@Server:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    0      0        0 eth0   UG    0      0        0 tun0 UH    0      0        0 tun0   U     0      0        0 eth0
carl@Server:~$ cat /etc/resolv.conf
search localdomain

Also disabling / stopping openvpn doesn't solve the problem but removes the two tun0 routing entries in the kernel routing table. (So they are not the reason)

  • Does a traceroute to an IP number past the gateway give you any interesting results? – Katherine Villyard Jun 24 '14 at 19:31
  • It can't even reach the gateway (or the responses) – Carl Ambroselli Jun 26 '14 at 8:47

Sounds like DNS may be the problem. Check that /etc/resolv.conf contains a nameserver line such as nameserver You could also try ping to see if you have visibility on that DNS server, since it should respond as long as your upstream devices aren't blocking ping.

  • I can't ping – Carl Ambroselli Jun 25 '14 at 9:22
  • And resolv.conf contains a nameserver which works for other clients: nameserver – Carl Ambroselli Jun 25 '14 at 19:47

I didn't really solve it, but it was something with the router.

Earlier I told my router to always set ip to the server. From that point on the server got this IP but the internet stopped working. (I noticed it later but I think this was the reason).

Now I hooked up a second network interface, deactivated the first one and then everything worked.

For testing I then removed the second network interface again, changed the MAC address of the first network interface, still not working.

As a next testing step I added two eth again, hooked up one network adapter to eth0, and the original one that was not working to eth1. Test - not working. Then I deactivated the new network adapter on eth0 (sudo ifdown eth0) and then the old network adapter was the only network adapter but running on eth1 instead of eth0 now.

And now everything works like a charm. (The network interface also got a new IP address by the way, it wasn't doing this when it was eth0 all the time...)

And I have no clue what is going on here. Anyone?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.