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