Configuring static routes for vmkernel ports on an ESXi
-
To add a static route, run the command:
esxcfg-route -a target_network_IP netmask default_gateway
For example, to add a route to the 192.168.100.0 network with a /24 bit subnet mask (255.255.255.0) through a router with an IP address of 192.168.0.1, run one of these commands:
- esxcfg-route -a 192.168.100.0/24 192.168.0.1
Or
- esxcfg-route -a 192.168.100.0 255.255.255.0 192.168.0.1
- esxcfg-route -a 192.168.100.0/24 192.168.0.1
- To delete a static route, run the command:
esxcfg-route -d target_network_IP netmask default_gateway