Re: Missing MAC addresses for domu VM's

From: Roger Pau Monné <roger.pau_at_citrix.com>
Date: Mon, 10 Jan 2022 15:57:25 UTC
On Wed, Dec 01, 2021 at 10:42:38AM -0800, Brian Buhrow wrote:
> 	hello.  In looking into this further, I discovered that the bridges on NetBSD have the
> same issue, that is, you can't have the same MAC address on the dom0 side as the domu side.
> However, I'd like to suggest that the NetBSD solution to the problem is more elegant in that it
> is possible to track domains solely based on netstat output and their MAC addresses while, at
> the same time, being able to derive both the front end and back end  MAC addresses for a given
> domain by reading the MAC address from either side.  I'll quote the comment and the relevant
> line of code from
> sys/arch/xen/xen/xennetback_xenbus.c in the NetBSD source tree.  Is there any reason this
> solution wouldn't work in the FReeBSD case as well?  If it would, it would be nice to see MAC
> addresses return to netstat  -i output for xen virtual interfaces.
> 
> -thanks
> -Brian
> 
> 	/* we can't use the same MAC addr as our guest */
> 	xneti->xni_enaddr[3]++;

Sorry, been on PTO and catching up on email.

I'm not a network expert, I wonder whether this could cause clashes
with other network adapters then (as a user could create another VM
with a MAC address that matches enaddr[3]++).

It would be nice to have a way to set the same mac on the netback
interface and that things still work as expected, but I'm unsure
that's possible. tap interfaces also seem to have the same issue, as
the MAC on the tap interface seems to be a random one.

Thanks, Roger.