mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-17 21:03:30 +00:00
66 lines
1.5 KiB
Bash
Executable File
66 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
|
|
# Copyright (c) 2011-2015 OpenWrt.org
|
|
#
|
|
|
|
. /lib/functions/uci-defaults.sh
|
|
. /lib/functions/system.sh
|
|
|
|
board_config_update
|
|
|
|
board=$(board_name)
|
|
|
|
case "$board" in
|
|
asus,rt-ac1300uhp |\
|
|
asus,rt-ac58u |\
|
|
asus,rt-acrh17)
|
|
ucidef_add_switch "switch0" \
|
|
"0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
|
|
lan_mac_addr=$(cat /sys/class/net/eth0/address)
|
|
wan_mac_addr=$(macaddr_add "$lan_mac_addr" 1)
|
|
ucidef_set_interface_macaddr "lan" "$lan_mac_addr"
|
|
ucidef_set_interface_macaddr "wan" "$wan_mac_addr"
|
|
;;
|
|
linksys,ea6350v3 |\
|
|
avm,fritzbox-4040)
|
|
ucidef_add_switch "switch0" \
|
|
"0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
|
|
;;
|
|
compex,wpj428)
|
|
ucidef_add_switch "switch0" \
|
|
"0t@eth0" "4:wan" "5:lan"
|
|
;;
|
|
glinet,gl-b1300)
|
|
ucidef_add_switch "switch0" \
|
|
"0t@eth0" "3:lan" "4:lan" "5:wan"
|
|
;;
|
|
8dev,jalapeno |\
|
|
openmesh,a42 |\
|
|
openmesh,a62)
|
|
ucidef_add_switch "switch0" \
|
|
"0t@eth0" "4:lan" "5:wan"
|
|
;;
|
|
meraki,mr33 |\
|
|
netgear,ex6100v2 |\
|
|
netgear,ex6150v2 |\
|
|
zyxel,wre6606)
|
|
ucidef_set_interface_lan "eth0"
|
|
;;
|
|
zyxel,nbg6617)
|
|
ucidef_add_switch "switch0" \
|
|
"0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan:5"
|
|
lan_mac_addr=$(macaddr_add $(cat /sys/class/net/eth0/address) +2)
|
|
wan_mac_addr=$(macaddr_add "$lan_mac_addr" +1)
|
|
ucidef_set_interface_macaddr "lan" "$lan_mac_addr"
|
|
ucidef_set_interface_macaddr "wan" "$wan_mac_addr"
|
|
;;
|
|
*)
|
|
echo "Unsupported hardware. Network interfaces not intialized"
|
|
;;
|
|
esac
|
|
|
|
board_config_flush
|
|
|
|
exit 0
|