I have a Debian server with static ip:

auto eth4
iface eth4 inet static

I can connect from the LAN to the Debian Server with SSH, but the Debian Server has no access to the internet. My /etc/resolv.conf is:


Please tell me what information you need to investigate the problem. "apt-get update" is throwing errors and the ping to www.google.com is not happening. Thank

  • 1
    Have you tried adding the ip as address, subnet mask as netmask, network as network, and broadcast then ifudown eth4 followed by ifup eth4? – Nasir Riley Jun 19 '18 at 14:03
  • 1
    If you can connect to your LAN but not devices that you don't share a subnet with, or have static routes for, then something's wrong with the gateway/default router. – flerb Jun 19 '18 at 14:11
  • tracepath could we have the result for that ? – Kiwy Jun 19 '18 at 14:13
  • @NasirRiley I have try this yet. the tracepath is not found. – KostasC Jun 20 '18 at 8:45
  • @KostasC Should have mentioned this earlier but add the output of ip route to your question. – Nasir Riley Jun 20 '18 at 10:48

When your host can't reach an address that has to be routed but can reach the LAN that it shares a subnet with:

1) Ping localhost, same as pinging yourself by IP because localhost is resolved in /etc/hosts...somewhat arbitrary but it's nice to see something work, and to start at the bottom. I think it shows the IP stack is set up, it always is. Your addressing is fine, if the host didn't have an IP address it wouldn't be able to reach anybody...unless it's using a different configured IP address in a subnet that the default gateway does have an IP address in to reach the other lan devices. But if you've only got one internal subnet then don't worry about that.

2) Ping another device on that same subnet, preferably the default gateway because ICMP probably won't be blocked by an internal IP/interface on a firewall by default. Lots of operating systems will drop ICMP and will make it look like you're not reaching them. So if you have to, check and disable firewalls, or at least allow ICMP. In any case, pinging the default gateway's IP on your subnet shows the router's IP is set up, and since it doesn't require any routing, your host should be able to reach it without any routing set up at all on host or gateway, the default gateway setting on your host doesn't even have to be set up for this to work because the communication doesn't require routing.

3) Ping the external IP address on your default gateway. This is the one that connects to the internet. It shows that the default gateway configuration on your host is set up correctly.

4) From your gateway, if you have a router that can send pings, ping a DNS server, like This shows that your router is connecting to the internet and has access to your hosts configured DNS server.

5) From Your host, ping This shows that the default gateway is routing for your host, and that your host can reach DNS. Gateways tend to allow ICMP replies by default, but a firewall may drop ICMP echo requests even if they are initiated internally, or ICMP all echo replies.

6) ping www.google.com, or some other website that you like poking that doesn't drop ICMP. This shows that DNS resolution is working.

7) If all that works then you've likely got a firewall problem.

| improve this answer | |
  • 1-4 Step is ok, from the Step 5 I have problem. I cannot ping the – KostasC Jun 20 '18 at 6:22
  • As Nasir Riley mentioned it could be a host routing problem. The output of ip route would be useful. It could be that you have a route for your default gateway's external IP but not a default route. ip route should show something like 'default via dev wlp3s0 proto dhcp metric 600' to indicate a default route on your host. – flerb Jun 20 '18 at 18:16
  • Besides that, make sure other devices on the same subnet have access to the internet through the same default router by using a traceroute to It could be a routing problem after the default gateway if you have multiple routers between your host and the internet. – flerb Jun 20 '18 at 18:17

Finally, found the problem, it was the router! The configuration of the Debian was correct. Thanks everyone.

| improve this answer | |

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.