Ping has been a powerful tool for windows/linux/VMWare guys for a long time in troubleshooting network connectivity. VMkping is ping for vmk traffic. You execute the vmkping command from the ESXi host so you will need SSH services enabled. Below I will dust off some old vmkping commands I still use today to help me troubleshoot network connectivity issues in my VMWare environment. But first let’s begin with some definitions and types of VMK ports.
What is a Vmkernel:
- The goal of a VMkernel port is to provide some sort of Layer 2 or Layer 3 services to the vSphere host.
- Every VMkernel port will have either an IPv4 or IPv6 address assigned, along with an MTU value.
- Some refer to the ports as virtual adapters or VMkernel networking interface. You’ll also see them refered to as vmk for short in several outputs of commands.
- By default, vmk0 is the 1st vmk created which is enabled for management traffic.
VMKernel Port types:
- vMotion traffic
- Fault tolerance (FT) logging
- Management traffic
- vSphere replication traffic
- iSCSI traffic
- NFS traffic
My apologies in advance but I was not able to do redacted screen shots this time. I would have had to remove too much information rendering the screenshots useless. However, I have made the commands as straight forward as I can and should be easy to complete in a putty session with your hosts.
Scenario example: Testing connectivity between two vmk ports:
Let’s assume you are trying to test network connecitivity between host 01 and host 02 across the vMotion vmk. Let’s assume vmk4 is what is being used for vMotion traffic. Host 01 vmk4 has the IP of 10.10.10.10 and Host 02 vmk4 has the IP of 10.10.10.11.
Run the following command to get all the adapters on host 01 and host 02. It also shows IP address asigned.
This is how we get the vmk4 is vMotion traffic and the IPs of 10.10.10.10 & 10.10.10.11
If you want to ping across a certain vmk port IE vmk4 we need to use the -I
From host 01 execute:
#vmkping -I vmk4 10.10.10.11
From host 02 execute:
#vmkping -I vmk4 10.10.10.10
If you are pinging then you have confirmed the two hosts can communite over vMotion vmk4. If they are not then I would suggest reaching out to your network team for further assistance.
Scenario example: Testing connectivity for jumbo frames
You have jumbo frames enabled in your environment and you need to confirm network connectivity. The IP on the vmk you wish to test jumbo frames on is 10.20.10.10.
We will utilize the -d and -s and we will put 8972 as the packet size
#vmkping -d -s 8972 10.20.10.10
Also, if you want to test an MTU size of 1500 just change 8972 to 1472.
#vmkping -d -s 1472 10.20.10.10
If jumbo frames are enabled you should ping just fine. If not, then you now can begin troubleshooting where you do not have jumbo frames enabled.
Cheat sheet of arguments:
vmkping [args] [host]
-4 use IPv4 (default)
-6 use IPv6
-c <count> set packet count
-d set DF bit (IPv4) or disable fragmentation (IPv6)
-D vmkernel TCP stack debug mode
-i <interval> set interval (secs)
-I <interface> outgoing interface – for IPv6 scope or IPv4
bypasses routing lookup
-N <next_hop> set IP*_NEXTHOP – bypasses routing lookup
for IPv4, -I option is required
-s <size> set the number of ICMP data bytes to be sent.
The default is 56, which translates to a 64 byte
ICMP frame when added to the 8 byte ICMP header.
(Note: these sizes does not include the IP header).
-t <ttl> set IPv4 Time To Live or IPv6 Hop Limit
-W <timeout> set timeout to wait if no responses are
-X XML output format for esxcli framework.
-S The network stack instance name. If unspecified
the default netstack instance is used.
I spend a lot less time using vmkping these days with all the advanced network tools I have in my environment. However, this week when I was attempting to prove there were issues with the physical network affecting vMotion traffic and these old commands came in handy. They have been around a long time but I find a refresher doesn’t hurt. I hope y’all found this article useful.