Skip to content

Commit

Permalink
ipq40xx: Fix ASUS MAP-AC2200 wrong mac adresses
Browse files Browse the repository at this point in the history
MAP-AC2200 orginal openwrt port seems to give random mac-adress to ethernet ports.
This fixes ethernet ports mac adresses as manufacturer provided.

Signed-off-by: Erkki Hietaranta <[email protected]>
  • Loading branch information
sbeach92 committed Dec 13, 2023
1 parent 46ae23d commit b197a93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions target/linux/ipq40xx/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ ipq40xx_setup_macs()
lan_mac=$(macaddr_add "$label_mac" 1)
wan_mac=$(macaddr_add "$label_mac" 3)
;;
asus,map-ac2200)
label_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
wan_mac=$(macaddr_add "$label_mac" 1)
lan_mac=$(macaddr_add "$label_mac" 3)
;;
asus,rt-ac42u)
label_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

preinit_set_mac_address() {
case $(board_name) in
asus,map-ac2200)
base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
ip link set dev eth0 address $(macaddr_add "$base_mac" 1)
ip link set dev eth1 address $(macaddr_add "$base_mac" 3)
;;
asus,map-ac1300)
base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
ip link set dev eth0 address $(macaddr_add "$base_mac" 1)
ip link set dev lan address $(macaddr_add "$base_mac" 1)
ip link set dev wan address $(macaddr_add "$base_mac" 3)
;;
asus,map-ac2200)
base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
ip link set dev eth0 address $(macaddr_add "$base_mac" 1)
ip link set dev wan address $(macaddr_add "$base_mac" 1)
ip link set dev lan address $(macaddr_add "$base_mac" 3)
;;
asus,rt-ac42u)
base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
ip link set dev eth0 address $base_mac
Expand Down

0 comments on commit b197a93

Please sign in to comment.