Root/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
8touch /etc/config/network
9
10. /lib/functions/uci-defaults.sh
11. /lib/ar71xx.sh
12
13ucidef_set_interface_loopback
14
15board=$(ar71xx_board_name)
16
17case "$board" in
18all0315n |\
19all0258n |\
20ja76pf2|\
21ubnt-unifi-outdoor)
22    ucidef_set_interface_lan "eth0 eth1"
23    ;;
24
25ap136-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
32ap136-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
39db120 |\
40rb-2011l | \
41rb-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
50dir-825-b1|\
51tew-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
57nbg460n_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
63rb-433 |\
64rb-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
70rb-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
76rb-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
82rb-450g |\
83routerstation-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
89ap136 |\
90rb-750gl |\
91rb-751g |\
92wzr-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
99rb-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
108wzr-hp-g300nh2 |\
109pb92 |\
110ap113)
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
117tl-wdr4300|\
118tl-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
125tl-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
132tl-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
139tl-wr841n-v1|\
140tl-wr941nd)
141    ucidef_set_interface_raw "eth" "eth0"
142    ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
143    ;;
144
145tl-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
151uap-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
157wrt160nl)
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
163wzr-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
169wndr4300)
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
176all0305 |\
177aw-nr580 |\
178bullet-m |\
179cap4200ag |\
180eap7660d |\
181mr600 |\
182rb-411 |\
183tl-mr11u |\
184tl-mr3020 |\
185tl-mr3040 |\
186tl-wa901nd |\
187tl-wa901nd-v2 |\
188tl-wr703n |\
189wp543)
190    ucidef_set_interface_lan "eth0"
191    ;;
192
193alfa-ap96 |\
194alfa-nx |\
195ap83 |\
196jwap003 |\
197pb42 |\
198pb44 |\
199routerstation|\
200wpe72)
201    ucidef_set_interfaces_lan_wan "eth1" "eth0"
202    ;;
203
204ap121 |\
205ap121-mini |\
206ap96 |\
207airrouter |\
208dir-600-a1 |\
209dir-615-c1 |\
210dir-615-e4 |\
211ja76pf |\
212rb-750 |\
213rb-751 |\
214tew-632brp |\
215tew-712br |\
216tl-mr3220 |\
217tl-mr3220-v2 |\
218tl-mr3420 |\
219tl-wr741nd |\
220tl-wr741nd-v4 |\
221tl-wr841n-v7 |\
222whr-g301n |\
223whr-hp-g300n |\
224whr-hp-gn |\
225wzr-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
231wzr-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
238ew-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
244ew-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    ;;
253esac
254
255uci commit network
256
257exit 0
258

Archive Download this file



interactive