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