Changing the MAC address of wlan1 and eth1

I saw an instruction about how to add "option macaddr" to the /etc/config/wireless config file. I was able to change the MAC address of wlan1. How would I change the MAC address of eth1? Is there a working script that can automatically change the MAC addresses? I've tried the one in the pkgs directory and two others mentioned on the forum, but they are not working on my Netgear R7800.

With ip link I have entries for:

lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
eth1.1@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP
wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP

Thanks for advice.

WiFi - option macaddr is done in the SSID section (iface).

And it cannot be changed in LuCI?

Sure can.

Network -> Interfaces -> Devices -> eth0 -> Configure -> MAC address

I had a "dark reader" turned on and it obscured that "devices" window. I see the configure button and was able to change everything. I did have the wlan1 changed before, but after I changed eth1 and the rest, wlan1 went back to the factory permanent MAC address. Nothing I can do will change it. "option macaddr" in the config file does not work anymore. Do certain conditions have to be met to change wlan1? I notice that the second number of the MAC address has to be an even number for it to be valid.

No, nothing, option macaddr is working fine here, I utilise it in 4 of my WLAN interfaces.

1 Like

No, WiFi cannot.

As I recall WiFi only can be done on command line.

(Further as I recall Ethernet MAC has to be done in a separate section, in version 21 you do have access on the web GUI.)

That's the section I pointed to.

As said, the option macaddr is working here in 4 interfaces to change their MAC addresses.

I think we are saying the same thing.

Ok, thanks for the tip. I did have it working, but I can no longer use "option macaddr" at least on mine. I could have done something to prevent it by accident. I'll keep looking at it. I found that I can ssh into the router and still change wlan1 with:

ifconfig wlan1 down
ifconfig wlan1 hw ether xx:xx:xx:xx:xx:xx
ifconfig wlan1 up

with the xx:xx:xx:xx:xx:xx being whatever MAC address is desired. This is only temporary at least on my machine. It would be nice if it could be made permanent.

Thanks for the replies so far: amteza and lleachii

I have version 21.02.2 .

You would have to install a new WiFi chip...or use the OEM method to change your serial number...or figure out how the MAC is stored in flash and edit the OpenWrt script that obtains it (hint: look at the code)...if I understand you correctly.

Otherwise, you can only configure per SSID/BSSID - that change will persist.

2 Likes

I think I found what I did wrong. I saw the other value assignments between two symbols like the one immediately past this arrow -> '

The line I added at the end of the "iface", in /etc/config/wireless with the "vi" editor was

option macaddr 'xx:xx:xx:xx:xx:xx'

where xx:xx:xx:xx:xx:xx is the MAC address and the second x from the left will be an even number like 0, 2, 4, etc. also don't forget the ' symbols at both ends of the xx:xx:xx:xx:xx:xx

The new MAC address does "persist" after a reboot and that is what I was looking for. I did a hexdump of that "art" partition with the factory MAC address as mentioned before and saw my factory MAC address there. It didn't look like what was described in the OpenWRT documentation.

If my MAC address was C2:8E:22:6A:AC:0B (just a random address I typed in for this), then that partition showed the numbers reversed as 8E C2 6A 22 0B AC and this is all that I saw in that partition that was similar to my factory MAC address.

I don't need to do a "permanent" fix, I meant "semi-permanent" in my case. That simple "option" line as described before will be just fine for now. The other MAC addresses I can easily fix with Network->Interfaces->Devices->Configure in LuCi as mentioned before.

Thanks lleachii, castillofrancodamian, and amteza for the replies and that solved this. It kept me on track, too!

1 Like

Yes, that's why I'm asking. I use snapshots and I was able to change with LUCI the MAC of WAN or LAN, but not Wi-Fi.

But it is not Wireless.

Question was "How would I change the MAC address of eth1?"

Yes, my answer was for a Ethernet interface, logically.

I see that wlan1 is also Wireless.

Removed because of childish behaviour.

It is not a question of being right. I say that it is not possible to change the Wireless MAC in LuCI.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.