Locally administered mac addresses have the second least significant bit of the most significant byte set. If this byte is set then udev on ubuntu doesn't set persistent net rules.
This patch changes the generate_mac to generate a locally administered mac address.
This commit is contained in:
commit
2812f98022
@ -94,7 +94,7 @@ def generate_uid(topic, size=8):
|
||||
|
||||
|
||||
def generate_mac():
|
||||
mac = [0x00, 0x16, 0x3e, random.randint(0x00, 0x7f),
|
||||
mac = [0x02, 0x16, 0x3e, random.randint(0x00, 0x7f),
|
||||
random.randint(0x00, 0xff), random.randint(0x00, 0xff)
|
||||
]
|
||||
return ':'.join(map(lambda x: "%02x" % x, mac))
|
||||
|
Loading…
x
Reference in New Issue
Block a user