[Lxc-users] How are pseudorandom MACs selected?

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


For each lxc.network.type = veth, if you DON'T specify an
lxc.network.hwaddr, you get one assigned at random (example below).

Are these assignments made from a reserved range (a la 169.254/16 in
IPv4), or are they randomized across the entire address space?  AFAICT,
it MUST be the latter.

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?

For example, it wouldn't surprise me if some hardware/software did
things like "hmm, your MAC indicates you're from <vendor>, and I know
<vendor> doesn't implement jumbo frames correctly, so I won't send you
any" -- which could result in bizarro issues because my container isn't
actually a <vendor> NIC.

    # ip -o l | grep veth | tr '\\' '\n' | grep link/ether | sort
    link/ether 06:f7:5a:69:b8:e5 brd ff:ff:ff:ff:ff:ff
    link/ether 12:89:2b:60:81:36 brd ff:ff:ff:ff:ff:ff
    link/ether 1a:be:07:cb:81:50 brd ff:ff:ff:ff:ff:ff
    link/ether 2e:ea:93:ef:0b:9a brd ff:ff:ff:ff:ff:ff
    link/ether 46:aa:11:c4:94:ef brd ff:ff:ff:ff:ff:ff
    link/ether 72:1e:8e:08:7b:e2 brd ff:ff:ff:ff:ff:ff
    link/ether 7a:24:c3:dc:20:d4 brd ff:ff:ff:ff:ff:ff
    link/ether 82:53:b7:5d:85:64 brd ff:ff:ff:ff:ff:ff
    link/ether 86:f8:a4:a6:b0:03 brd ff:ff:ff:ff:ff:ff
    link/ether 96:b8:59:76:66:02 brd ff:ff:ff:ff:ff:ff
    link/ether c2:f3:df:47:e4:10 brd ff:ff:ff:ff:ff:ff
    link/ether d6:df:18:81:12:c1 brd ff:ff:ff:ff:ff:ff
    link/ether e6:41:f1:ee:7b:0f brd ff:ff:ff:ff:ff:ff
    link/ether ea:99:00:37:d3:e8 brd ff:ff:ff:ff:ff:ff





More information about the lxc-users mailing list