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