Hi Folks,
My 2 cents on this, assuming it is a ESXi installation… To trobleshoot the same from ESXi box perspective...
To get the vSwitch port number, run this command:
[root@localhost:~] net-stats -l
PortNum Type SubType SwitchName MACAddress ClientName
<snipped>
50331660 5 7 vSwitch1 00:0c:29:e8:03:c0 vMX1-vCP_16.1R2.11
67108866 4 0 vSwitch2 44:a8:42:25:15:5e vmnic2
67108874 5 7 vSwitch2 00:0c:29:f5:e7:ec vMX1-vFPC_16.1R2.11
83886082 4 0 vSwitch3 44:a8:42:25:15:5f vmnic3
83886090 5 7 vSwitch3 00:0c:29:f5:e7:f6 vMX1-vFPC_16.1R2.11
[root@localhost:~]
Identify and make a note these parameters:
PortNum
ClientName
List the ports for one of the VMs by specifying its World ID. The command returns port information, as in the following example.
Get the world ID with “esxcli vm process list”
[root@localhost:~] esxcli network vm port list -w 962400
<snipped>
Port ID: 67108874
vSwitch: vSwitch2
Portgroup: p2p1
DVPort ID:
MAC Address: 00:0c:29:f5:e7:ec
Uplink Port ID: 0
Active Filters:
Retrieve the switch statistics for a port of the switch
[root@localhost:~] esxcli network port stats get -p 67108874
Packet statistics for port 67108874
Packets received: 619
Packets sent: 3171
Bytes received: 63024
Bytes sent: 213668
Broadcast packets received: 0
Broadcast packets sent: 2555
Unicast packets received: 619
Unicast packets sent: 616
List the ports for one of the VMs by specifying its World ID. The command returns port information, as in the following example.
Get the world ID with “esxcli vm process list”
[root@localhost:~] esxcli network vm port list -w 962400
<snipped>
Port ID: 67108874
vSwitch: vSwitch2
Portgroup: p2p1
DVPort ID:
MAC Address: 00:0c:29:f5:e7:ec
Uplink Port ID: 0
Active Filters:
Retrieve the switch statistics for a port of the switch
[root@localhost:~] esxcli network port stats get -p 67108874
Packet statistics for port 67108874
Packets received: 619
Packets sent: 3171
Bytes received: 63024
Bytes sent: 213668
Broadcast packets received: 0
Broadcast packets sent: 2555
Unicast packets received: 619
Unicast packets sent: 616
[root@localhost:~] pktcap-uw --uplink vmnic2
Local CID 2
Listen on port 18852
Accept...Vsock connection from port 1029 cid 2
11:16:46.820441[1] Captured at EtherswitchDispath point, TSO not enabled, Checksum not offloaded and not verified, length 98.
Segment[0] ---- 98 bytes:
0x0000: 000c 29f5 e7ec 84b5 9cbe ca19 0800 4500
0x0010: 0054 25d2 0000 4001 7866 3737 3701 3737
0x0020: 3702 0000 3169 c6f3 0006 5860 fc1f 0001
0x0030: c818 0809 0a0b 0c0d 0e0f 1011 1213 1415
0x0040: 1617 1819 1a1b 1c1d 1e1f 2021 2223 2425
0x0050: 2627 2829 2a2b 2c2d 2e2f 3031 3233 3435
0x0060: 3637
Capture Packets of both Switch port and physical adapter at same time:
1.To get the vSwitch port number, run this command: net-stats –l
2.Identify and make a note these parameters:
Port ID returned by the esxtop command — --switchport 67108874
vmnic2 physical port that you want to trace — --uplink vmnic2 -
location of the output pcap file — /tmp/vmnic2.pcap
- Run the pktcap-uw command to capture packets at both points simultaneously:
pktcap-uw --switchport 67108874 -o /tmp/67108874.pcap & pktcap-uw --uplink vmnic2 -o /tmp/vmnic2.pcap &