ar71xx: add user-space support for WNR2000v3
[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 wnr2000-v3)
157         ucidef_set_interfaces_lan_wan "eth1" "eth0"
158         ucidef_add_switch "switch0" "1" "1"
159         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
160         ;;
161
162 uap-pro)
163         ucidef_set_interface_lan "eth0"
164         ucidef_add_switch "switch0" "1" "1"
165         ucidef_add_switch_vlan "switch0" "1" "0 1 2"
166         ;;
167
168 wrt160nl)
169         ucidef_set_interfaces_lan_wan "eth0" "eth1"
170         ucidef_add_switch "switch0" "1" "1"
171         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 5"
172         ;;
173
174 wzr-hp-g300nh)
175         ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
176         ucidef_add_switch "switch0" "1" "1"
177         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
178         ;;
179
180 dir-825-c1 |\
181 dir-835-a1 |\
182 wndr4300)
183         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
184         ucidef_add_switch "switch0" "1" "1"
185         ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
186         ucidef_add_switch_vlan "switch0" "2" "0t 5"
187         ;;
188
189 all0305 |\
190 aw-nr580 |\
191 bullet-m |\
192 cap4200ag |\
193 eap7660d |\
194 mr600 |\
195 mr600v2 |\
196 rb-411 |\
197 tl-mr11u |\
198 tl-mr3020 |\
199 tl-mr3040 |\
200 tl-wa901nd |\
201 tl-wa901nd-v2 |\
202 tl-wr703n |\
203 wp543)
204         ucidef_set_interface_lan "eth0"
205         ;;
206
207 alfa-ap96 |\
208 alfa-nx |\
209 ap83 |\
210 jwap003 |\
211 pb42 |\
212 pb44 |\
213 routerstation|\
214 tl-wr720n-v3|\
215 wpe72)
216         ucidef_set_interfaces_lan_wan "eth1" "eth0"
217         ;;
218
219 ap121 |\
220 ap121-mini |\
221 ap96 |\
222 airrouter |\
223 dir-600-a1 |\
224 dir-615-c1 |\
225 dir-615-e4 |\
226 ja76pf |\
227 rb-750 |\
228 rb-751 |\
229 tew-632brp |\
230 tew-712br |\
231 tl-mr3220 |\
232 tl-mr3220-v2 |\
233 tl-mr3420 |\
234 tl-wdr3500 |\
235 tl-wr741nd |\
236 tl-wr741nd-v4 |\
237 tl-wr841n-v7 |\
238 whr-g301n |\
239 whr-hp-g300n |\
240 whr-hp-gn |\
241 wzr-hp-ag300h)
242         ucidef_set_interfaces_lan_wan "eth0" "eth1"
243         ucidef_add_switch "switch0" "1" "1"
244         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
245         ;;
246
247 wzr-hp-g450h)
248         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
249         ucidef_add_switch "switch0" "1" "1"
250         ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
251         ucidef_add_switch_vlan "switch0" "2" "0t 1"
252         ;;
253
254 ew-dorin)
255         ucidef_set_interface_lan "eth0"
256         ucidef_add_switch "switch0" "1" "1"
257         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3"
258         ;;
259
260 ew-dorin-router)
261         ucidef_set_interfaces_lan_wan "eth0" "eth1"
262         ucidef_add_switch "switch0" "1" "1"
263         ucidef_add_switch_vlan "switch0" "1" "0 2 3"
264         ;;
265
266 *)
267         ucidef_set_interfaces_lan_wan "eth0" "eth1"
268         ;;
269 esac
270
271 uci commit network
272
273 exit 0