esxcfg-route -l command shows the wrong VMkernel interface associated with the default gateway.VMware vSphere ESXi 7.X
VMware vSphere ESXi 8.X
To force a different VMkernel port to be used in the host's routing table, all VMkernel ports except the preferred one in the network must be deleted and then re-created:
Warning: Performing the steps below may cause loss of network connectivity to the host's management interface. VMware strongly recommends performing these steps from DCUI(direct console interface) of the host, or by using an iLO/DRAC/IPMI console connection. For more information, see Using ESXi Shell in ESXi
#esxcfg-route -l
VMkernel Routes:
Network Netmask Gateway Interface
192.168.112.0 255.255.255.0 Local Subnet vmk1
192.168.115.0 255.255.255.0 Local Subnet vmk0
default 0.0.0.0 192.168.115.254 vmk1
vmk1 is currently being used for traffic between the gateway and the host.esxcfg-route command via the ESXi Shell or SSH session:#esxcfg-route -l
VMkernel Routes:
Network Netmask Gateway Interface
192.168.112.0 255.255.255.0 Local Subnet vmk1
192.168.115.0 255.255.255.0 Local Subnet vmk0
default 0.0.0.0 192.168.115.254 vmk0
Note: This change does not persist across reboots. When you reboot the host, the lowest numbered VMK in each subnet becomes the preferred interface again. You must either reapply the change or create the preferred VMK first (lowest numbered) among all the VMKernels in the same subnet. In the example above, vmk0 becomes the primary gateway for #.#.85.x subnet after host reboot.