VMware Cloud Community
jasmeetsinghsur
Enthusiast
Enthusiast

How to get the observed IP range on the ESXi physical nic along with VLAN from cli

How to get the observed IP range on the ESXi physical nic along with VLAN from cli

0 Kudos
1 Reply
jburen
Expert
Expert

You could use PowerCli to get this information.

Get-VMHost | Where-Object {$_.State -eq "Connected"} |

%{Get-View $_.ID} | %{$esxname = $_.Name; Get-View $_.ConfigManager.NetworkSystem} |

%{foreach($physnic in $_.NetworkInfo.Pnic) {

if ($physnic.Device -ne "vusb0") {

$pnicInfo = $_.QueryNetworkHint($physnic.Device)

foreach($hint in $pnicInfo) {

Write-Host $esxname $physnic.Device": " -NoNewLine

if ($hint.ConnectedSwitchPort) {

Write-Host $hint.ConnectedSwitchPort.PortId -NoNewLine

Write-Host " :" $hint.ConnectedSwitchPort.SystemName}

else {Write-Host "No CDP information available."}

}

}

}

}

Some code is specific for my environment but it should give you some info.

Consider giving Kudos if you think my response helped you in any way.
0 Kudos