ar71xx: add user-space support for the AP132 board
[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 "eth0" "1" "1"
52         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
53         ucidef_add_switch_vlan "eth0" "2" "0t 1"
54         ucidef_add_switch "eth1" "1" "1"
55         ucidef_add_switch_vlan "eth1" "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 "rtl8366s" "1" "1"
62         ucidef_add_switch_vlan "rtl8366s" "1" "0 1 2 3 5t"
63         ;;
64
65 nbg460n_550n_550nh)
66         ucidef_set_interfaces_lan_wan "eth0" "eth1"
67         ucidef_add_switch "rtl8366s" "1" "1"
68         ucidef_add_switch_vlan "rtl8366s" "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 "eth1" "1" "1"
87         ucidef_add_switch_vlan "eth1" "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 wzr-hp-g450h)
101         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
102         ucidef_add_switch "switch0" "1" "1"
103         ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
104         ucidef_add_switch_vlan "switch0" "2" "0t 1"
105         ;;
106
107 rb-493g)
108         ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
109         ucidef_add_switch "switch0" "1" "1"
110         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
111         ucidef_add_switch "switch1" "1" "1"
112         ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
113         ucidef_add_switch_vlan "switch1" "2" "0t 5"
114         ;;
115
116 wzr-hp-g300nh2 |\
117 pb92 |\
118 ap113)
119         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
120         ucidef_add_switch "eth0" "1" "1"
121         ucidef_add_switch_vlan "eth0" "1" "0t 1 3 4 5"
122         ucidef_add_switch_vlan "eth0" "2" "0t 2"
123         ;;
124
125 tl-wdr4300|\
126 tl-wr1041n-v2)
127         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
128         ucidef_add_switch "eth0" "1" "1"
129         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
130         ucidef_add_switch_vlan "eth0" "2" "0t 1"
131         ;;
132
133 tl-wr1043nd)
134         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
135         ucidef_add_switch "rtl8366rb" "1" "1"
136         ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t"
137         ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t"
138         ;;
139
140 tl-wr2543n)
141         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
142         ucidef_add_switch "switch0" "1" "1"
143         ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
144         ucidef_add_switch_vlan "switch0" "2" "0 9t"
145         ;;
146
147 tl-wr841n-v1|\
148 tl-wr941nd)
149         ucidef_set_interface_raw "eth" "eth0"
150         ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
151         ;;
152
153 tl-wr841n-v8)
154         ucidef_set_interfaces_lan_wan "eth1" "eth0"
155         ucidef_add_switch "switch0" "1" "1"
156         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
157         ;;
158
159 uap-pro)
160         ucidef_set_interface_lan "eth0"
161         ucidef_add_switch "switch0" "1" "1"
162         ucidef_add_switch_vlan "switch0" "1" "0 1 2"
163         ;;
164
165 wrt160nl)
166         ucidef_set_interfaces_lan_wan "eth0" "eth1"
167         ucidef_add_switch "eth0" "1" "1"
168         ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
169         ;;
170
171 wzr-hp-g300nh)
172         ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
173         ucidef_add_switch "switch0" "1" "1"
174         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
175         ;;
176
177 wndr4300)
178         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
179         ucidef_add_switch "switch0" "1" "1"
180         ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
181         ucidef_add_switch_vlan "switch0" "2" "0t 5"
182         ;;
183
184 all0305 |\
185 aw-nr580 |\
186 bullet-m |\
187 cap4200ag |\
188 eap7660d |\
189 mr600 |\
190 rb-411 |\
191 tl-mr11u |\
192 tl-mr3020 |\
193 tl-mr3040 |\
194 tl-wa901nd |\
195 tl-wa901nd-v2 |\
196 tl-wr703n |\
197 wp543)
198         ucidef_set_interface_lan "eth0"
199         ;;
200
201 alfa-ap96 |\
202 alfa-nx |\
203 ap83 |\
204 jwap003 |\
205 pb42 |\
206 pb44 |\
207 routerstation|\
208 wpe72)
209         ucidef_set_interfaces_lan_wan "eth1" "eth0"
210         ;;
211
212 ap121 |\
213 ap121-mini |\
214 ap96 |\
215 airrouter |\
216 dir-600-a1 |\
217 dir-615-c1 |\
218 dir-615-e4 |\
219 ja76pf |\
220 rb-750 |\
221 rb-751 |\
222 tew-632brp |\
223 tew-712br |\
224 tl-mr3220 |\
225 tl-mr3220-v2 |\
226 tl-mr3420 |\
227 tl-wr741nd |\
228 tl-wr741nd-v4 |\
229 tl-wr841n-v7 |\
230 whr-g301n |\
231 whr-hp-g300n |\
232 whr-hp-gn |\
233 wzr-hp-ag300h)
234         ucidef_set_interfaces_lan_wan "eth0" "eth1"
235         ucidef_add_switch "eth0" "1" "1"
236         ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
237         ;;
238
239 wzr-hp-g450h)
240         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
241         ucidef_add_switch "eth0" "1" "1"
242         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
243         ucidef_add_switch_vlan "eth0" "2" "0t 1"
244         ;;
245
246 ew-dorin)
247         ucidef_set_interface_lan "eth0"
248         ucidef_add_switch "eth0" "1" "1"
249         ucidef_add_switch_vlan "eth0" "1" "0 1 2 3"
250         ;;
251
252 ew-dorin-router)
253         ucidef_set_interfaces_lan_wan "eth0" "eth1"
254         ucidef_add_switch "eth0" "1" "1"
255         ucidef_add_switch_vlan "eth0" "1" "0 2 3"
256         ;;
257
258 *)
259         ucidef_set_interfaces_lan_wan "eth0" "eth1"
260         ;;
261 esac
262
263 uci commit network
264
265 exit 0