Linux Noob Question RE internet access.

Mars

Honorary Master
Joined
Feb 4, 2006
Messages
11,452
Reaction score
1,149
Location
Cape Town
If I putty into my CentOS server and try o do an update it tells me that he network is unreachable.
If I ping Google it also says network unreachable, however I can ping any machine on the local network.

I know I used to be able to access the internet from this box, what could have changed to stop it from accessing it now?
 
Can you ping an internet ip? like 8.8.8.8? If you can your problem is dns and you can fix it by editing /etc/resolv.conf.

If not, you need to setup a gateway, dns and routing.
 
I cannot ping 8.8.8.8

I checked resolv.conf. and the only thing in it is the default gateway...

I know I had internet access on this machine before. :confused:
 
resolv.conf is not for the default gw its for DNS.

check /etc/sysconfig/network-scripts/ifcfg-eth0 (if you using eth0) that should have default gw, netmask etc..
check if all thats right
 
In resolv.conf change the settings to the IP of your router like so:
Code:
nameserver 192.168.0.1
 
Whats the ip of your router?

When you type: ifconfig what is the print out?

If you know the ip of your router/gateway then enter this command:

route add default gw 192.168.1.254 eth0

Just make sure the ip listed as 192.168.1.254 is the ip of your router/gateway

In resolv.conf you should have:

nameserver 192.168.1.254

Where once again the IP is that of your router/gateway
 
Last edited:
or if your router is running dhcp, like 99% of them do

dhclient eth0
 
Top
Sign up to the MyBroadband newsletter
X