ar71xx: add user-space support for the Ubiquiti UniFi AP-Outdoor board
[openwrt/staging/yousong.git] / target / linux / ar71xx / base-files / etc / uci-defaults / network
1 #!/bin/sh
2 #
3 # Copyright (C) 2011 OpenWrt.org
4 #
5
6 [ -e /etc/config/network ] && exit 0
7
8 touch /etc/config/network
9
10 . /lib/functions/uci-defaults.sh
11 . /lib/ar71xx.sh
12
13 ucidef_set_interface_loopback
14
15 board=$(ar71xx_board_name)
16
17 case "$board" in
18 all0315n |\
19 all0258n |\
20 ja76pf2|\
21 ubnt-unifi-outdoor)
22 ucidef_set_interface_lan "eth0 eth1"
23 ;;
24
25 db120 |\
26 rb-2011l | \
27 rb-2011uas-2hnd)
28 ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2"
29 ucidef_add_switch "eth0" "1" "1"
30 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
31 ucidef_add_switch_vlan "eth0" "2" "0t 1"
32 ucidef_add_switch "eth1" "1" "1"
33 ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5"
34 ;;
35
36 dir-825-b1|\
37 tew-673gru)
38 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
39 ucidef_add_switch "rtl8366s" "1" "1"
40 ucidef_add_switch_vlan "rtl8366s" "1" "0 1 2 3 5t"
41 ;;
42
43 nbg460n_550n_550nh)
44 ucidef_set_interfaces_lan_wan "eth0" "eth1"
45 ucidef_add_switch "rtl8366s" "1" "1"
46 ucidef_add_switch_vlan "rtl8366s" "0" "0 1 2 3 5"
47 ;;
48
49 rb-433 |\
50 rb-433u)
51 ucidef_set_interfaces_lan_wan "eth1" "eth0"
52 ucidef_add_switch "switch0" "1" "1"
53 ucidef_add_switch_vlan "switch0" "1" "1 2 5"
54 ;;
55
56 rb-450)
57 ucidef_set_interfaces_lan_wan "eth1" "eth0"
58 ucidef_add_switch "eth1" "1" "1"
59 ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 5"
60 ;;
61
62 rb-450g |\
63 routerstation-pro)
64 ucidef_set_interfaces_lan_wan "eth1" "eth0"
65 ucidef_add_switch "switch0" "1" "1"
66 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
67 ;;
68
69 ap136 |\
70 rb-750gl |\
71 rb-751g |\
72 wzr-hp-g450h)
73 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
74 ucidef_add_switch "switch0" "1" "1"
75 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
76 ucidef_add_switch_vlan "switch0" "2" "0t 1"
77 ;;
78
79 rb-493g)
80 ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
81 ucidef_add_switch "switch0" "1" "1"
82 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
83 ucidef_add_switch "switch1" "1" "1"
84 ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
85 ucidef_add_switch_vlan "switch1" "2" "0t 5"
86 ;;
87
88 wzr-hp-g300nh2 |\
89 pb92 |\
90 ap113)
91 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
92 ucidef_add_switch "eth0" "1" "1"
93 ucidef_add_switch_vlan "eth0" "1" "0t 1 3 4 5"
94 ucidef_add_switch_vlan "eth0" "2" "0t 2"
95 ;;
96
97 tl-wdr4300|\
98 tl-wr1041n-v2)
99 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
100 ucidef_add_switch "eth0" "1" "1"
101 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
102 ucidef_add_switch_vlan "eth0" "2" "0t 1"
103 ;;
104
105 tl-wr1043nd)
106 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
107 ucidef_add_switch "rtl8366rb" "1" "1"
108 ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t"
109 ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t"
110 ;;
111
112 tl-wr2543n)
113 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
114 ucidef_add_switch "switch0" "1" "1"
115 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
116 ucidef_add_switch_vlan "switch0" "2" "0 9t"
117 ;;
118
119 tl-wr841n-v1|\
120 tl-wr941nd)
121 ucidef_set_interface_raw "eth" "eth0"
122 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
123 ;;
124
125 tl-wr841n-v8)
126 ucidef_set_interfaces_lan_wan "eth1" "eth0"
127 ucidef_add_switch "switch0" "1" "1"
128 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
129 ;;
130
131 wrt160nl)
132 ucidef_set_interfaces_lan_wan "eth0" "eth1"
133 ucidef_add_switch "eth0" "1" "1"
134 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
135 ;;
136
137 wzr-hp-g300nh)
138 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
139 ucidef_add_switch "switch0" "1" "1"
140 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
141 ;;
142
143 all0305 |\
144 aw-nr580 |\
145 bullet-m |\
146 cap4200ag |\
147 eap7660d |\
148 rb-411 |\
149 tl-mr11u |\
150 tl-mr3020 |\
151 tl-mr3040 |\
152 tl-wa901nd |\
153 tl-wa901nd-v2 |\
154 tl-wr703n |\
155 wp543)
156 ucidef_set_interface_lan "eth0"
157 ;;
158
159 alfa-ap96 |\
160 alfa-nx |\
161 ap83 |\
162 jwap003 |\
163 pb42 |\
164 pb44 |\
165 routerstation|\
166 wpe72)
167 ucidef_set_interfaces_lan_wan "eth1" "eth0"
168 ;;
169
170 ap121 |\
171 ap121-mini |\
172 ap96 |\
173 airrouter |\
174 dir-600-a1 |\
175 dir-615-c1 |\
176 dir-615-e4 |\
177 ja76pf |\
178 rb-750 |\
179 rb-751 |\
180 tew-632brp |\
181 tew-712br |\
182 tl-mr3220 |\
183 tl-mr3420 |\
184 tl-wr741nd |\
185 tl-wr741nd-v4 |\
186 tl-wr841n-v7 |\
187 whr-g301n |\
188 whr-hp-g300n |\
189 whr-hp-gn |\
190 wzr-hp-ag300h)
191 ucidef_set_interfaces_lan_wan "eth0" "eth1"
192 ucidef_add_switch "eth0" "1" "1"
193 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
194 ;;
195
196 wzr-hp-g450h)
197 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
198 ucidef_add_switch "eth0" "1" "1"
199 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
200 ucidef_add_switch_vlan "eth0" "2" "0t 1"
201 ;;
202
203 ew-dorin)
204 ucidef_set_interface_lan "eth0"
205 ucidef_add_switch "eth0" "1" "1"
206 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3"
207 ;;
208
209 ew-dorin-router)
210 ucidef_set_interfaces_lan_wan "eth0" "eth1"
211 ucidef_add_switch "eth0" "1" "1"
212 ucidef_add_switch_vlan "eth0" "1" "0 2 3"
213 ;;
214
215 *)
216 ucidef_set_interfaces_lan_wan "eth0" "eth1"
217 ;;
218 esac
219
220 uci commit network
221
222 exit 0