7d825d7a10cb4b1bf66d9594718f55c2fa95f9d6
[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 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 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 "switch0" "1" "1"
121 ucidef_add_switch_vlan "switch0" "1" "0t 1 3 4 5"
122 ucidef_add_switch_vlan "switch0" "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 "switch0" "1" "1"
129 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
130 ucidef_add_switch_vlan "switch0" "2" "0t 1"
131 ;;
132
133 tl-wr1043nd)
134 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
135 ucidef_add_switch "switch0" "1" "1"
136 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t"
137 ucidef_add_switch_vlan "switch0" "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 "switch0" "1" "1"
168 ucidef_add_switch_vlan "switch0" "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 dir-825-c1|\
178 wndr4300)
179 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
180 ucidef_add_switch "switch0" "1" "1"
181 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
182 ucidef_add_switch_vlan "switch0" "2" "0t 5"
183 ;;
184
185 all0305 |\
186 aw-nr580 |\
187 bullet-m |\
188 cap4200ag |\
189 eap7660d |\
190 mr600 |\
191 mr600v2 |\
192 rb-411 |\
193 tl-mr11u |\
194 tl-mr3020 |\
195 tl-mr3040 |\
196 tl-wa901nd |\
197 tl-wa901nd-v2 |\
198 tl-wr703n |\
199 wp543)
200 ucidef_set_interface_lan "eth0"
201 ;;
202
203 alfa-ap96 |\
204 alfa-nx |\
205 ap83 |\
206 jwap003 |\
207 pb42 |\
208 pb44 |\
209 routerstation|\
210 wpe72)
211 ucidef_set_interfaces_lan_wan "eth1" "eth0"
212 ;;
213
214 ap121 |\
215 ap121-mini |\
216 ap96 |\
217 airrouter |\
218 dir-600-a1 |\
219 dir-615-c1 |\
220 dir-615-e4 |\
221 ja76pf |\
222 rb-750 |\
223 rb-751 |\
224 tew-632brp |\
225 tew-712br |\
226 tl-mr3220 |\
227 tl-mr3220-v2 |\
228 tl-mr3420 |\
229 tl-wr741nd |\
230 tl-wr741nd-v4 |\
231 tl-wr841n-v7 |\
232 whr-g301n |\
233 whr-hp-g300n |\
234 whr-hp-gn |\
235 wzr-hp-ag300h)
236 ucidef_set_interfaces_lan_wan "eth0" "eth1"
237 ucidef_add_switch "switch0" "1" "1"
238 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
239 ;;
240
241 wzr-hp-g450h)
242 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
243 ucidef_add_switch "switch0" "1" "1"
244 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
245 ucidef_add_switch_vlan "switch0" "2" "0t 1"
246 ;;
247
248 ew-dorin)
249 ucidef_set_interface_lan "eth0"
250 ucidef_add_switch "switch0" "1" "1"
251 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3"
252 ;;
253
254 ew-dorin-router)
255 ucidef_set_interfaces_lan_wan "eth0" "eth1"
256 ucidef_add_switch "switch0" "1" "1"
257 ucidef_add_switch_vlan "switch0" "1" "0 2 3"
258 ;;
259
260 *)
261 ucidef_set_interfaces_lan_wan "eth0" "eth1"
262 ;;
263 esac
264
265 uci commit network
266
267 exit 0