Hi,
ESXi has the ability to respond to CDP requests.
Check if CDP is enabled on a vSwitch
1 2 3 4 5 | PS D:\> $vSwitch = Get-VirtualSwitch -Name vSwitch0 -VMHost myESXiHost.myDomain.org PS D:\> $vSwitch .ExtensionData.Spec.Bridge.LinkDiscoveryProtocolConfig Protocol Operation -------- --------- cdp listen |
Possible values: down (disable CDP), listen (only respond to client requests), advertise (send frequently advertisments), or both (listen and advertise)
Disable CDP
1 2 | PS D:\> $oESXCli = Get-EsxCli -VMHost myESXiHost.myDomain.org -V2 PS D:\> $oESXCli .network.vswitch.standard.set.Invoke(@{ "vswitchname" = "vSwitch1" ; "cdpstatus" = "down" }) |
To enable both, listing and advertising
1 | PS D:\> $oESXCli .network.vswitch.standard.set.Invoke(@{ "vswitchname" = "vSwitch1" ; "cdpstatus" = "both" }) |
ENable both via esxcli.
1 2 | esxcfg-vswitch -b vSwitch1 esxcli network vswitch standard set - v vSwitch1 -c both |
Get CDP information in a Windows VM
1 2 3 | PS D:\> Install-Module PSDiscoveryProtocol PS D:\> $Packet=Invoke-DiscoveryProtocolCapture -Type CDP -force PS D:\> Get-DiscoveryProtocolData -Packet $packet | ft Computer,Connection,VLAN,Device,Port,Interface -AutoSize |
Michael