pams
Posts: 14
Joined: Mon Jul 23, 2018 4:30 pm

Change wlan0 mac address via /boot/cmdline.txt

Fri Aug 23, 2019 5:04 pm

How to change wlan0 mac address via /boot/cmdline.txt?
Note that this question is not how to change wlan0 mac address via other means, such as: systemd, machanger, udev, etc. It is specifically via the above file.

To change the mac address of eth0 one would use, for example: smsc95xx.macaddr=DE:AD:BE:EF:CA:FE
How to accomplish the same for wlan0?

And where does one find all the configurable parameters?

User avatar
DougieLawson
Posts: 35817
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Change wlan0 mac address via /boot/cmdline.txt

Fri Aug 23, 2019 6:06 pm

The MAC address for WLAN is the ETH0 MAC address logically XOR'ed with 0x555555

So eth0 MAC b8:27:eb:3c:d8:c4
Gets wlan0 MAC b8:27:eb:69:8d:91

3cd8c4 == 0b0011 1100 1101 1000 1100 0100
XOR'ed w/ 0b0101 0101 0101 0101 0101 0101
698d91 == 0b0110 1001 1000 1101 1001 0001

I'm not sure if that still happens with smsc95xx.macaddr=mm:aa:cc:ad:dr:rs in /boot/cmdline.txt
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

pams
Posts: 14
Joined: Mon Jul 23, 2018 4:30 pm

Re: Change wlan0 mac address via /boot/cmdline.txt

Fri Aug 23, 2019 6:36 pm

Thanks Dougie!

I can confirm that after changing the MAC address of eth0 (via /boot/cmdline.txt), wlan0 will correspond not to the changed, but the original mac address of eth0 XOR'ed with 0x555555.

What I'm left wondering now is: how can you possibly know that? :)
Is it on some boot script?
Last edited by pams on Fri Aug 23, 2019 9:48 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 35817
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Change wlan0 mac address via /boot/cmdline.txt

Fri Aug 23, 2019 7:35 pm

pams wrote:
Fri Aug 23, 2019 6:36 pm

What I'm left wondering now is: how can you possibly know that? :)
Is it on some boot script?
It's on some historic forum posting just after the Raspberry 3B with on-board WiFi appeared.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Andyroo
Posts: 4229
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Change wlan0 mac address via /boot/cmdline.txt

Fri Aug 23, 2019 7:53 pm

DougieLawson wrote:
Fri Aug 23, 2019 7:35 pm
pams wrote:
Fri Aug 23, 2019 6:36 pm

What I'm left wondering now is: how can you possibly know that? :)
Is it on some boot script?
It's on some historic forum posting just after the Raspberry 3B with on-board WiFi appeared.
:o clunk

That clunk is my jaw hitting the floor...
Need Pi spray - these things are breeding in my house...

User avatar
DougieLawson
Posts: 35817
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Change wlan0 mac address via /boot/cmdline.txt

Fri Aug 23, 2019 7:59 pm

Andyroo wrote:
Fri Aug 23, 2019 7:53 pm
DougieLawson wrote:
Fri Aug 23, 2019 7:35 pm
It's on some historic forum posting just after the Raspberry 3B with on-board WiFi appeared.
:o clunk

That clunk is my jaw hitting the floor...
I'm available when you're sitting in front of Jeremy Clarkson and it's the WWTBAM £500,000 question ("How is the WLAN MAC address generated on a Raspberry Pi") and you need a "phone a friend". My brain is full of 40 years worth of technical junk (or at least a pointer to where find it).

https://www.raspberrypi.org/forums/view ... 1#p1278764
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Andyroo
Posts: 4229
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Change wlan0 mac address via /boot/cmdline.txt

Fri Aug 23, 2019 8:09 pm

Mine used to be till I broke it :cry:

Maybe you need to write a ‘1001 things you never knew about the Pi’ book?

I’d buy it.
Need Pi spray - these things are breeding in my house...

Return to “General discussion”