Adding static routes to VMware’s vCenter Virtual Appliance

Sometimes it is useful to statically assign different gateway addresses for different network segments when configuring multiple Service Console network interfaces on VMware vCenter appliance.

A. To apply a static route on an ESXi host, effective immediately, but not persistent across a reboot:

Connect to host with a ssh client (I prefer putty) and execute the following command:

# route add -net <TargetNetwork> netmask <NetmaskAddress> gw <GatewayAddress> dev <interface>

e.g. route add -net 10.1.2.0 netmask 255.255.255.0 gw 10.1.1.1 dev eth0

then run

# route

to verify that the route was added successfully. In our example, the entry 10.1.2.0 10.1.1.1 255.255.255.0 UG 0 0 0 eth0 should appear.

B. To apply a persistent static route on the appliance:

Connect to host with a ssh client and open the static-routes file with a text editor:

# vi /etc/sysconfig/network/ifroute-eth0

(supposing the interface is eth0)

For every route add a line with the following format:

<TargetNetwork> <GatewayAddress> <Netmask> <Interface>

Then run the following command:

# service network restart

and finally verify the route with:

# route

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s