ESX/ESXi power on error: Unable to set VMkernel gateway as there are no VMkernel interfaces on the same network
search cancel

ESX/ESXi power on error: Unable to set VMkernel gateway as there are no VMkernel interfaces on the same network

book

Article ID: 343820

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

When an ESX/ESXi host is powered on, the following error message appears during startup process:
 
Unable to set VMkernel gateway as there are no VMkernel interfaces on the same network



Environment

VMware ESXi 6.x

VMware ESXi 7.x

VMware ESXi 8.x

Resolution

VMkernel interfaces are used by ESX/ESXi host's internal TCP/IP stack for three purposes:
  • To facilitate VMotion between ESX hosts
  • To connect to iSCSI storage arrays (IP SAN)
  • To connect to NFS storage servers (NAS)
Like a traditional TCP/IP stack, the VMkernel TCP/IP stack provides the ability to route IP datagrams to remote subnets. Although VMware does not recommend that VMotion traffic be routed, both iSCSI and NFS traffic may be routed through a gateway to reach a storage server on a different subnet.
This routing gateway, called the VMkernel gateway, is the IP address of a router or Layer 3 switch on the same subnet as the VMkernel interface itself. This router (or L3 switch) is then responsible for forwarding the VMkernel's IP datagrams in the direction of the destination subnet.
If a VMkernel gateway is specified with an IP address that does not exist within any of the defined VMkernel interfaces' subnets, the Unable to set VMkernel gateway error message appears on system startup. For example, consider the following output:
[root@ESX1 root]# esxcfg-vmknic -l
Port Group IP Address Netmask Broadcast MAC Address MTU Enabled
iSCSI_SAN 192.168.1.100 255.255.255.0 192.168.1.255 MAC_Address1 1514 true
VMotion 192.168.2.100 255.255.255.0 192.168.2.255 MAC_Address2 1514 true
The esxcfg-vmknic -l command provides a listing of all VMkernel interfaces defined on an ESX host. In the example above, there are two VMkernel interfaces:
  • iSCSI_SAN on network 192.168.1.0/24
  • VMotion on network 192.168.2.0/24
However, if we verify the IP address that has been assigned to the VMkernel gateway address, we discover an issue:
[root@ESX1 root]# esxcfg-route -l
VM Kernel Routes:
Network Netmask Gateway
192.168.1.0 255.255.255.0 Local Subnet
192.168.2.0 255.255.255.0 Local Subnet
default 0.0.0.0 192.168.0.254
The esxcfg-route -l command provides a listing of all routing table entries within the VMkernel TCP/IP stack. In the example above, the default entry (which corresponds to the VMkernel gateway address) shows a gateway address of 192.168.0.254. Because 192.168.0.254 exists on the 192.168.0.0/24 network and we have no VMkernel interfaces defined on this network, ESX host considers this a misconfiguration and produces the Unable to set VMkernel gateway as there are not VMkernel interfaces on the same network error on startup.
This error message can be safely ignored if routing is not required on the various VMkernel interfaces. However, if a VMkernel gateway is required in order to reach a remote iSCSI or NFS storage server, it must be configured and valid.
The VMkernel gateway is easily configured as follows:
  1. Using VMware Infrastructure (VI) Client, connect to the ESX host you wish to modify. Alternatively, you may connect to the VirtualCenter server that manages this ESX host.
  2. Select the ESX host in the inventory, and click the Configuration tab.
  3. Under the Hardware list, select Networking.
  4. Identify the vSwitch that contains the VMkernel interface to be modified and click Properties.
  5. In the vSwitch Properties window, select the appropriate VMkernel interface and click Edit.
  6. In the Properties window for the VMkernel interface, click Edit next to "VMkernel Default Gateway".
  7. In the DNS and Routing Configuration window, specify the correct default gateway address.
  8. Click OK to commit the VMkernel default gateway.
  9. Click OK to commit the VMkernel interface changes.
  10. Click Close to close the vSwitch Properties window.

    At this point, the VMkernel default gateway is set appropriately and the error message during startup no longer appears. If you are unable to rename the VMkernel port, see Unable to rename or delete a VMkernel Portgroup after upgrading to ESX 3.5 (1003933).
To configure the VMkernel gateway using the command line:
  1. To see the default gateway of VMkernel, run the command:

    # esxcfg-route
  2. To set the default gateway of VMkernel, run the command:

    # esxcfg-route <IP address>
  3. To add a route to the VMkernel, run the command:

    esxcfg-route -a [<network> <gateway>] | <default gateway>
For example:
  • To add a route to 192.168.100.0 network through 192.168.0.1, run the command:

    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
  • To set the VMkernel default gateway to 192.168.0.1, run the command:
esxcfg-route 192.168.0.1

Or

esxcfg-route -a default 192.168.0.1
Note: You can specify additional IP and subnet for the VMkernel adapter, but there can only be one default gateway.

Additional Information

For translated versions of this article, see: