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.

  1. From the VMware Direct Console User Interface (DCUI) enable the ESXi shell (Troubleshooting Options > Enable ESXi Shell)
  2. Press Alt+F1 to enter the ESXi shell
  3. Enter the root authentication credentials
  4. Enter the following command to view the CDP information for VMNIC0: vim-cmd hostsvc/net/query_networkhint –pnic-name=vmnic0
  5. In the output verify the following information:
    • connectedSwitchPort
      • devId = “switch_hostname
      • address = “x.x.x.x
      • portID = “GigabitEthernetx/x/x
  6. Exit the ESXi shell
  7. Press Alt+F2 to enter the DCUI
  8. Disable the ESXi shell
  9. Logout of the DCUI

Lastly, more information may be found using this VMware knowledge base article.