[Lxc-users] How are pseudorandom MACs selected?

Trent W. Buck twb at cybersource.com.au
Wed Feb 2 09:57:28 UTC 2011


twb at cybersource.com.au (Trent W. Buck)
writes:

> Further, when manually allocating a static hwaddr (so I can map it to an
> IP within the DHCP server), is there any particular range I should avoid
> or stick to?

On further reading, I see there are apparently reserved address regions
for private use:

    Universally administered and locally administered addresses are
    distinguished by setting the second least significant bit of the
    most significant byte of the address. If the bit is 0, the address
    is universally administered. If it is 1, the address is locally
    administered. In the example address 06-00-00-00-00-01 the most
    significant byte is 06 (hex), the binary form of which is 00000110,
    where the second least significant bit is 1. Therefore, it is a
    locally administered address.^[4] Consequently, this bit is 0 in all
    OUIs.

    If the least significant bit of the most significant octet of an
    address is set to 0 (zero), the frame is meant to reach only one
    receiving NIC.^[5] This type of transmission is called unicast. A
    unicast frame is transmitted to all nodes within the collision
    domain, which typically ends at the nearest network switch or
    router. Only the node with the matching hardware MAC address will
    accept the frame; network frames with non-matching MAC-addresses are
    ignored,

    http://en.wikipedia.org/wiki/Mac_address

Thus, when setting lxc.network.hwaddr, I should pick a locally-
administered unicast address, i.e. one of

    x2:xx:xx:xx:xx:xx
    x6:xx:xx:xx:xx:xx
    xA:xx:xx:xx:xx:xx
    xE:xx:xx:xx:xx:xx

So I might as well start at 02:00:00:00:00:00 and increment by one per
container, and the only problem that should occur is if my equipment
moves to another ethernet network and its admin chose the same addresses
for HIS equipment.





More information about the lxc-users mailing list