Duplicate MAC addresses in VNET epair interaces

Bjoern A. Zeeb bzeeb-lists at lists.zabbadoz.net
Mon Feb 6 19:53:33 UTC 2017


On 6 Feb 2017, at 18:53, Giulio Ferro wrote:

> Hi all,
>
>
> Setup:
>
> 11.0-STABLE FreeBSD 11.0-STABLE #0 r312338: Tue Jan 17 12:29:38 UTC 
> 2017
>
>
> I've set up two freebsd hosts, each of which has  a single VNET jail.
>
> On each host I've created 2 epair interfaces.
>
> Host A
>
> - epair0a, epair1a on the host
>
> - epair0b, epair1b on the jail
>
>
> Host B
>
> - epair0a, epair10a on the host
>
> - epair0b, epair10b on the jail
>
>
> What I noticed is that on both hosts, each epair interface has the 
> same MAC address:
>
…>
>
> (same behavior on the epair interfaces on the jail side)
>
>
> As you can see, the mac addresses seems to depend on the order of the 
> creation of the epair, not on the name or address
>
>
> This is a potentially bad behavior, because if I want to bridge say 
> epair1a on A with epair10a on B with a VPN or
>
> a physical connection giving 192.168.1.1 to epair1b and 192.168.1.2 to 
> epair10b, I won't be able to make them
>
> talk to each other since they have the same MAC address.
>
>
> My question is: is this a bug or something I'm doing wrong? If there 
> any workaround I can use?


 From the man page:

      Like any other Ethernet interface, an epair needs to have a 
network
      address.  Each epair will be assigned a locally administered 
address by
      default, that is only guaranteed to be unique within one network 
stack.
      To change the default addresses one may use the SIOCSIFADDR 
ioctl(2) or
      ifconfig(8) utility.

I thought someone patched it a few years ago to have a pseudo-random 
part to make collisions less likely and use the FreeBSD vendor space, 
but it seems that never happened for epair (or didn’t make it into the 
tree).

ifconfig epair<x>[ab] ether 02:xx:xx:xx:xx  is your friend for now.

/bz


More information about the freebsd-net mailing list