ar71xx: add user space support for dir-825-c1
[openwrt/svn-archive/archive.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 dir-825-c1)
66 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
67 ucidef_add_switch "eth0" "1" "1"
68 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
69 ucidef_add_switch_vlan "eth0" "2" "0t 1"
70 ;;
71
72 nbg460n_550n_550nh)
73 ucidef_set_interfaces_lan_wan "eth0" "eth1"
74 ucidef_add_switch "rtl8366s" "1" "1"
75 ucidef_add_switch_vlan "rtl8366s" "0" "0 1 2 3 5"
76 ;;
77
78 rb-433 |\
79 rb-433u)
80 ucidef_set_interfaces_lan_wan "eth1" "eth0"
81 ucidef_add_switch "switch0" "1" "1"
82 ucidef_add_switch_vlan "switch0" "1" "1 2 5"
83 ;;
84
85 rb-435g)
86 ucidef_set_interfaces_lan_wan "eth1" "eth0"
87 ucidef_add_switch "switch0" "1" "1"
88 ucidef_add_switch_vlan "switch0" "1" "0 1 2"
89 ;;
90
91 rb-450)
92 ucidef_set_interfaces_lan_wan "eth1" "eth0"
93 ucidef_add_switch "eth1" "1" "1"
94 ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 5"
95 ;;
96
97 rb-450g |\
98 routerstation-pro)
99 ucidef_set_interfaces_lan_wan "eth1" "eth0"
100 ucidef_add_switch "switch0" "1" "1"
101 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
102 ;;
103
104 ap136 |\
105 rb-750gl |\
106 rb-751g |\
107 wzr-hp-g450h)
108 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
109 ucidef_add_switch "switch0" "1" "1"
110 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
111 ucidef_add_switch_vlan "switch0" "2" "0t 1"
112 ;;
113
114 rb-493g)
115 ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
116 ucidef_add_switch "switch0" "1" "1"
117 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
118 ucidef_add_switch "switch1" "1" "1"
119 ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
120 ucidef_add_switch_vlan "switch1" "2" "0t 5"
121 ;;
122
123 wzr-hp-g300nh2 |\
124 pb92 |\
125 ap113)
126 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
127 ucidef_add_switch "eth0" "1" "1"
128 ucidef_add_switch_vlan "eth0" "1" "0t 1 3 4 5"
129 ucidef_add_switch_vlan "eth0" "2" "0t 2"
130 ;;
131
132 tl-wdr4300|\
133 tl-wr1041n-v2)
134 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
135 ucidef_add_switch "eth0" "1" "1"
136 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
137 ucidef_add_switch_vlan "eth0" "2" "0t 1"
138 ;;
139
140 tl-wr1043nd)
141 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
142 ucidef_add_switch "rtl8366rb" "1" "1"
143 ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t"
144 ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t"
145 ;;
146
147 tl-wr2543n)
148 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
149 ucidef_add_switch "switch0" "1" "1"
150 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
151 ucidef_add_switch_vlan "switch0" "2" "0 9t"
152 ;;
153
154 tl-wr841n-v1|\
155 tl-wr941nd)
156 ucidef_set_interface_raw "eth" "eth0"
157 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
158 ;;
159
160 tl-wr841n-v8)
161 ucidef_set_interfaces_lan_wan "eth1" "eth0"
162 ucidef_add_switch "switch0" "1" "1"
163 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
164 ;;
165
166 uap-pro)
167 ucidef_set_interface_lan "eth0"
168 ucidef_add_switch "switch0" "1" "1"
169 ucidef_add_switch_vlan "switch0" "1" "0 1 2"
170 ;;
171
172 wrt160nl)
173 ucidef_set_interfaces_lan_wan "eth0" "eth1"
174 ucidef_add_switch "eth0" "1" "1"
175 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
176 ;;
177
178 wzr-hp-g300nh)
179 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
180 ucidef_add_switch "switch0" "1" "1"
181 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
182 ;;
183
184 wndr4300)
185 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
186 ucidef_add_switch "switch0" "1" "1"
187 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
188 ucidef_add_switch_vlan "switch0" "2" "0t 5"
189 ;;
190
191 all0305 |\
192 aw-nr580 |\
193 bullet-m |\
194 cap4200ag |\
195 eap7660d |\
196 mr600 |\
197 rb-411 |\
198 tl-mr11u |\
199 tl-mr3020 |\
200 tl-mr3040 |\
201 tl-wa901nd |\
202 tl-wa901nd-v2 |\
203 tl-wr703n |\
204 wp543)
205 ucidef_set_interface_lan "eth0"
206 ;;
207
208 alfa-ap96 |\
209 alfa-nx |\
210 ap83 |\
211 jwap003 |\
212 pb42 |\
213 pb44 |\
214 routerstation|\
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-wr741nd |\
235 tl-wr741nd-v4 |\
236 tl-wr841n-v7 |\
237 whr-g301n |\
238 whr-hp-g300n |\
239 whr-hp-gn |\
240 wzr-hp-ag300h)
241 ucidef_set_interfaces_lan_wan "eth0" "eth1"
242 ucidef_add_switch "eth0" "1" "1"
243 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
244 ;;
245
246 wzr-hp-g450h)
247 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
248 ucidef_add_switch "eth0" "1" "1"
249 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
250 ucidef_add_switch_vlan "eth0" "2" "0t 1"
251 ;;
252
253 ew-dorin)
254 ucidef_set_interface_lan "eth0"
255 ucidef_add_switch "eth0" "1" "1"
256 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3"
257 ;;
258
259 ew-dorin-router)
260 ucidef_set_interfaces_lan_wan "eth0" "eth1"
261 ucidef_add_switch "eth0" "1" "1"
262 ucidef_add_switch_vlan "eth0" "1" "0 2 3"
263 ;;
264
265 *)
266 ucidef_set_interfaces_lan_wan "eth0" "eth1"
267 ;;
268 esac
269
270 uci commit network
271
272 exit 0