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

We have a sandbox server running CentOS that we run inside our office. Our ISP has assigned us a block of 5 static IPs. We now want to assign it a static IP.

BOOTPROTO=none # have also tried "static" here

/etc/resolv.cnf is also set with the appropriate name servers from our ISP.

When I ifdown eth0 then ifup eth0 I get...

SIOCADDRT: Network is unreachable

When I switch to DCHP, the machine has an IP assigned and there are no connection problems.

Any ideas?

share|improve this question
up vote 5 down vote accepted

The IP Address and gateway are in 2 totally different networks. So change your gateway or IP address to an address within the same network.

IPADDR=173.*.*.161    <--
GATEWAY=     <--
share|improve this answer
yep. you are correct. not sure how I missed that one. thanks. – nategood Apr 9 '10 at 22:03

You gateway address and your ip address must be on the same subnet. When the machine gets a DHCP assigned IP, what is the default gateway that gets assigned? Try using that.

share|improve this answer

Personally, I'd pull down the networks and configure it manually so you can see what is what.

ifconfig the device manually (ifconfig eth0 up I think it was)

Try and ping a gateway, then add it manually route add default gw once you figure out exactly what it was. Everything should fall through from there.

Note, you may need the netmask in your ifconfig command.

share|improve this answer

Further to PowerSp00n's answer regarding the wrong gateway (and you really do have 5 IP addresses) your subnet mask should be (/29).

share|improve this answer
This isn't true, a block of IP addresses you get isn't the same as a subnet. An ISP can give you a few addresses out of an larger subnet. – PowerSp00n Apr 10 '10 at 10:23
he said "block of 5 IP addresses" -- the key term here is block, if it was a few IP addresses from different subnets (which is rare anyways) it wouldn't be called a block. – gravyface Apr 10 '10 at 12:44
Like I said, a block of IP addresses isn't (always) the same as a subnet. A subnet is a block and a block can be a subnet. You can't assume he has a subnet and is using the wrong netmask. – PowerSp00n Apr 10 '10 at 16:16

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.