ar71xx: add user-space support for RB2011UAS
[openwrt/staging/chunkeey.git] / target / linux / ar71xx / base-files / etc / uci-defaults / 02_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 ap132)
26 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
27 ucidef_add_switch "switch0" "1" "1"
28 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
29 ucidef_add_switch_vlan "switch0" "2" "0t 1"
30 ;;
31
32 ap136-010)
33 ucidef_set_interfaces_lan_wan "eth0" "eth1"
34 ucidef_add_switch "switch0" "1" "1"
35 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
36 ucidef_add_switch_vlan "switch0" "2" "5 6"
37 ;;
38
39 ap136-020 |\
40 ap135-020 |\
41 archer-c7)
42 ucidef_set_interfaces_lan_wan "eth1" "eth0"
43 ucidef_add_switch "switch0" "1" "1"
44 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
45 ucidef_add_switch_vlan "switch0" "2" "5 6"
46 ;;
47
48 db120 |\
49 rb-2011l | \
50 rb-2011uas |\
51 rb-2011uas-2hnd)
52 ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2"
53 ucidef_add_switch "switch0" "1" "1"
54 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
55 ucidef_add_switch_vlan "switch0" "2" "0t 1"
56 ucidef_add_switch "switch1" "1" "1"
57 ucidef_add_switch_vlan "switch1" "1" "0 1 2 3 4 5"
58 ;;
59
60 dir-825-b1|\
61 tew-673gru)
62 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
63 ucidef_add_switch "switch0" "1" "1"
64 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
65 ;;
66
67 nbg460n_550n_550nh)
68 ucidef_set_interfaces_lan_wan "eth0" "eth1"
69 ucidef_add_switch "switch0" "1" "1"
70 ucidef_add_switch_vlan "switch0" "0" "0 1 2 3 5"
71 ;;
72
73 rb-433 |\
74 rb-433u)
75 ucidef_set_interfaces_lan_wan "eth1" "eth0"
76 ucidef_add_switch "switch0" "1" "1"
77 ucidef_add_switch_vlan "switch0" "1" "1 2 5"
78 ;;
79
80 rb-435g)
81 ucidef_set_interfaces_lan_wan "eth1" "eth0"
82 ucidef_add_switch "switch0" "1" "1"
83 ucidef_add_switch_vlan "switch0" "1" "0 1 2"
84 ;;
85
86 rb-450)
87 ucidef_set_interfaces_lan_wan "eth1" "eth0"
88 ucidef_add_switch "switch0" "1" "1"
89 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5"
90 ;;
91
92 rb-450g |\
93 routerstation-pro)
94 ucidef_set_interfaces_lan_wan "eth1" "eth0"
95 ucidef_add_switch "switch0" "1" "1"
96 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
97 ;;
98
99 ap136 |\
100 rb-750gl |\
101 rb-751g |\
102 rb-951g-2hnd |\
103 wzr-hp-g450h)
104 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
105 ucidef_add_switch "switch0" "1" "1"
106 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
107 ucidef_add_switch_vlan "switch0" "2" "0t 1"
108 ;;
109
110 rb-493g)
111 ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
112 ucidef_add_switch "switch0" "1" "1"
113 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
114 ucidef_add_switch "switch1" "1" "1"
115 ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
116 ucidef_add_switch_vlan "switch1" "2" "0t 5"
117 ;;
118
119 wzr-hp-g300nh2 |\
120 pb92 |\
121 ap113)
122 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
123 ucidef_add_switch "switch0" "1" "1"
124 ucidef_add_switch_vlan "switch0" "1" "0t 1 3 4 5"
125 ucidef_add_switch_vlan "switch0" "2" "0t 2"
126 ;;
127
128 tl-wdr4300|\
129 tl-wr1041n-v2)
130 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
131 ucidef_add_switch "switch0" "1" "1"
132 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
133 ucidef_add_switch_vlan "switch0" "2" "0t 1"
134 ;;
135
136 tl-wr1043nd)
137 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
138 ucidef_add_switch "switch0" "1" "1"
139 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t"
140 ucidef_add_switch_vlan "switch0" "2" "0 5t"
141 ;;
142
143 tl-wr2543n)
144 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
145 ucidef_add_switch "switch0" "1" "1"
146 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
147 ucidef_add_switch_vlan "switch0" "2" "0 9t"
148 ;;
149
150 tl-wr841n-v1|\
151 tl-wr941nd)
152 ucidef_set_interface_raw "eth" "eth0"
153 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
154 ;;
155
156 tl-mr3420-v2 |\
157 tl-wr841n-v8 |\
158 wnr2000-v3)
159 ucidef_set_interfaces_lan_wan "eth1" "eth0"
160 ucidef_add_switch "switch0" "1" "1"
161 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
162 ;;
163
164 uap-pro)
165 ucidef_set_interface_lan "eth0"
166 ucidef_add_switch "switch0" "1" "1"
167 ucidef_add_switch_vlan "switch0" "1" "0 1 2"
168 ;;
169
170 wrt160nl)
171 ucidef_set_interfaces_lan_wan "eth0" "eth1"
172 ucidef_add_switch "switch0" "1" "1"
173 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 5"
174 ;;
175
176 wzr-hp-g300nh)
177 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
178 ucidef_add_switch "switch0" "1" "1"
179 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
180 ;;
181
182 dir-825-c1 |\
183 dir-835-a1 |\
184 wndr4300)
185 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
186 ucidef_add_switch "switch0" "1" "1"
187 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
188 ucidef_add_switch_vlan "switch0" "2" "0t 5"
189 ;;
190
191 all0305 |\
192 aw-nr580 |\
193 bullet-m |\
194 cap4200ag |\
195 eap7660d |\
196 mr600 |\
197 mr600v2 |\
198 rb-411 |\
199 tl-mr11u |\
200 tl-mr3020 |\
201 tl-mr3040 |\
202 tl-wa901nd |\
203 tl-wa901nd-v2 |\
204 tl-wr703n |\
205 wndap360 |\
206 wp543)
207 ucidef_set_interface_lan "eth0"
208 ;;
209
210 alfa-ap96 |\
211 alfa-nx |\
212 ap83 |\
213 jwap003 |\
214 pb42 |\
215 pb44 |\
216 routerstation|\
217 tl-wr720n-v3|\
218 wpe72)
219 ucidef_set_interfaces_lan_wan "eth1" "eth0"
220 ;;
221
222 ap121 |\
223 ap121-mini |\
224 ap96 |\
225 airrouter |\
226 dir-600-a1 |\
227 dir-615-c1 |\
228 dir-615-e4 |\
229 ja76pf |\
230 rb-750 |\
231 rb-751 |\
232 tew-632brp |\
233 tew-712br |\
234 tl-mr3220 |\
235 tl-mr3220-v2 |\
236 tl-mr3420 |\
237 tl-wdr3500 |\
238 tl-wr741nd |\
239 tl-wr741nd-v4 |\
240 tl-wr841n-v7 |\
241 whr-g301n |\
242 whr-hp-g300n |\
243 whr-hp-gn |\
244 wzr-hp-ag300h)
245 ucidef_set_interfaces_lan_wan "eth0" "eth1"
246 ucidef_add_switch "switch0" "1" "1"
247 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
248 ;;
249
250 wzr-hp-g450h)
251 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
252 ucidef_add_switch "switch0" "1" "1"
253 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
254 ucidef_add_switch_vlan "switch0" "2" "0t 1"
255 ;;
256
257 ew-dorin)
258 ucidef_set_interface_lan "eth0"
259 ucidef_add_switch "switch0" "1" "1"
260 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3"
261 ;;
262
263 ew-dorin-router)
264 ucidef_set_interfaces_lan_wan "eth0" "eth1"
265 ucidef_add_switch "switch0" "1" "1"
266 ucidef_add_switch_vlan "switch0" "1" "0 2 3"
267 ;;
268
269 *)
270 ucidef_set_interfaces_lan_wan "eth0" "eth1"
271 ;;
272 esac
273
274 uci commit network
275
276 exit 0