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
|
|
|
|
ap148 |\
|
2016-01-19 10:16:36 +00:00
|
|
|
d7800 |\
|
2016-06-21 09:55:00 +00:00
|
|
|
r7500 |\
|
2016-08-19 20:56:24 +00:00
|
|
|
r7500v2 |\
|
2016-11-23 17:51:15 +00:00
|
|
|
r7800 |\
|
|
|
|
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-08-23 21:44:52 +00:00
|
|
|
c2600)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
|
|
|
|
;;
|
2015-12-03 21:13:12 +00:00
|
|
|
db149)
|
|
|
|
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
|
|
|
;;
|
2016-05-13 06:13:15 +00:00
|
|
|
ea8500)
|
|
|
|
|
|
|
|
hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
|
|
|
|
ucidef_add_switch "switch0" \
|
2017-05-03 11:59:55 +00:00
|
|
|
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
|
2016-05-13 06:13:15 +00:00
|
|
|
ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
|
|
|
|
ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
|
|
|
|
;;
|
2017-03-14 16:04:28 +00:00
|
|
|
fritz4040)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
|
|
|
|
;;
|
2016-10-25 06:40:34 +00:00
|
|
|
nbg6817)
|
|
|
|
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
|