A simple quick post this Friday, for people willing to quickly test network connectivity by using the vmkping command. If you're new to VMware vSphere, you might be not aware of vmkping command or do not know exactly what's the purpose and use cases.
VMKping command is useful when testing network connectivity for vmkernel adapters, used for iscsi, vsan, vmotion, management etc. Also, when having jumbo frames activated within your storage network.
Jumbo frames reduce the CPU load caused by transferring data. Enable jumbo frames on a VMkernel network interface by changing the maximum transmission units (MTU) of the VMkernel interface.
The vmkping command will, by default, use any path to reach the destination IP. By specifying an additional parameter we can send out a ping command via a specific vmkernel port. We'll show that option in a minute.
The first thing you need to do is to enable SSH in order to be able to connect via SSH client, such as Putty. After that, just follow the steps below.
Test Network Connectivity with a vmkping command – The steps:
Step 1: Connect to your ESXi host via SSH.
Step 2: use this command. In the command shell, run this command:
vmkping x.x.x.x
where
x.x.x.x
is the hostname or IP address of the remote server's vmkernel network interface that you want to ping.
If you have Jumbo Frames configured in your environment, run the vmkping command with the -s and -d options.
vmkping -d -s 8972 x.x.x.x
In order to specify the vmkernel port which you want to use, you must first have a look for more details. You must know which vmkernel port you want to test. You can check the detail through the command line as well.
First, run this command to list all available adapters:
esxcfg-vmknic -l
See the output below.
Then only select the one which you want to test and enter:
So here is the option to specify which vmkernel port to use for outgoing ICMP traffic with the -I option:
vmkping -I vmkX x.x.x.x
example:
vmkping -I vmk1 10.10.5.11
would test a remote host connectivity via vmk1 vmkernel port.
It's actually quite old news, as it is possible since vSphere 5.1, the vmkping command can also specify a VMkernal port to be used for testing with.
Tip: To display the host's vmkernel routing table, use the esxcfg-route -l command.
Hope it will help someone.
A while back, I have also published some other networking command posts. You might be interested in those as well.
- ESXi Commands List – networking commands
- ESXi Commands List – networking commands [Part 2]
- ESXi Commands List – Getting started
- Basic VMware ESX CLI networking commands
Well, this is it. Hope you've learned something. Stay tuned for more tips and tutorials.
More from ESX Virtualization
- What is VMware vMotion?
- VCP6.5-DCV Objective 7.1 – Troubleshoot vCenter Server and ESXi Hosts
- Free Tools VMware
Stay tuned through RSS, and social media channels (Twitter, FB, YouTube)
David Brown says
On VMware ESXi, 6.0.0, 10719132, I’m attempting to test a new dedicated NIC for vMotion using vmkping, but the -I option returns “Invalid argument.” Any ideas what I’m doing wrong?
[root@VS104:~] esxcfg-vmknic -l
Interface Port Group/DVPort/Opaque Network IP Family IP Address Netmask Broadcast MAC Address MTU TSO MSS Enabled Type NetStack
vmk0 Management Network IPv4 192.168.23.104 255.255.255.0 192.168.23.255 d4:85:64:cd:2b:78 1500 65535 true STATIC defaultTcpipStack
vmk1 vMotion IPv4 10.1.1.104 255.255.255.0 10.1.1.255 00:50:56:6c:47:d7 9000 65535 true STATIC vmotion
[root@VS104:~] vmkping -I vmk1 10.1.1.107
Unknown interface ‘vmk1’: Invalid argument
Vladan SEGET says
try to do “vmkping -h” to get help. And you’ll see the option there with “-I” (interface). That’s the one to use.
bobbo says
getting same invalid arg.
Interface Port Group/DVPort/Opaque Network IP Family IP Address Netmask Broadcast MAC Address MTU TSO MSS Enabled Type NetStack
vmk0 Management Network IPv4 192.168.1.169 255.255.255.0 192.168.1.255 00:25:90:86:9a:1c 1500 65535 true DHCP defaultTcpipStack
vmk0 Management Network IPv6 fe80::225:90ff:fe86:9a1c 64 00:25:90:86:9a:1c 1500 65535 true STATIC, PREFERRED defaultTcpipStack
vmk1 VMkernel-10g-vMot-vmotstack IPv4 192.168.6.169 255.255.255.0 192.168.6.255 00:50:56:6b:98:da 9000 65535 true STATIC vmotion
vmk1 VMkernel-10g-vMot-vmotstack IPv6 fe80::250:56ff:fe6b:98da 64 00:50:56:6b:98:da 9000 65535 true STATIC, PREFERRED vmotion
vmk2 VMkernel IPv4 192.168.8.169 255.255.255.0 192.168.8.255 00:50:56:6d:a0:26 9000 65535 true STATIC vSphereProvisioning
vmk2 VMkernel IPv6 fe80::250:56ff:fe6d:a026 64 00:50:56:6d:a0:26 9000 65535 true STATIC, PREFERRED vSphereProvisioning
[root@3uX9host:~] vmkping -I vmk1 192.168.6.212
Unknown interface ‘vmk1’: Invalid argument
[root@3uX9host:~]
[root@3uX9host:~]
[root@3uX9host:~]
[root@3uX9host:~] vmkping -I vmk1 192.168.6.212
Unknown interface ‘vmk1’: Invalid argument
Yogendra Singh says
Probably you don’t have vmk1.
bobbo says
getting same invalid arg. all is checked and using -I
(also post here is not working , 4th time posting this, thus why its short, i lost my other replies)
Drex says
VMware broke the VMKPING in a previous version. Now you have to use the ping command and pass the netstack you are using:
ping -I vmk1 -S vmotion
https://www.virten.net/2016/05/ping-from-specific-vmkernel-adapter-in-vsphere-6/