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