Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a Linux server which runs several services (namely Minecraft :)). Recently, I've been having trouble getting it to connect to the Internet. For example:

root@fcwtech:~# ping google.com
ping: unknown host google.com

and

root@fcwtech:~# ping 8.8.8.8
connect: Network is unreachable

however,

root@fcwtech:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=10.8 ms

In case it helps, resolv.conf:

root@fcwtech:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.8.4
nameserver 75.75.75.75
nameserver 75.75.76.76
search hsd1.va.comcast.net

and ifconfig:

eth0      Link encap:Ethernet  HWaddr 00:11:11:3e:05:b9  
          inet addr:192.168.1.108  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::211:11ff:fe3e:5b9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2195 errors:0 dropped:0 overruns:0 frame:0
          TX packets:657 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:172376 (168.3 KiB)  TX bytes:84343 (82.3 KiB)
          Interrupt:16 

My setup has been working perfectly previously. I made no configuration changes, and I'm really not sure what I should do at this point.

share|improve this question
    
ifconfig is deprecated on linux, use ip addr instead. And please include the output of routel to show your routing tables. –  BatchyX Feb 17 '13 at 19:47
    
Which distribution do you use? How do you set up your network interface? e.g.: /etc/network/intefaces or /etc/sysconfig/network-scripts –  xx4h Feb 18 '13 at 7:39
    
One specific scenario i've in my mind: You use DHCP for getting IP adress in your LAN. In most cases you get the same ip from the DHCP-Server, if you reconnect. But that's not for sure. And if you additionally have some rules for who has access to the internet, and who has not, it could be, that the ip address of the server has changed due to DHCP and the new ip isn't allowed to access the internet due to your access-rules. –  xx4h Feb 18 '13 at 7:48
    
Can you reach the Internet from other computers on your network? –  Jander Feb 18 '13 at 8:00
    
@Jander: yes, all the other machines work fine. –  Fox Wilson Feb 18 '13 at 19:09

2 Answers 2

up vote 3 down vote accepted

check your default gateway setting using

route -n

if there is no gateway specified then you have to set your system default gateway...using

route add default gw gateway ip

share|improve this answer
    
Thanks! That seems to work. –  Fox Wilson Feb 18 '13 at 19:15
    
As a side note, route is being deprecated on Linux, and the preferred way is to use ip route (see man ip-route). –  peterph Feb 19 '13 at 10:15

Many "enlightened" network/firewall administrators consider ICMP to be the work of the devil, and filter it out... and ICMP ECHO REQUEST and ECHO REPLY fall under the axe. Besides, with firewalls and port-forwarding all over the place, ICMP reachability is not aplication-I'm-interested-in reachability.

If you want to know the real TCP reachability, use tcping.

share|improve this answer
    
Very true in the general case, to our detriment. But in this specific case, it looks like he's pinging from his Comcast broadband residential Internet to Google's public DNS server, neither of which are likely to drop pings. –  Jander Feb 18 '13 at 7:37
    
Won't drop pings at the ends, who knows what psychopath is in charge en route... –  vonbrand Feb 18 '13 at 7:39
    
I think blocking ICMP in the backbone would break the Internet. I'm not discounting it entirely, but if backbone providers are blocking ICMP, I fear for us all. –  Jander Feb 18 '13 at 7:50
    
@Jander, indeed I am. Vonbrand - if people blocked ICMP, I shouldn't be getting "network unreachable" and "unknown host" right? –  Fox Wilson Feb 18 '13 at 19:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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