Skip to content

Commit

Permalink
ipq40xx: use correct wired MAC-addresses for RUTX50
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
blocktrron committed Jan 13, 2025
1 parent ac1ad1a commit 08c9351
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 08c9351

Please sign in to comment.