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

Archive Download this file



interactive