[GH-ISSUE #18] random mac address #9

Closed
opened 2026-02-28 00:40:09 +03:00 by kerem · 2 comments
Owner

Originally created by @acaz on GitHub (Jan 9, 2019).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/18

Hello

I have an issue with mac address randomization ( sorry for my english )
the affair :
a random mac address is correctly generated and affected, but it's impossible to setup an ip address

after boot, no ip address is set. configuration is good
when i try to ifup the interface ( eth0 ) , a have this error :

.. Cannot assign requested address ..

I change the mac address and everything works fine

I found some explanations on the web.
https://askubuntu.com/questions/423530/cant-change-my-mac-address-cant-assign-requested-address

Mac address must be a Locally Administered Unicast MAC Address ( Not sure 100% )
https://www.hellion.org.uk/cgi-bin/randmac.pl?scope=local&type=unicast

Regards

Arnaud

Originally created by @acaz on GitHub (Jan 9, 2019). Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/18 Hello I have an issue with mac address randomization ( sorry for my english ) the affair : a random mac address is correctly generated and affected, but it's impossible to setup an ip address after boot, no ip address is set. configuration is good when i try to ifup the interface ( eth0 ) , a have this error : .. Cannot assign requested address .. I change the mac address and everything works fine I found some explanations on the web. https://askubuntu.com/questions/423530/cant-change-my-mac-address-cant-assign-requested-address Mac address must be a Locally Administered Unicast MAC Address ( Not sure 100% ) https://www.hellion.org.uk/cgi-bin/randmac.pl?scope=local&type=unicast Regards Arnaud
kerem closed this issue 2026-02-28 00:40:09 +03:00
Author
Owner

@acaz commented on GitHub (Jan 11, 2019):

I change some code, add : macaddr[0] = (macaddr[0] | 2) & 0xfe )
seems to work

rand.Seed(time.Now().UnixNano())
rand.Read(macaddr)
macaddr[0] = (macaddr[0] | 2) & 0xfe
macAddrUppr := strings.ToUpper(fmt.Sprintf("%v", macaddr))

<!-- gh-comment-id:453584923 --> @acaz commented on GitHub (Jan 11, 2019): I change some code, add : macaddr[0] = (macaddr[0] | 2) & 0xfe ) seems to work rand.Seed(time.Now().UnixNano()) rand.Read(macaddr) **macaddr[0] = (macaddr[0] | 2) & 0xfe** macAddrUppr := strings.ToUpper(fmt.Sprintf("%v", macaddr))
Author
Owner

@ggongaware commented on GitHub (Jan 16, 2019):

Thank you, added your patch the the master branch

<!-- gh-comment-id:454949116 --> @ggongaware commented on GitHub (Jan 16, 2019): Thank you, added your patch the the master branch
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#9
No description provided.