You can override the default gateway of a VMkernel adapter to provide a different gateway for vSphere vMotion by using esxcli commands.
- Open an SSH connection to the host.
- Log in as the root user.
- Run the following command.
esxcli network ip interface ipv4 set –i vmknic -t static –g IPv4 gateway -I IPv4 address -N mask
You must turn off DHCPv6 or Router Advertisement before you can set the IPv6 vmknic gateway.
esxcli network ip interface ipv6 set -i vmknic -d off -r off
To add a static IPv6 address:
esxcli network ip interface ipv6 address add -i vmknic -I IPv6 address
To set the IPv6 vmknic gateway:
esxcli network ip interface ipv6 set -i vmknic -g IPv6 gateway
Where vmknic is the name of the VMkernel adapter, gateway is the IP address of the gateway, IP address is the address of the VMkernel adapter, and mask is the network mask.