[lxc-users] Determining a container's MAC address

Guido Jäkel G.Jaekel at DNB.DE
Sun Sep 6 16:52:55 UTC 2015


Dear Peter,

don't use a MAC prefix that is lower than that of the upstream device of the bridge the containers are attached: The Linux software bridge will use the lowest MAC of it's attached devices as the MAC of the outgoing packets. Therefore, you will risk short traffic interruptions to others, if you shutdown a Container and this one was the one with the lowest MAC on it's bridge. Because then, all network affected components outside have to learn a new MAC to route the packets for the remaining Containers to.

I'm currently using a "quite high" prefix and a tail that is derived from the assigned IP. The same "formula" is used to setup a auxiliary DHCP server because use DHCP for the container network setup.

	HWADDR=`IP=${IP#*.}; printf "00:50:C2:%02X:%02X:%02X" ${IP//./ }`        # a.b.c.d -> 00:50:C2:bb:cc:dd (hex)

greetings

Guido

On 01.09.2015 14:01, Peter Steele wrote:
> On 09/01/2015 02:06 AM, Andrey Repin wrote:
>> Greetings, Peter Steele!
>>
>>> lxc.network.hwaddr = 00:xx:xx:xx:xx:xx
>> Do NOT do this.
>> If you want completely random private MAC's, start with 02:...
>>
>> Ref: http://www.iana.org/assignments/ethernet-numbers/ethernet-numbers.xhtml
>>
>>> in my default.conf as well and that generated a random mac address
>>> starting with b6:38, then 78:47, and so on. Is there a recommended
>>> prefix for the auto-generated lxc mac addresses?
>> The recommended prefix is the one that is set by default.
>> You MAY use private prefix, but make sure it is properly indicated.
>>
> I know I don't want arbitrarily random mac addresses, I was asking what is the recommended lxc prefix? A previous poster suggested
> 
> 00:16:3e:xx:xx:xx
> 
> I decided to try
> 
> 00:xx:xx:xx:xx:xx
> 
> just to see if lxc would pick its own hard coded prefix but it seemed to generate something different each time. You recommended that I should use the one that is set by default, but what is that? My default.conf had no entry lxc.network.hwaddr until I put one there.
> 
> Peter
> 
> 
> 
> 
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
> 



More information about the lxc-users mailing list