Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed a fresh copy of the latest CentOS via iLO (HP's integrated lights out 2). The setup type was Web Server. My server doesn't seem to be able to connect to the Internet anymore. I've lost the old settings for DHCP and hostname but I have the old settings for eth0 and DNS server, still there's something else I should be doing to be able to use wget, yum, ping and to have SSH access from other locations, but I can't seem to find what that is.

Any pointers? Thanks.

Edit: route command:

Kernel IP routing table
Destination Gateway Genmask       Flags Metric Ref Use Iface
xx.xx.68.0  * U     0      0    0  eth0
link-local  *   U     1002   0    0  eth0

Note that the server IP is xx.xx.68.176, should I change the route?

share|improve this question
do you have a route to a gateway? – user Jan 13 '12 at 11:43
@user I've updated my question – altvali Jan 13 '12 at 11:53
Could you post your /etc/sysconfig/network-scripts/ifcfg-eth0 and /etc/sysconfig/network files, then perhaps we can advise on whether/how to put a GATEWAY= entry therein? – MadHatter Jan 13 '12 at 13:54
up vote 2 down vote accepted

Do a

route add default gw xx.xx.68.1(?) #Gateway's IP

Or follow what @ewwhite said you should configure your network properly because there are scripts like if-up,if-down that take care of interface mishaps like yours

EDIT: Even better after @Lucas' comment go to your /etc/network/interface and add

iface eth0 inet static
address xx.xx.68.176
gateway xx.xx.68.xx

You can always send a new request to your dhcp server by doing which will get lost after a reboot

dhclient eth0

or by adding to your /etc/network/interface

iface eth0 inet static
share|improve this answer
It's better to do it in /etc/network/interfaces, saves you a lot of headaches when you reboot. – Lucas Kauffman Jan 13 '12 at 12:52
I agree with the above reasoning, but that code looks an awful lot like a debian-style interfaces file, and isn't (afaik) suitable for use with a CentOS-style /etc/sysconfig/network-scripts/ifcfg-eth0 file) – MadHatter Jan 13 '12 at 13:53
I agree with MadHatter, I've learned that in CentOS 5.2+ /etc/network/interfaces was replaced with /etc/sysconfig/network-scripts/ifcfg-eth0 ; I've found the right gateway (it was xx.xx.68.253) and it all seemed to work until a couple of minutes ago when I've left the office and got word that the SSH access no longer works. I'll be marking the right answer when this mistery is solved – altvali Jan 13 '12 at 17:04

I'd say you are missing the default route - sometimes called the gateway.

share|improve this answer
How about updating your answer to talk about how to update routing information on CentOS? Right now your answer while correct is not very useful. – Red Tux Jan 13 '12 at 12:19
Uh, I would have, but this xxx.yyy etc. game gets old fast - Some detail on the rest of the network would have helped. I see others are filling the gap tho'. – Alien Life Form Jan 13 '12 at 14:08

Can you run system-config-network, fill in your network configuration information and restart the network services? /sbin/service network restart

share|improve this answer

Your Answer


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.