2011-11-07 21:43:51 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (C) 2011 OpenWrt.org
|
|
|
|
#
|
|
|
|
|
|
|
|
[ -e /etc/config/network ] && exit 0
|
|
|
|
|
|
|
|
touch /etc/config/network
|
|
|
|
|
2011-12-01 22:48:47 +00:00
|
|
|
. /lib/functions/uci-defaults.sh
|
2011-11-07 21:43:51 +00:00
|
|
|
. /lib/ar71xx.sh
|
|
|
|
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interface_loopback
|
|
|
|
|
2011-11-07 21:43:51 +00:00
|
|
|
board=$(ar71xx_board_name)
|
|
|
|
|
|
|
|
case "$board" in
|
2011-11-07 21:44:23 +00:00
|
|
|
all0258n)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interface_lan "eth0 eth1"
|
2011-11-07 21:44:23 +00:00
|
|
|
;;
|
|
|
|
|
2011-12-15 22:25:38 +00:00
|
|
|
db120)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
|
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:07 +00:00
|
|
|
dir-825-b1)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
|
|
|
|
ucidef_add_switch "rtl8366s" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "rtl8366s" "1" "0 1 2 3 5t"
|
2011-11-07 21:44:07 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:20 +00:00
|
|
|
nbg460n_550n_550nh)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
|
|
ucidef_add_switch "rtl8366s" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "rtl8366s" "0" "0 1 2 3 5"
|
2011-11-07 21:44:20 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:43:58 +00:00
|
|
|
rb-433 |\
|
|
|
|
rb-433u)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "1 2 5"
|
2011-11-07 21:43:58 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:02 +00:00
|
|
|
rb-450)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
|
|
ucidef_add_switch "eth1" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 5"
|
2011-11-07 21:44:02 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:01 +00:00
|
|
|
rb-450g |\
|
|
|
|
routerstation-pro)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
|
2011-11-07 21:44:01 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:12 +00:00
|
|
|
rb-493g)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
|
|
|
|
ucidef_add_switch "switch1" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
|
|
|
|
ucidef_add_switch_vlan "switch1" "2" "0t 5"
|
2011-11-07 21:44:12 +00:00
|
|
|
;;
|
|
|
|
|
2011-12-21 19:32:40 +00:00
|
|
|
wzr-hp-g300nh2 |\
|
2011-11-07 21:44:08 +00:00
|
|
|
pb92)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
ucidef_add_switch "eth0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "eth0" "1" "0t 1 3 4 5"
|
|
|
|
ucidef_add_switch_vlan "eth0" "2" "0t 2"
|
2011-11-07 21:44:08 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:24 +00:00
|
|
|
tl-wa901nd)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interface_raw "eth" "eth0"
|
|
|
|
ucidef_set_interface_lan "lan"
|
2011-11-07 21:44:24 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:11 +00:00
|
|
|
tl-wr1043nd)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
ucidef_add_switch "rtl8366rb" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t"
|
|
|
|
ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t"
|
2011-11-07 21:44:11 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:03 +00:00
|
|
|
tl-wr841n-v1|\
|
|
|
|
tl-wr941nd)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interface_raw "eth" "eth0"
|
|
|
|
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
|
2011-11-07 21:44:03 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:09 +00:00
|
|
|
wrt160nl)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
|
|
ucidef_add_switch "eth0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
|
2011-11-07 21:44:09 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:17 +00:00
|
|
|
wzr-hp-g300nh)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
|
2011-11-07 21:44:17 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:43:52 +00:00
|
|
|
aw-nr580 |\
|
|
|
|
bullet-m |\
|
|
|
|
eap7660d |\
|
|
|
|
rb-411 |\
|
|
|
|
tl-wa901nd-v2 |\
|
|
|
|
tl-wr703n |\
|
|
|
|
wp543)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interface_lan "eth0"
|
2011-11-07 21:43:52 +00:00
|
|
|
;;
|
|
|
|
|
2012-01-01 19:30:25 +00:00
|
|
|
alfa-nx |\
|
2011-11-07 21:43:54 +00:00
|
|
|
ap83 |\
|
|
|
|
jwap003 |\
|
|
|
|
pb42 |\
|
|
|
|
pb44 |\
|
|
|
|
routerstation)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
2011-11-07 21:43:54 +00:00
|
|
|
;;
|
|
|
|
|
2011-11-07 21:43:56 +00:00
|
|
|
ap121 |\
|
|
|
|
ap121-mini |\
|
|
|
|
ap96 |\
|
2011-12-01 22:49:02 +00:00
|
|
|
airrouter |\
|
2011-11-07 21:43:56 +00:00
|
|
|
dir-600-a1 |\
|
|
|
|
dir-615-c1 |\
|
|
|
|
ja76pf |\
|
|
|
|
rb750 |\
|
|
|
|
tew-632brp |\
|
|
|
|
tl-mr3220 |\
|
|
|
|
tl-mr3420 |\
|
|
|
|
tl-wr741nd |\
|
|
|
|
tl-wr741nd-v4 |\
|
|
|
|
whr-g301n |\
|
|
|
|
whr-hp-g300n |\
|
|
|
|
whr-hp-gn |\
|
|
|
|
wzr-hp-ag300h)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
|
|
ucidef_add_switch "eth0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
|
2011-11-07 21:43:56 +00:00
|
|
|
;;
|
|
|
|
|
2011-12-21 19:32:40 +00:00
|
|
|
wzr-hp-g450h)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
ucidef_add_switch "eth0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
|
|
|
|
ucidef_add_switch_vlan "eth0" "2" "0t 1"
|
|
|
|
;;
|
|
|
|
|
2011-11-07 21:43:51 +00:00
|
|
|
*)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
2011-11-07 21:43:51 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
uci commit network
|
|
|
|
|
|
|
|
exit 0
|