Learn how to override the default gateway of a VMkernel adapter to provide a different gateway for vSphere vMotion by using esxcli commands.

Procedure

  1. Open an SSH connection to the host.
  2. Log in as the root user.
  3. Run the following command.
    Option Description
    IPv4
    esxcli network ip interface ipv4 set –i vmknic -t static –g IPv4 gateway -I IPv4 address -N mask
    IPv6
    Important: 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.