VMware Cloud Community
dborgill
Enthusiast
Enthusiast

List of MAC address - Dual MAC address for one VM

We have a guest VM on a ESX 3.0.2 with 8 NICS in a virtual switch. On our packet tracing software, it shows the VM is communicating using two different MAC addresses.

How do I get a list of MAC addresses for that host for troubleshooting? I thought it was in Virtualcenter.. but I can't find the MACs.

0 Kudos
1 Reply
lamw
Community Manager
Community Manager

You can get this information either through powershell using the toolkit or you can pull this straight off the ESX Host for all VMs residing.

#!/bin/sh

IFS=$'\n'

for vm in `vmware-cmd -l`;

do

VM_NAME=`vmware-cmd "$vm" getconfig displayName | awk '{print $3}'`

VM_MAC=`grep ethernet0.generatedAddress "$vm" | awk '{print $3}' | sed 's/\"//g' | head 1 | sed 's/://g'`

echo -e "\t$VM_NAME\t$VM_MAC"

done

unset IFS

This will pull just the first NIC, but you can modify it to pull all MAC's associated with a Virtual Machine on a given ESX Server

0 Kudos