Checking vmware host vlan tagging

Checking network vlans.
Okay so I am use to being able to do a show run on the switching infrastructure attached to my virtual environment. However in my current position that ability has not been granted.

So I resorted to the following to test that trunking was setup correctly.

Create one guest (ubuntu live cd works great) on one host and another on another host.
Give these two guests an ip address on a range that is not within your companies / organisations ranges. For example if your company uses 19.20.21-31.0/24 then you could use 192.168.201.100-101/24. Now gateway needed, once the hosts are up and running with an ip address simply do a ping using terminal from one guest to the other.

ping -c 10 192.168.201.101

Okay so that is great if we want to check one vlan but what if we have multilple vlans.

Well in this case you can use this powercli to change the vlan on both guests with a pause and then change, this can flick through all your vlans.

Get-VM -Name pingt1 | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName vlan1 -Confirm:$false
Get-VM -Name pingt2 | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName vlan1 -Confirm:$false
sleep 7
Get-VM -Name pingt1 | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName vlan2 -Confirm:$false
Get-VM -Name pingt2 | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName vlan2 -Confirm:$false

Easy hey.

Now to aid in building the network jumper powercli you can run the following.
Get-VDPortgroup | Select Name,VlanConfiguration,Datacenter | ft -a
Paste into excel and you have your list of vlans.

Advertisements