Duplicate MAC addresses in VNET epair interaces

Giulio Ferro auryn at zirakzigil.org
Tue Feb 14 09:32:05 UTC 2017


On 06/02/2017 20:53, Bjoern A. Zeeb wrote:
>
>> 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.


Hi Bjoern, thanks for your reply...

the idea is sound, but unfortunately setting the mac address of the 
epair interface
inside the jail doesn't work:

ifconfig epair0b ether ether 02:ff:e0:00:00:0b
ifconfig: can't set link-level netmask or broadcast

I've tried manually, in the rc.conf file (ifconfig_epair0b="ether..."), 
and in the /etc/start_if.epair0b file,
but neither of these three ways actually work to set the mac address of 
the epair interface within the jail.

On the other hand, no problem setting the mac of epair in the host...


Do you know of any way to work around this?



More information about the freebsd-net mailing list