MAC Address cannot be changed

OpenWrt 22.03.0 r19685-512e76967f / LuCI openwrt-22.03 branch git-22.304.65171-ec905e6
TP-Link Archer A7 v5

In the past, I was able to override the MAC on the WAN interface. But in recent versions of OpenWrt, it doesn't take. I entered a custom MAC on the devices in the Devices tab, but on the Interfaces tab, WAN is showing the default. It is ignoring the MAC value from the associated device.

Is there another way to accomplish?


After changes, don't forget the Save & Apply button, see also unsaved changes button on top of screen?

You could also check /etc/config/network, it should contain something like:

config device
        option name 'wan'
        option macaddr 'FF:F6:24:84:89:5A'

Hopefully you get it working as it should be.


1 Like

Logged in just to share why masking WAN MAC with a custom-generated macaddr didn't work for me. It was quite silly of me, actually.

I used Browserling's MAC address generator, which can break the rule that the 1st octet of any valid MAC address should be an even number. E.g., 59:0b:25:9b:0c:da was not a valid MAC address.

Eventually I just "stole" a real MAC address (from my old USB-Ethernet dongle), and it worked well when configured via LuCI in Interfaces/Devices section.

On a side note, I had to force-release the old WAN DHCP lease (obtained from a cable modem in bridge mode):

Also, I had to release the old WAN DHCP lease first, to get the new one:

ps | grep dhcpc
kill -s USR2 <udhcpc_pid>

On some devices, a uboot environment variable sets the hardware MAC address at boot.

Use fw_printenv, if that works check the output for the ethaddr variable. If it's present, then you can use fw_setenv ethaddr 00:11:22:33:44:55:66 to set the MAC address.


Tks! What package do I need to install to get fw_printenv? It seems to be missing in my custom build.

It's part of uboot-envtools, but if it's not automatically set up in the build, it won't work as it requires very specific comfiguration of the hex address of the configuration file within the config partition.