How to clone MAC in OpenWRT?

Hello,
I want to ask what is the general device agnostic procedure for OpenWRT - to clone / set MAC address on the outer interface (WAN ?), when the Internet Service Provider is limiting the Internet connectivity by MAC address ?

No matter what I do, I don't get Internet. I've tried several things already, but to no avail.

I hope somebody, who have dealt with this knows the exact step(s) on how to clone / set MAC ?

Thanks.

See custom mac address: https://openwrt.org/docs/guide-user/network/ipv4/examples#custom_mac_address

Edit: you can also do it via Luci (the GUI):
Network > Interfaces > Devices

On older configurations the WAN is usually eth0, on newer configurations it is just wan

1 Like

Is this for /etc/network
or if not - what file(s) to edit?

Thanks.

If you do not want to use Luci then yes it is in /etc/config/network

ifconfig will show you what interface the WAN is using (usually eth0 or wan but YMMV)

where in Luci is that? I've tried to set the MAC on the WAN, but it crashes - the router hangs and I need to reboot, probably because it makes identical MAC on 2 different devices - my PC as a client, and the router's external network.

Setting it in the Vendor ID, as suggested elsewhere doesn't hang the router, but doesn't work either, as I don't get Internet at all, not even ping.

I will try with the config file, I hope it won't brick me :slight_smile:

One clarifying question - should I set the ISP expected MAC only on the WAN or also on eth0, which is the switch interface of the router, as I understand?

only on the WAN interface.

network - interfaces - devices - configure... (the device with the WAN MAC)

In a DSA device, never ever configure anything on the internal cpu-switch connection which is usually named eth0. This interface is for internal use only. Configure a MAC on the external port, which is usually named wan, or in the wan network interface.

In the long run it is better to get your ISP to register to the factory MAC of your new router, especially if the alternative is cloning the MAC of a laptop or other device that is still being used. MAC addresses are intended to be globally unique.

I was able to make it work. Turned out to be super simple, as long as one understands this:

Set up IP configuration in Network > Interfaces > Interfaces
Set up MAC address on WAN in Network > Interfaces > Devices

Now, it's all good, a matter of seconds, if you know this.

Yes, you were told this yesterday...

1 Like

I was not told, they're actually on different tabs - it kind of not so intuitive, at least for me.

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