I was doing some troubleshooting this week and needed the CDP network info. I did not have access to a vSphere client, only HP iLO access. I remoted into the ESXi box and enable ESXi Shell. I knew that I could dig up the info using esxcfg-info but the amount of details provided are overwhelming and I would rather get only the info back I need without too much hassle. I figured there was another way:
vim-cmd hostsvc/net/query_networkhint
The one thing that I find it very useful for is to check the configured VLAN(s) on the port. Below is the result of the above command:
(vim.host.PhysicalNic.NetworkHint) [
(vim.host.PhysicalNic.NetworkHint) {
dynamicType = ,
device = "vmnic0",
subnet = (vim.host.PhysicalNic.NetworkHint.IpNetwork) [
(vim.host.PhysicalNic.NetworkHint.IpNetwork) {
dynamicType = ,
vlanId = 3001,
ipSubnet = "10.91.34.1-10.91.35.254",
},
(vim.host.PhysicalNic.NetworkHint.IpNetwork) {
dynamicType = ,
vlanId = 2912,
ipSubnet = "10.91.32.1-10.91.32.63",
}
],
connectedSwitchPort = (vim.host.PhysicalNic.CdpInfo) null,
lldpInfo = (vim.host.PhysicalNic.LldpInfo) null,
},
]