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 got an ESXi server that I'm trying to assign a static IP to. I'm having trouble setting the gateway because (I presume) the gateway is on a different subnet.

I've been able to accomplish this task on normal Linux servers by doing the following:

route add eth0
route add -net default gw eth0

Now using the GUI config tools for ESXi I've tried setting the following


The gateway does not stick, and when I try to add the gateway manually using esxcfg-route it says it has no route to the gateway IP. How can I get this static IP set correctly? (I don't have any control over the network setup).

share|improve this question
up vote 2 down vote accepted

You just need to use a gateway that's within your subnet, the one you're trying to us isn't.

Basically using the /22 NM your subnet range is to (not including 0's and 255's - which is contentious in these parts).

If you really wanted to get to that gateway you'd need a /17 NM ( - so long as it's routable of course.

share|improve this answer
Thanks, this worked for me. I'm not very well versed in this networking stuff. I was basically given some static IPs to use and the rest of the settings I copied off of my desktop that's using DHCP. – Erik Nelson Jan 13 '11 at 18:43
Don't worry about it - nobody was born knowing this stuff, eventually you learn to do it all in your head but there are lots of web-based subnet calculators - my favourite one is this; – Chopper3 Jan 14 '11 at 9:54

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.