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
|
2012-08-27 14:55:32 +00:00
|
|
|
all0315n |\
|
2012-03-16 18:00:34 +00:00
|
|
|
all0258n |\
|
2012-11-13 20:57:18 +00:00
|
|
|
ja76pf2|\
|
|
|
|
ubnt-unifi-outdoor)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interface_lan "eth0 eth1"
|
2011-11-07 21:44:23 +00:00
|
|
|
;;
|
|
|
|
|
2013-01-29 19:12:32 +00:00
|
|
|
ap132)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "0t 1"
|
|
|
|
;;
|
|
|
|
|
2012-12-26 09:50:31 +00:00
|
|
|
ap136-010)
|
2012-12-22 12:12:50 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "5 6"
|
|
|
|
;;
|
|
|
|
|
2012-12-29 16:02:27 +00:00
|
|
|
ap136-020 |\
|
|
|
|
ap135-020)
|
2012-12-26 09:50:36 +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"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "5 6"
|
|
|
|
;;
|
|
|
|
|
2012-09-09 14:05:22 +00:00
|
|
|
db120 |\
|
2012-09-09 14:05:32 +00:00
|
|
|
rb-2011l | \
|
|
|
|
rb-2011uas-2hnd)
|
2012-03-18 22:06:58 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "0t 1"
|
|
|
|
ucidef_add_switch "switch1" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch1" "1" "0 1 2 3 4 5"
|
2011-12-15 22:25:38 +00:00
|
|
|
;;
|
|
|
|
|
2012-02-08 16:26:25 +00:00
|
|
|
dir-825-b1|\
|
|
|
|
tew-673gru)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "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"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "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
|
|
|
;;
|
|
|
|
|
2012-11-18 10:18:02 +00:00
|
|
|
rb-435g)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2"
|
|
|
|
;;
|
|
|
|
|
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"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "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
|
|
|
;;
|
|
|
|
|
2012-07-05 08:26:50 +00:00
|
|
|
ap136 |\
|
2012-03-19 15:57:04 +00:00
|
|
|
rb-750gl |\
|
2012-04-06 06:45:07 +00:00
|
|
|
rb-751g |\
|
2013-02-17 10:08:41 +00:00
|
|
|
rb-951g-2hnd |\
|
2012-03-19 15:57:04 +00:00
|
|
|
wzr-hp-g450h)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "0t 1"
|
|
|
|
;;
|
|
|
|
|
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 |\
|
2012-01-28 13:19:49 +00:00
|
|
|
pb92 |\
|
|
|
|
ap113)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0t 1 3 4 5"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "0t 2"
|
2011-11-07 21:44:08 +00:00
|
|
|
;;
|
|
|
|
|
2012-06-19 11:51:18 +00:00
|
|
|
tl-wdr4300|\
|
2012-05-05 17:02:35 +00:00
|
|
|
tl-wr1041n-v2)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "0t 1"
|
2012-05-05 17:02:35 +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"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "0 5t"
|
2011-11-07 21:44:11 +00:00
|
|
|
;;
|
|
|
|
|
2012-01-07 19:36:35 +00:00
|
|
|
tl-wr2543n)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "0 9t"
|
|
|
|
;;
|
|
|
|
|
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
|
|
|
;;
|
|
|
|
|
2013-03-11 15:55:22 +00:00
|
|
|
tl-mr3420-v2 |\
|
2013-04-26 17:00:54 +00:00
|
|
|
tl-wr841n-v8 |\
|
|
|
|
wnr2000-v3)
|
2012-10-04 20:16:05 +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"
|
|
|
|
;;
|
|
|
|
|
2012-12-17 12:28:11 +00:00
|
|
|
uap-pro)
|
|
|
|
ucidef_set_interface_lan "eth0"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2"
|
|
|
|
;;
|
|
|
|
|
2011-11-07 21:44:09 +00:00
|
|
|
wrt160nl)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "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
|
|
|
;;
|
|
|
|
|
2013-03-11 15:55:15 +00:00
|
|
|
dir-825-c1 |\
|
|
|
|
dir-835-a1 |\
|
2012-12-12 16:49:51 +00:00
|
|
|
wndr4300)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
|
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "0t 5"
|
|
|
|
;;
|
|
|
|
|
2012-08-22 12:33:22 +00:00
|
|
|
all0305 |\
|
2011-11-07 21:43:52 +00:00
|
|
|
aw-nr580 |\
|
|
|
|
bullet-m |\
|
2012-10-27 08:55:39 +00:00
|
|
|
cap4200ag |\
|
2011-11-07 21:43:52 +00:00
|
|
|
eap7660d |\
|
2012-11-18 09:32:35 +00:00
|
|
|
mr600 |\
|
2013-02-01 15:50:45 +00:00
|
|
|
mr600v2 |\
|
2011-11-07 21:43:52 +00:00
|
|
|
rb-411 |\
|
2012-01-31 18:37:01 +00:00
|
|
|
tl-mr11u |\
|
2012-01-04 17:30:47 +00:00
|
|
|
tl-mr3020 |\
|
2012-09-24 18:45:56 +00:00
|
|
|
tl-mr3040 |\
|
2012-01-04 17:30:52 +00:00
|
|
|
tl-wa901nd |\
|
2011-11-07 21:43:52 +00:00
|
|
|
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-04 21:13:54 +00:00
|
|
|
alfa-ap96 |\
|
2012-01-01 19:30:25 +00:00
|
|
|
alfa-nx |\
|
2011-11-07 21:43:54 +00:00
|
|
|
ap83 |\
|
|
|
|
jwap003 |\
|
|
|
|
pb42 |\
|
|
|
|
pb44 |\
|
2012-01-26 17:01:41 +00:00
|
|
|
routerstation|\
|
2013-04-26 17:00:49 +00:00
|
|
|
tl-wr720n-v3|\
|
2012-01-26 17:01:41 +00:00
|
|
|
wpe72)
|
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 |\
|
2012-01-31 18:37:09 +00:00
|
|
|
dir-615-e4 |\
|
2011-11-07 21:43:56 +00:00
|
|
|
ja76pf |\
|
2012-01-06 07:20:54 +00:00
|
|
|
rb-750 |\
|
2012-04-06 06:45:07 +00:00
|
|
|
rb-751 |\
|
2011-11-07 21:43:56 +00:00
|
|
|
tew-632brp |\
|
2012-08-22 20:12:24 +00:00
|
|
|
tew-712br |\
|
2011-11-07 21:43:56 +00:00
|
|
|
tl-mr3220 |\
|
2012-12-19 08:50:41 +00:00
|
|
|
tl-mr3220-v2 |\
|
2011-11-07 21:43:56 +00:00
|
|
|
tl-mr3420 |\
|
2013-03-24 19:23:36 +00:00
|
|
|
tl-wdr3500 |\
|
2011-11-07 21:43:56 +00:00
|
|
|
tl-wr741nd |\
|
|
|
|
tl-wr741nd-v4 |\
|
2012-01-04 17:30:57 +00:00
|
|
|
tl-wr841n-v7 |\
|
2011-11-07 21:43:56 +00:00
|
|
|
whr-g301n |\
|
|
|
|
whr-hp-g300n |\
|
|
|
|
whr-hp-gn |\
|
2013-03-03 21:59:34 +00:00
|
|
|
wzr-hp-ag300h)
|
2011-12-01 22:48:47 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "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"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
|
|
|
|
ucidef_add_switch_vlan "switch0" "2" "0t 1"
|
2011-12-21 19:32:40 +00:00
|
|
|
;;
|
|
|
|
|
2012-10-14 16:24:25 +00:00
|
|
|
ew-dorin)
|
|
|
|
ucidef_set_interface_lan "eth0"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 1 2 3"
|
2012-10-14 16:24:25 +00:00
|
|
|
;;
|
|
|
|
|
2012-08-01 12:24:57 +00:00
|
|
|
ew-dorin-router)
|
2012-06-19 00:22:04 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
2013-02-11 16:54:52 +00:00
|
|
|
ucidef_add_switch "switch0" "1" "1"
|
|
|
|
ucidef_add_switch_vlan "switch0" "1" "0 2 3"
|
2012-06-19 00:22:04 +00:00
|
|
|
;;
|
|
|
|
|
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
|