Have you ever connected a VMware ESXi 6.7 host to a switch port that wasn’t tagged with the correct VLAN for the management network and you weren’t able to physically trace the network cable back to the switch? If so, you know the result is that you are unable to connect to the host. However, all hope is not lost as VMware ESXi utilizes the Cisco Discovery Protocol (CDP) to provide you with the hostname, IP address, and switch port that the VMNIC/s are connected to for the management network. With that said, below you’ll find the procedure and commands to view the CDP information.
NOTE: This example assumes you are connecting to the DCUI from an iDRAC or iLO.
- From the VMware Direct Console User Interface (DCUI) enable the ESXi shell (Troubleshooting Options > Enable ESXi Shell)
- Press Alt+F1 to enter the ESXi shell
- Enter the root authentication credentials
- Enter the following command to view the CDP information for VMNIC0: vim-cmd hostsvc/net/query_networkhint –pnic-name=vmnic0
- In the output verify the following information:
- connectedSwitchPort
- devId = “switch_hostname“
- address = “x.x.x.x“
- portID = “GigabitEthernetx/x/x“
- connectedSwitchPort
- Exit the ESXi shell
- Press Alt+F2 to enter the DCUI
- Disable the ESXi shell
- Logout of the DCUI
Lastly, more information may be found using this VMware knowledge base article.