What's new

Change Wireless 2.4GHz & 5GHz MAC address

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Also, check whether you have anything set for MAC Clone (WAN - Internet Connection) because that might be overriding the WAN changes.
 
Okay, I did cloned computer MAC address and it could be the reason. Anyway between your reply I flashed the stable firmware which you shown. Will try everything later. Thanks
 
The changes I suggested don't effect the running system, they are only applied when the system is rebooted.

Again, the real question is why do something like this in the first place...

Nefarious deeds come to nefarious ends...
 
I actually have the same question. Reason is not nefarious at all - have 2 routers so need to know which one I am connected to. Sine both are same ASUS devices the WiFi MAC address is very similar.

Actually had this setup and working on 380 but updated to to latest and now the Mac address is back to stock. Can't remember what I did last time. Appreciate any help.
 
Did you try any of the suggestions in this thread, particularly post #14?

I did try, thanks for checking. The values are in nvram and offset by 4 as suggested but no go. Having the WAN address the same makes no difference. Running 384.5 firmware
 
Bumping this thread as have much the same question due to the issues raised in this video:


Would changing BSSIDs / wireless MAC addresses, along with the SSIDs, help mitigate the tracking issue? I understand there's various opt-out methods (e.g. _nomap) but they depend on other parties behaving a certain way.
 
Bumping this thread as have much the same question due to the issues raised in this video:


Would changing BSSIDs / wireless MAC addresses, along with the SSIDs, help mitigate the tracking issue? I understand there's various opt-out methods (e.g. _nomap) but they depend on other parties behaving a certain way.
This is exactly why i change my MAC address of all wifi routers.
On DD-WRT it's very simple and you can create a script to change it.

Script:
ifconfig eth2 down
ifconfig eth2 hw ether B5:B0:F9:FA:3D:EA
ifconfig eth2 up

This however does not work in merlin.

Is there a script to change mac for wifi 2,4 and 5GHz on boot that does work.

Can we get the UI option in interface in next version of merlin so that user can specify custom mac address in GUI for WiFi, 2.4GHz and 5GHz ?
 
Last edited:
There is no good reason to change an AP's MAC. And every time that MAC changes, your clients are going to get confused by it. Your Windows clients will all switch their firewall to a Public zone instead of a Private one, breaking all kind of home networking features. Bad idea.
 
  • Like
Reactions: Spc
Well all of my AP's have changed WiFi mac addresses, everything works flawlessly on dd-wrt.
I have same settings for years now, no errors or disconnects.
:)
 
Last edited:
So now your new (several years old) MAC addresses have been mapped. I don't think you've accomplished anything long-term. You might as well just buy a new router every few years :).
 
I created a script that works.
I spent few hours thinking about why it doesn't accept new mac address and i found a solution.

Driver gladly accepts new mac address.
Why doesn't mac address change work ?
Because command ifconfig <interface> down doesn't turn off the WiFi interface, it basically does nothing.

This is very strange as it should turn off the interface.

If we first turn off the radio, for both WiFi interfaces.
Then change the mac addresses and then turn radio on, mac change works flawlessly.

Script:

File directory is: jffs/scripts
File: init-start

Code:
#!/bin/sh
nvram set wl0_hwaddr="BA:BA:FA:FA:DE:22"
nvram set wl1_hwaddr="BA:BA:FA:FA:DE:EE"
nvram commit

radio off
sleep 5

ifconfig eth5 hw ether BA:BA:FA:FA:DE:EE
ifconfig eth6 hw ether BA:BA:FA:FA:DE:EE

sleep 5
radio on

service restart_wireless

This script also works if i reboot the router.
If you don't set nvram mac addresses GUI sees original hardware mac and wpa2 password doesn't work, so script has to be run in this order.

1. change nvram values for mac addresses
2. write nvram values
3. turn wifi interfaces off and wait 5 seconds
4. change mac address of wifi interfaces and wait 5 seconds
5. turn radio on
6. restart wireless service so that GUI gets updates with new mac addresses

Just tested it with 10 restarts, all works, no dropouts, wifi speeds are excellent.

No. The wireless driver is closed source and this cannot be changed anymore.
So this is not correct then.


ifconfig:
Code:
eth5      Link encap:Ethernet  HWaddr BA:BA:FA:FA:DE:22
          inet6 addr: fe80::b8ba:faff:fefa:de22/64 Scope:Link
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1728 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:214985 (209.9 KiB)

eth6      Link encap:Ethernet  HWaddr BA:BA:FA:FA:DE:EE
          inet6 addr: fe80::b8ba:faff:fefa:deee/64 Scope:Link
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3599 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:447762 (437.2 KiB)

Screen from android:
Screenshot_20211114-101009_Wifi Analyzer.png

*Tested on ASUS RT-AC2900 (RT-AC86U) Firmware Version:386.3_2

Thank you everyone :)

If anyone needs this script for security or whatever reason to change mac addresses for WiFi interfaces, feel free to use it.


Now i am 100% that we can get a GUI for changing WiFi MAC addresses.
 
Last edited:
I created a script that works.
I spent few hours thinking about why it doesn't accept new mac address and i found a solution.

Driver gladly accepts new mac address.
Why doesn't mac address change work ?
Because command ifconfig <interface> down doesn't turn off the WiFi interface, it basically does nothing.

This is very strange as it should turn off the interface.

If we first turn off the radio, for both WiFi interfaces.
Then change the mac addresses and then turn radio on, mac change works flawlessly.

Script:

File directory is: jffs/scripts
File: init-start

Code:
#!/bin/sh
nvram set wl0_hwaddr="BA:BA:FA:FA:DE:22"
nvram set wl1_hwaddr="BA:BA:FA:FA:DE:EE"
nvram commit

radio off
sleep 5

ifconfig eth5 hw ether BA:BA:FA:FA:DE:EE
ifconfig eth6 hw ether BA:BA:FA:FA:DE:EE

sleep 5
radio on

service restart_wireless

This script also works if i reboot the router.
If you don't set nvram mac addresses GUI sees original hardware mac and wpa2 password doesn't work, so script has to be run in this order.

1. change nvram values for mac addresses
2. write nvram values
3. turn wifi interfaces off and wait 5 seconds
4. change mac address of wifi interfaces and wait 5 seconds
5. turn radio on
6. restart wireless service so that GUI gets updates with new mac addresses

Just tested it with 10 restarts, all works, no dropouts, wifi speeds are excellent.


So this is not correct then.


ifconfig:
Code:
eth5      Link encap:Ethernet  HWaddr BA:BA:FA:FA:DE:22
          inet6 addr: fe80::b8ba:faff:fefa:de22/64 Scope:Link
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1728 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:214985 (209.9 KiB)

eth6      Link encap:Ethernet  HWaddr BA:BA:FA:FA:DE:EE
          inet6 addr: fe80::b8ba:faff:fefa:deee/64 Scope:Link
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3599 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:447762 (437.2 KiB)

Screen from android:
View attachment 37337
*Tested on ASUS RT-AC2900 (RT-AC86U) Firmware Version:386.3_2

Thank you everyone :)

If anyone needs this script for security or whatever reason to change mac addresses for WiFi interfaces, feel free to use it.


Now i am 100% that we can get a GUI for changing WiFi MAC addresses.

I needed to change my MAC addresses too (anyone who says there is no use case should think again), so gave this a go and at a first glance it looks ok. The new MAC addresses for eth5 and 6 are shown in the Merlin GUI, ifconfig and Fing app on my phone. But as soon as I am connected to my WiFi 5GHz, the actual MAC of the Router is the the old LAN MAC. That is confirmed via arp -a in Windows as well as the Fing app on my Android. So whats going on here? As soon as I am connected, a different MAC of the Router is used? Not 100% sure. What I would also like to know is how I would change all MACs, so eth1-4 as well, what would that init-start script look like? I'm really no expert and almost bricked my router by testing different options posted elesewhere.. so I would appreciate some more input on this :)
 
I created a script that works.
I spent few hours thinking about why it doesn't accept new mac address and i found a solution.

Driver gladly accepts new mac address.
Why doesn't mac address change work ?
Because command ifconfig <interface> down doesn't turn off the WiFi interface, it basically does nothing.

This is very strange as it should turn off the interface.

If we first turn off the radio, for both WiFi interfaces.
Then change the mac addresses and then turn radio on, mac change works flawlessly.

Script:

File directory is: jffs/scripts
File: init-start

Code:
#!/bin/sh
nvram set wl0_hwaddr="BA:BA:FA:FA:DE:22"
nvram set wl1_hwaddr="BA:BA:FA:FA:DE:EE"
nvram commit

radio off
sleep 5

ifconfig eth5 hw ether BA:BA:FA:FA:DE:EE
ifconfig eth6 hw ether BA:BA:FA:FA:DE:EE

sleep 5
radio on

service restart_wireless

This script also works if i reboot the router.
If you don't set nvram mac addresses GUI sees original hardware mac and wpa2 password doesn't work, so script has to be run in this order.

1. change nvram values for mac addresses
2. write nvram values
3. turn wifi interfaces off and wait 5 seconds
4. change mac address of wifi interfaces and wait 5 seconds
5. turn radio on
6. restart wireless service so that GUI gets updates with new mac addresses

Just tested it with 10 restarts, all works, no dropouts, wifi speeds are excellent.


So this is not correct then.


ifconfig:
Code:
eth5      Link encap:Ethernet  HWaddr BA:BA:FA:FA:DE:22
          inet6 addr: fe80::b8ba:faff:fefa:de22/64 Scope:Link
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1728 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:214985 (209.9 KiB)

eth6      Link encap:Ethernet  HWaddr BA:BA:FA:FA:DE:EE
          inet6 addr: fe80::b8ba:faff:fefa:deee/64 Scope:Link
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3599 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:447762 (437.2 KiB)

Screen from android:
View attachment 37337
*Tested on ASUS RT-AC2900 (RT-AC86U) Firmware Version:386.3_2

Thank you everyone :)

If anyone needs this script for security or whatever reason to change mac addresses for WiFi interfaces, feel free to use it.


Now i am 100% that we can get a GUI for changing WiFi MAC addresses.
you must be a genius!
 
Sorry in opening up an old thread, How do i make sure this script gets started at startup, I have done a fresh install, Do i need the jffs partition on a usb or will it be ok internal, On an rt-AC88u.

All help greatly appriceated
 
Sorry in opening up an old thread, How do i make sure this script gets started at startup, I have done a fresh install, Do i need the jffs partition on a usb or will it be ok internal, On an rt-AC88u.

All help greatly appriceated
The jffs partition is part of the router's internal storage, it cannot be anywhere else. You need custom scripts enabled in the Merlin GUI to automatically run them.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top