Add static route to VMware ESX 4 Host

2010 June 23
by Paul McSharry

In a infrastructure with multiple networks,  it can be necessary to configure the routing on the ESX hosts rather than at the router.

This is  achieved using the below command

route add – net <network ID > netmask <subnet mask> gw <gateway interface>

ie :   route add -net 10.44.0.0 netmask 255.255.0.0 gw 192.168.0.12

In the above example,  all traffic for the 10.14.X.X network will be routed via 192.168.0.12

Note:  This route will not be persistent through reboots.  If the ESX host is restarted the route will need to be re-added. 

To ensure the route is persistent add the command to the bottom of the following config  file using a text editor /etc/rc.local

For example

Change directory  –  cd /etc/
Open Text Editor – nano rc.local
Specfiy the route at the end of the file  -
route add -net 10.44.0.0 netmask 255.255.0.0 gw 192.168.0.12 
Exit Text Editor  - ctrl -x , Yes to confirm

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS