[Lxc-users] OUI

Jäkel, Guido G.Jaekel at dnb.de
Wed Oct 12 07:34:30 UTC 2011


>Looks like the cheap and easy to get OUI is 36 bits long, leaving only
>12 bits for the user.
>
>Is 4096 possible unique MAC's enough?


I appreciate the development to let LXC assign an "usable" random MAC with an adequate prefix in the default case because this will fit for the most users and use cases.


But for instance, my LXC environment is designed to run it's containers on arbitrary hosts. Therefore I'm rely on DHCP for the network setup (hostname, IP, route, ns, ...) of a container. To get a systematical and "dhcp-centralized" and computable relation between the hostname, the IP and the used MAC. Therefore I calculate it in the LXC starter script using a 3 byte prefix and the 3 last bytes of the IP. Because we use a LAN based on 10.0.0.0/8, this will be unique for it.

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

Shifting to  a.b.c.d -> pp:pp:pp:pp:pu:dd  with any formular to melt down b and c to the low nibble of u will be no enough. Of corse, this is a individual situation. And I may change this from a formula to an request to the DHCPd. Or even use a DHCP pool and an dynamic DNS environment.

But others may have similar constrains. To me it don't sound very sustainable to be limited to just 4096 usable MACs. It means that you have to administrate it in any way, either by hand or by technical tools. Think about, that one may systematical need more than one virtual network card per container.

And with such a low range, if you choose an MAC by random out of 4096, it would be advisable to check by ARP if it's unused.

Guido




More information about the lxc-users mailing list