From: Semih Baskan Date: Tue, 7 Jul 2026 09:41:51 +0000 (+0300) Subject: mediatek: filogic: set eth0 and LAN port MACs on TP-Link BE450 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1513da34bb1aba16fc28c0ef04304ab991abd6fb;p=thirdparty%2Fopenwrt.git mediatek: filogic: set eth0 and LAN port MACs on TP-Link BE450 eth0 (gmac0) is declared label-mac-device, but nothing assigns its MAC, so it and the DSA lan ports come up with a random locally administered address that changes every boot. Assign the base MAC from tp_data default-mac to eth0 and the lan ports, as is already done for eth1 and eth2. Each lan port needs its own assignment: a DSA user port copies the conduit's MAC once when it is created, at driver probe before preinit runs, and ignores later changes to eth0. Run-tested on a BE450 on 25.12.5, where the case is identical. Two boots without the fix each came up with a different random address; with the fix applied, eth0 and the lan ports get the label MAC and keep it across reboots. Signed-off-by: Semih Baskan Link: https://github.com/openwrt/openwrt/pull/24180 Signed-off-by: Jonas Jelonek --- diff --git a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh index ead84eca265..41bbfd8d19a 100644 --- a/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -37,6 +37,10 @@ preinit_set_mac_address() { ;; tplink,be450) addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0) + ip link set dev eth0 address "$addr" + ip link set dev lan1 address "$addr" + ip link set dev lan2 address "$addr" + ip link set dev lan3 address "$addr" ip link set dev eth1 address "$(macaddr_add $addr 1)" ip link set dev eth2 address "$(macaddr_add $addr 2)" ;;