How to get fixed mac for LAN with DIR-860L

With the latest snapshot after commit '373c08bc...', I am having trouble getting a fixed mac address, it get random after each reboot.

My setup need LAN mac address to be fixed so it can get an fixed ip for AP from upstream router.

For now what's the best practice to get that?

Maybe explicitly set it

config device
	option name 'lanx'
	option macaddr 'xx:...'

after check as to

dmesg | grep -i mac

what might be found by kernel setup. Not sure why the commit changed things, just a different way of getting the value, maybe its bugged.

root@OpenWrt:~# dmesg | grep -i mac
[    0.000000] MIPS: machine is D-Link DIR-860L B1
[    1.465104] mtk_soc_eth 1e100000.ethernet: generated random MAC address ea:e9:d3:51:92:04

Yes it looks like has been randomly generated. I just tried explicit setting MAC address but it does not work.

Should work, I have a mamba that sets up the same way with a random MAC. May be worthwhile to take a look at what the OOTB setup looks like for the network config file.

cd /etc/config
mv network networkBAK

and inspect the newly generated config file then merge. or whatever; might be an IP or other change there!!

Edit: wan port not lan ???

My setup is using LAN port 1 as gateway to the upstream router, LAN port 1 is also part of the upstream router's lan network.

The WAN port is not in use at all.

Edit: I don't understand why upstream Linux would change LAN mac address into random with each reboot.

OK, since the kernel now got me random mac address for ports with every reboot, I have to use these ports under bridges, which can be set with a specific MAC address by users.

config device
        option name 'br-lan1'
        option type 'bridge'
        option macaddr 'c6:2c:6c:7d:42:c5'
        list ports 'lan1'

config interface 'lan_gateway'
        option proto 'dhcp'
        option device 'br-lan1'

With the above settings, port 1 combined as a bridge, to act as my gateway to the upstream router, which solved my problem after upgrade to the latest snapshot.

I think that post commit the MAC is to be set on the device rather than the bridge itself as per post example. Not sure if it will matter down the road.

I have to mention that the random MAC address issue has been resolved with changes in master branch, at least it disappeared after '6bc6a416851...' snapshot build.

But, since the bridge configuration seems generate much less interrupts, I might as well keep current bridge settings.

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