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