Managing the IP Gateway
If you move your ESXi host to a new physical location, you might have to change the default IP gateway. You can use the vicfg-route command to manage the default gateway for the VMkernel IP stack. vicfg-route supports a subset of the Linux route command’s options.
If you run vicfg-route with no options, the command displays the default gateway. Use --family to print the default IPv4 or the default IPv6 gateway. By default, the command displays the default IPv4 gateway. Specify one of the options listed in Connection Options in place of <conn_options>.
To add, view, and delete a route entry
1
vicfg-route <conn_options> --add <network_ip> <netmask_IP> <gateway_ip>
For example, to add a route to 192.XXX.100.0 through 192.XXX.0.1:
vicfg-route <conn_options> -a 192.XXX.100.0/24 192.XXX.0.1
or
vicfg-route <conn_options> -a 192.XXX.100.0 255.255.255.0 192.XXX.0.1
vicfg-route <conn_options> -f V6 --add <network_ip_and_mask> <gateway_ip>
For example:
vicfg-route <conn_options> -f V6 --add 2001:10:20:253::/64 2001:10:20:253::1
2
vicfg-route <conn_options>
The output lists all networks and corresponding netmasks and gateways.
3
vicfg-route <conn_options> 192.XXX.0.1
or
vicfg-route <conn_options> -a default 192.XXX.0.1
vicfg-route <conn_options> -f V6 -a default 2001:10:20:253::1
4
Run vicfg-route --delete to delete the route. Specify first the gateway, and then the network.
vicfg-route <conn_options> -d 192.XXX.100.0/24 192.XXX.0.1