ar71xx: add support for the devolo dLAN pro 1200+ WiFi ac
[openwrt/openwrt.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 rocket-m-ti |\
22 ubnt-unifi-outdoor)
23 ucidef_set_interface_lan "eth0 eth1"
24 ;;
25
26 ap132 |\
27 wlr8100)
28 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
29 ucidef_add_switch "switch0" "1" "1"
30 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
31 ucidef_add_switch_vlan "switch0" "2" "0t 1"
32 ;;
33
34 esr1750 |\
35 epg5000)
36 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
37 ucidef_add_switch "switch0" "1" "1"
38 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
39 ucidef_add_switch_vlan "switch0" "2" "0t 5"
40 ;;
41
42 ap136-010)
43 ucidef_set_interfaces_lan_wan "eth0" "eth1"
44 ucidef_add_switch "switch0" "1" "1"
45 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
46 ucidef_add_switch_vlan "switch0" "2" "5 6"
47 ;;
48
49 ap136-020 |\
50 ap135-020 |\
51 tl-wr1043nd-v2 |\
52 wzr-450hp2)
53 ucidef_set_interfaces_lan_wan "eth1" "eth0"
54 ucidef_add_switch "switch0" "1" "1"
55 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
56 ucidef_add_switch_vlan "switch0" "2" "5 6"
57 ;;
58
59 archer-c5 |\
60 archer-c7 |\
61 tl-wdr4900-v2)
62 ucidef_set_interfaces_lan_wan "eth1" "eth0"
63 ucidef_add_switch "switch0" "1" "1"
64 ucidef_add_switch_vlan "switch0" "1" "0 2 3 4 5"
65 ucidef_add_switch_vlan "switch0" "2" "1 6"
66 ;;
67
68 cpe510)
69 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
70 ucidef_add_switch "switch0" "1" "1"
71 ucidef_add_switch_vlan "switch0" "1" "0t 5"
72 ucidef_add_switch_vlan "switch0" "2" "0t 4"
73 ;;
74
75 db120 |\
76 rb-2011l | \
77 rb-2011uas |\
78 rb-2011uias |\
79 rb-2011uas-2hnd|\
80 rb-2011uias-2hnd)
81 ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2"
82 ucidef_add_switch "switch0" "1" "1"
83 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
84 ucidef_add_switch_vlan "switch0" "2" "0t 1"
85 ucidef_add_switch "switch1" "1" "1"
86 ucidef_add_switch_vlan "switch1" "1" "0 1 2 3 4 5"
87
88 case "$board" in
89 rb-2011uas* | rb-2011uias | rb-2011uias-2hnd)
90 ucidef_set_interface_raw "sfp" "eth0.3"
91 ucidef_add_switch_vlan "switch0" "3" "0t 6"
92 ;;
93 esac
94 ;;
95
96 dir-825-b1|\
97 tew-673gru)
98 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
99 ucidef_add_switch "switch0" "1" "1"
100 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
101 ;;
102
103 f9k1115v2)
104 ucidef_set_interfaces_lan_wan "eth1" "eth0"
105 ucidef_add_switch "switch0" "1" "1"
106 ucidef_add_switch_vlan "switch0" "1" "2 3 4 5 6"
107 ucidef_add_switch_vlan "switch0" "2" "0 1"
108 ;;
109
110 nbg460n_550n_550nh)
111 ucidef_set_interfaces_lan_wan "eth0" "eth1"
112 ucidef_add_switch "switch0" "1" "1"
113 ucidef_add_switch_vlan "switch0" "0" "0 1 2 3 5"
114 ;;
115
116 nbg6716)
117 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
118 ucidef_add_switch "switch0" "1" "1"
119 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
120 ucidef_add_switch_vlan "switch0" "2" "5 6"
121 ;;
122
123 rb-433 |\
124 rb-433u)
125 ucidef_set_interfaces_lan_wan "eth1" "eth0"
126 ucidef_add_switch "switch0" "1" "1"
127 ucidef_add_switch_vlan "switch0" "1" "1 2 5"
128 ;;
129
130 rb-435g)
131 ucidef_set_interfaces_lan_wan "eth1" "eth0"
132 ucidef_add_switch "switch0" "1" "1"
133 ucidef_add_switch_vlan "switch0" "1" "0 1 2"
134 ;;
135
136 rb-450)
137 ucidef_set_interfaces_lan_wan "eth1" "eth0"
138 ucidef_add_switch "switch0" "1" "1"
139 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5"
140 ;;
141
142 rb-450g |\
143 routerstation-pro)
144 ucidef_set_interfaces_lan_wan "eth1" "eth0"
145 ucidef_add_switch "switch0" "1" "1"
146 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
147 ;;
148
149 ap136 |\
150 rb-750gl |\
151 rb-751g |\
152 rb-951g-2hnd |\
153 wzr-hp-g450h)
154 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
155 ucidef_add_switch "switch0" "1" "1"
156 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
157 ucidef_add_switch_vlan "switch0" "2" "0t 1"
158 ;;
159
160 rb-951ui-2hnd)
161 ucidef_set_interfaces_lan_wan "eth1" "eth0"
162 ;;
163
164 rb-493g)
165 ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
166 ucidef_add_switch "switch0" "1" "1"
167 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
168 ucidef_add_switch "switch1" "1" "1"
169 ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
170 ucidef_add_switch_vlan "switch1" "2" "0t 5"
171 ;;
172
173 wzr-hp-g300nh2 |\
174 pb92 |\
175 ap113)
176 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
177 ucidef_add_switch "switch0" "1" "1"
178 ucidef_add_switch_vlan "switch0" "1" "0t 1 3 4 5"
179 ucidef_add_switch_vlan "switch0" "2" "0t 2"
180 ;;
181
182 el-m150)
183 ucidef_set_interfaces_lan_wan "eth1" "eth0"
184 ucidef_add_switch "switch0" "1" "1"
185 ucidef_add_switch_vlan "switch0" "1" "0 1 3"
186 ;;
187
188 tl-wdr4300|\
189 tl-wr1041n-v2)
190 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
191 ucidef_add_switch "switch0" "1" "1"
192 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
193 ucidef_add_switch_vlan "switch0" "2" "0t 1"
194 ;;
195
196 tl-wr1043nd)
197 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
198 ucidef_add_switch "switch0" "1" "1"
199 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t"
200 ucidef_add_switch_vlan "switch0" "2" "0 5t"
201 ;;
202
203 tl-wr2543n)
204 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
205 ucidef_add_switch "switch0" "1" "1"
206 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
207 ucidef_add_switch_vlan "switch0" "2" "0 9t"
208 ;;
209
210 tl-wr841n-v1|\
211 tl-wr941nd)
212 ucidef_set_interface_raw "eth" "eth0"
213 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
214 ;;
215
216 dir-615-i1 |\
217 r6100 |\
218 smart-300 |\
219 tl-mr3420-v2 |\
220 tl-wr841n-v8 |\
221 tl-wr842n-v2 |\
222 tl-wr941nd-v5 |\
223 wnr2000-v3 |\
224 wnr2000-v4 |\
225 wnr2200 |\
226 wnr612-v2 |\
227 wnr1000-v2)
228 ucidef_set_interfaces_lan_wan "eth1" "eth0"
229 ucidef_add_switch "switch0" "1" "1"
230 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
231 ;;
232
233 uap-pro)
234 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
235 ucidef_add_switch "switch0" "1" "1"
236 ucidef_add_switch_vlan "switch0" "1" "0t 1"
237 ucidef_add_switch_vlan "switch0" "2" "0t 2"
238 ;;
239
240 nanostation-m-xw)
241 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
242 ucidef_add_switch "switch0" "1" "1"
243 ucidef_add_switch_vlan "switch0" "1" "0t 5"
244 ucidef_add_switch_vlan "switch0" "2" "0t 1"
245 ;;
246
247 wrt160nl)
248 ucidef_set_interfaces_lan_wan "eth0" "eth1"
249 ucidef_add_switch "switch0" "1" "1"
250 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 5"
251 ;;
252
253 wzr-hp-g300nh)
254 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
255 ucidef_add_switch "switch0" "1" "1"
256 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
257 ;;
258
259 dgl-5500-a1 |\
260 dir-825-c1)
261 local mac
262 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
263 ucidef_add_switch "switch0" "1" "1"
264 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
265 ucidef_add_switch_vlan "switch0" "2" "0t 5"
266 mac=$(mtd_get_mac_ascii nvram "wan_mac")
267 [ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
268 ;;
269
270 mynet-n750)
271 local mac
272 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
273 ucidef_add_switch "switch0" "1" "1"
274 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
275 ucidef_add_switch_vlan "switch0" "2" "0t 5"
276 mac=$(mtd_get_mac_ascii devdata "wanmac")
277 [ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
278 ;;
279
280 dhp-1565-a1 |\
281 dir-835-a1 |\
282 wndr3700v4 | \
283 wndr4300)
284 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
285 ucidef_add_switch "switch0" "1" "1"
286 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
287 ucidef_add_switch_vlan "switch0" "2" "0t 5"
288 mac_lan=$(mtd_get_mac_binary caldata 0)
289 [ -n "$mac_lan" ] && ucidef_set_interface_macaddr "lan" "$mac_lan"
290 mac_wan=$(mtd_get_mac_binary caldata 6)
291 [ -n "$mac_wan" ] && ucidef_set_interface_macaddr "wan" "$mac_wan"
292 ;;
293
294 esr900)
295 local mac
296 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
297 ucidef_add_switch "switch0" "1" "1"
298 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
299 ucidef_add_switch_vlan "switch0" "2" "0t 5"
300 mac=$(mtd_get_mac_ascii u-boot-env "wanaddr")
301 [ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
302 ;;
303
304 dlan-pro-500-wp)
305 ucidef_set_interface_lan "eth0 eth1"
306 ;;
307
308 dlan-pro-1200-ac)
309 ucidef_set_interface_lan "eth0"
310 ucidef_add_switch "switch0" "1" "0"
311 ucidef_add_switch_vlan "switch0" "0" "0 2 3 4"
312 ;;
313
314 all0305 |\
315 aw-nr580 |\
316 bullet-m |\
317 cap4200ag |\
318 eap300v2 |\
319 eap7660d |\
320 el-mini |\
321 loco-m-xw |\
322 mr600 |\
323 mr600v2 |\
324 mr900 |\
325 mr900v2 |\
326 rb-411 |\
327 rb-911g-2hpnd |\
328 rb-911g-5hpacd |\
329 rb-911g-5hpnd |\
330 rb-912uag-2hpnd |\
331 rb-912uag-5hpnd |\
332 rb-sxt2n |\
333 rb-sxt5n |\
334 rocket-m-xw |\
335 tl-mr10u |\
336 tl-mr11u |\
337 tl-mr12u |\
338 tl-mr13u |\
339 tl-mr3020 |\
340 tl-mr3040 |\
341 tl-mr3040-v2 |\
342 tl-wa701nd-v2 |\
343 tl-wa7210n-v2 |\
344 tl-wa750re |\
345 tl-wa850re |\
346 tl-wa830re-v2 |\
347 tl-wa801nd-v2 |\
348 tl-wa901nd |\
349 tl-wa901nd-v2 |\
350 tl-wa901nd-v3 |\
351 tl-wr703n |\
352 tube2h |\
353 wndap360 |\
354 wap4410n |\
355 mynet-rext |\
356 wp543)
357 ucidef_set_interface_lan "eth0"
358 ;;
359
360 antminer-s1 |\
361 antminer-s3 |\
362 dir-505-a1)
363 ucidef_set_interface_lan "eth1"
364 ;;
365
366 alfa-ap96 |\
367 alfa-nx |\
368 ap83 |\
369 gl-inet |\
370 jwap003 |\
371 pb42 |\
372 pb44 |\
373 routerstation|\
374 tl-wr710n |\
375 tl-wr720n-v3|\
376 wpe72)
377 ucidef_set_interfaces_lan_wan "eth1" "eth0"
378 ;;
379
380 wpj344)
381 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
382 ucidef_add_switch "switch0" "1" "1"
383 ucidef_add_switch_vlan "switch0" "1" "0t 3"
384 ucidef_add_switch_vlan "switch0" "2" "0t 2"
385 ;;
386
387 wpj531)
388 ucidef_set_interfaces_lan_wan "eth0" "eth1"
389 ;;
390
391 wpj558)
392 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
393 ucidef_add_switch "switch0" "1" "1"
394 ucidef_add_switch_vlan "switch0" "1" "5 6t"
395 ucidef_add_switch_vlan "switch0" "2" "1 6t"
396 ;;
397
398 ap121 |\
399 ap121-mini |\
400 ap143 |\
401 ap96 |\
402 airrouter |\
403 dir-600-a1 |\
404 dir-615-c1 |\
405 dir-615-e1 |\
406 dir-615-e4 |\
407 hiwifi-hc6361 |\
408 ja76pf |\
409 mc-mac1200r|\
410 mynet-n600 |\
411 oolite |\
412 qihoo-c301 |\
413 rb-750 |\
414 rb-751 |\
415 tew-632brp |\
416 tew-712br |\
417 tl-mr3220 |\
418 tl-mr3220-v2 |\
419 tl-mr3420 |\
420 tl-wdr3500 |\
421 tl-wr741nd |\
422 tl-wr741nd-v4 |\
423 tl-wr841n-v7 |\
424 tl-wr841n-v9 |\
425 whr-g301n |\
426 whr-hp-g300n |\
427 whr-hp-gn |\
428 wzr-hp-ag300h)
429 ucidef_set_interfaces_lan_wan "eth0" "eth1"
430 ucidef_add_switch "switch0" "1" "1"
431 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
432 ;;
433
434 wzr-hp-g450h)
435 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
436 ucidef_add_switch "switch0" "1" "1"
437 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
438 ucidef_add_switch_vlan "switch0" "2" "0t 1"
439 ;;
440
441 ew-dorin)
442 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
443 ucidef_add_switch "switch0" "1" "1"
444 ucidef_add_switch_vlan "switch0" "1" "0t 1 2"
445 ucidef_add_switch_vlan "switch0" "2" "0t 3"
446 ;;
447
448 ew-dorin-router)
449 ucidef_set_interfaces_lan_wan "eth0" "eth1"
450 ucidef_add_switch "switch0" "1" "1"
451 ucidef_add_switch_vlan "switch0" "1" "0 2 3"
452 ;;
453
454 wndr3700)
455 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
456 ucidef_add_switch "switch0" "1" "1"
457 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
458 # Blinkrate: 0=43ms; 1=84ms; 2=120ms; 3=170ms; 4=340ms; 5=670ms
459 uci set network.@switch[-1].blinkrate='2'
460
461 ucidef_add_switch_port "switch0" "1"
462 # Port 1 controls the GREEN configuration of LEDs for
463 # the switch and the section does not correspond to a real
464 # switch port.
465 #
466 # 0=LED off; 1=Collision/FDX; 2=Link/activity; 3=1000 Mb/s;
467 # 4=100 Mb/s; 5=10 Mb/s; 6=1000 Mb/s+activity; 7=100 Mb/s+activity;
468 # 8=10 Mb/s+activity; 9=10/100 Mb/s+activity; 10: Fiber;
469 # 11: Fault; 12: Link/activity(tx); 13: Link/activity(rx);
470 # 14: Link (master); 15: separate register
471 uci set network.@switch_port[-1].led='6'
472
473 ucidef_add_switch_port "switch0" "2"
474 # Port 2 controls the ORANGE configuration of LEDs for
475 # the switch and the section does not correspond to a real
476 # switch port.
477 #
478 # See the key above for switch port 1 for the meaning of the
479 # 'led' setting below.
480 uci set network.@switch_port[-1].led='9'
481
482 ucidef_add_switch_port "switch0" "5"
483 # Port 5 controls the configuration of the WAN LED and the
484 # section does not correspond to a real switch port.
485 #
486 # To toggle the use of green or orange LEDs for the WAN port,
487 # see the LED setting for wndr3700:green:wan in /etc/config/system.
488 #
489 # See the key above for switch port 1 for the meaning of the
490 # 'led' setting below.
491 uci set network.@switch_port[-1].led='2'
492 ;;
493
494 *)
495 ucidef_set_interfaces_lan_wan "eth0" "eth1"
496 ;;
497 esac
498
499 uci commit network
500
501 exit 0