Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

virsh - list all mac addresses for all network interfaces of any type

Writer Matthew Barrera

I'm trying to identify one of a few dozen virtual machines by a given mac address (52:54:00:: OUI, mapping to QEMU),

the following lists the dhcp table from the NAT based virtual machine adapters, however many of these virtual machines have host device macvtap adapters.

virsh net-dhcp-leases default

the macvtap adapters mac addresses are shown in virt-manager for each network interface, whats the virsh command to query all network adapter's mac addresses?

2 Answers

You can use virsh to do this

# virsh domiflist vmname

For all the VMs use;

# for i in `virsh list --all --name`; do echo $i; virsh domiflist $i; done
1

I didn't see an obvious way to do this in virsh natively, but I enumerated it with the following shell command:

virsh list --all --name \ | while read line; do ( \ virsh domiflist $line \ | sed 's,^,'$line': ,' \ ); done \
| grep 52:54:00:<my_mac_suffix>

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy