diff options
| author | David Bauer | 2025-01-13 14:18:31 +0000 |
|---|---|---|
| committer | David Bauer | 2025-01-13 14:18:31 +0000 |
| commit | 08c93512fe39ac25f78fb2ab0f32cb2a830c5b70 (patch) | |
| tree | 46ca53939a187f4482bd6975873eca6a79a6fe87 | |
| parent | ac1ad1a7ad6bb3a528def4154e91dd398fda8db5 (diff) | |
| download | openwrt-08c93512fe39ac25f78fb2ab0f32cb2a830c5b70.tar.gz | |
ipq40xx: use correct wired MAC-addresses for RUTX50
The Teltonika RUTX50 mac-addresses on its wired interfaces are currently
random on every boot.
Setting the mac-addresses from device-tree using nvmem does not work, as
the vendor bootloader mangles the mtd partitions, removing the
nvmem-cells property.
To remedy the random mac-addresse, set the correct ones in preinit.
Signed-off-by: David Bauer <mail@david-bauer.net>
| -rw-r--r-- | target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh index 1ede544aac..092f9da440 100644 --- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh +++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh @@ -43,6 +43,17 @@ preinit_set_mac_address() { ip link set dev sw-eth1 address "$base_mac" ip link set dev sw-eth2 address $(macaddr_add "$base_mac" 1) ;; + teltonika,rutx50) + # Vendor Bootloader removes nvmem-cells from partition, + # so this needs to be done here. + base_mac="$(mtd_get_mac_binary 0:CONFIG 0x0)" + ip link set dev eth0 address "$base_mac" + ip link set dev lan1 address "$base_mac" + ip link set dev lan2 address "$base_mac" + ip link set dev lan3 address "$base_mac" + ip link set dev lan4 address "$base_mac" + ip link set dev wan address "$(macaddr_add "$base_mac" 1)" + ;; zyxel,nbg6617) base_mac=$(cat /sys/class/net/eth0/address) ip link set dev eth0 address $(macaddr_add "$base_mac" 2) |