f47458550130b284f3da10a162b167f219647d97
[openwrt/staging/yousong.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 wrt160nl)
138 ucidef_set_interfaces_lan_wan "eth0" "eth1"
139 ucidef_add_switch "eth0" "1" "1"
140 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
141 ;;
142
143 wzr-hp-g300nh)
144 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
145 ucidef_add_switch "switch0" "1" "1"
146 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
147 ;;
148
149 wndr4300)
150 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
151 ucidef_add_switch "switch0" "1" "1"
152 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
153 ucidef_add_switch_vlan "switch0" "2" "0t 5"
154 ;;
155
156 all0305 |\
157 aw-nr580 |\
158 bullet-m |\
159 cap4200ag |\
160 eap7660d |\
161 mr600 |\
162 rb-411 |\
163 tl-mr11u |\
164 tl-mr3020 |\
165 tl-mr3040 |\
166 tl-wa901nd |\
167 tl-wa901nd-v2 |\
168 tl-wr703n |\
169 wp543)
170 ucidef_set_interface_lan "eth0"
171 ;;
172
173 alfa-ap96 |\
174 alfa-nx |\
175 ap83 |\
176 jwap003 |\
177 pb42 |\
178 pb44 |\
179 routerstation|\
180 wpe72)
181 ucidef_set_interfaces_lan_wan "eth1" "eth0"
182 ;;
183
184 ap121 |\
185 ap121-mini |\
186 ap96 |\
187 airrouter |\
188 dir-600-a1 |\
189 dir-615-c1 |\
190 dir-615-e4 |\
191 ja76pf |\
192 rb-750 |\
193 rb-751 |\
194 tew-632brp |\
195 tew-712br |\
196 tl-mr3220 |\
197 tl-mr3420 |\
198 tl-wr741nd |\
199 tl-wr741nd-v4 |\
200 tl-wr841n-v7 |\
201 whr-g301n |\
202 whr-hp-g300n |\
203 whr-hp-gn |\
204 wzr-hp-ag300h)
205 ucidef_set_interfaces_lan_wan "eth0" "eth1"
206 ucidef_add_switch "eth0" "1" "1"
207 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
208 ;;
209
210 wzr-hp-g450h)
211 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
212 ucidef_add_switch "eth0" "1" "1"
213 ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
214 ucidef_add_switch_vlan "eth0" "2" "0t 1"
215 ;;
216
217 ew-dorin)
218 ucidef_set_interface_lan "eth0"
219 ucidef_add_switch "eth0" "1" "1"
220 ucidef_add_switch_vlan "eth0" "1" "0 1 2 3"
221 ;;
222
223 ew-dorin-router)
224 ucidef_set_interfaces_lan_wan "eth0" "eth1"
225 ucidef_add_switch "eth0" "1" "1"
226 ucidef_add_switch_vlan "eth0" "1" "0 2 3"
227 ;;
228
229 *)
230 ucidef_set_interfaces_lan_wan "eth0" "eth1"
231 ;;
232 esac
233
234 uci commit network
235
236 exit 0