2015-12-03 21:13:12 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
|
|
|
|
# Copyright (c) 2011-2015 OpenWrt.org
|
|
|
|
#
|
|
|
|
|
2015-12-11 15:26:06 +00:00
|
|
|
. /lib/functions/uci-defaults.sh
|
2016-05-13 06:13:15 +00:00
|
|
|
. /lib/functions/system.sh
|
2015-12-03 21:13:12 +00:00
|
|
|
|
|
|
|
board_config_update
|
|
|
|
|
2017-05-12 20:36:07 +00:00
|
|
|
board=$(board_name)
|
2015-12-03 21:13:12 +00:00
|
|
|
|
|
|
|
case "$board" in
|
2018-01-05 13:11:16 +00:00
|
|
|
avm,fritzbox-4040)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
|
|
ucidef_add_switch "switch0" \
|
2018-02-06 20:00:53 +00:00
|
|
|
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
|
2018-01-05 13:11:16 +00:00
|
|
|
;;
|
|
|
|
linksys,ea8500)
|
|
|
|
hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
|
|
|
|
ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
|
|
|
|
ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
|
|
|
|
;;
|
2018-01-05 13:00:11 +00:00
|
|
|
netgear,d7800 |\
|
|
|
|
netgear,r7500 |\
|
|
|
|
netgear,r7500v2 |\
|
|
|
|
netgear,r7800 |\
|
|
|
|
qcom,ipq8064-ap148 |\
|
|
|
|
tplink,vr2600v)
|
2015-12-03 21:13:12 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
|
|
|
|
;;
|
2017-11-30 13:30:06 +00:00
|
|
|
openmesh,a42)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
|
|
;;
|
2018-01-05 13:00:11 +00:00
|
|
|
qcom,ipq8064-db149)
|
2015-12-03 21:13:12 +00:00
|
|
|
ucidef_set_interface_lan "eth1 eth2 eth3"
|
|
|
|
ucidef_add_switch "switch0" \
|
2017-02-07 07:55:46 +00:00
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0"
|
2015-12-03 21:13:12 +00:00
|
|
|
;;
|
2018-01-05 13:11:16 +00:00
|
|
|
tplink,c2600)
|
2017-03-14 16:04:28 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
2018-01-05 13:11:16 +00:00
|
|
|
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
|
2017-03-14 16:04:28 +00:00
|
|
|
;;
|
2018-01-05 13:00:11 +00:00
|
|
|
zyxel,nbg6817)
|
2016-10-25 06:40:34 +00:00
|
|
|
hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
|
2017-10-30 03:28:34 +00:00
|
|
|
ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
|
|
|
|
ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
|
2016-10-25 06:40:34 +00:00
|
|
|
;;
|
2015-12-03 21:13:12 +00:00
|
|
|
*)
|
|
|
|
echo "Unsupported hardware. Network interfaces not intialized"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
board_config_flush
|
|
|
|
|
|
|
|
exit 0
|