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