3 # Copyright (C) 2011 OpenWrt.org
6 [ -e /etc
/config
/network
] && exit 0
8 touch /etc
/config
/network
10 .
/lib
/functions
/uci-defaults.sh
13 ucidef_set_interface_loopback
15 board
=$
(ar71xx_board_name
)
22 ucidef_set_interface_lan
"eth0 eth1"
26 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
27 ucidef_add_switch
"switch0" "1" "1"
28 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
29 ucidef_add_switch_vlan
"switch0" "2" "0t 1"
34 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
35 ucidef_add_switch
"switch0" "1" "1"
36 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
37 ucidef_add_switch_vlan
"switch0" "2" "5 6"
42 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
43 ucidef_add_switch
"switch0" "1" "1"
44 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
45 ucidef_add_switch_vlan
"switch0" "2" "5 6"
49 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
50 ucidef_add_switch
"switch0" "1" "1"
51 ucidef_add_switch_vlan
"switch0" "1" "0 2 3 4 5"
52 ucidef_add_switch_vlan
"switch0" "2" "1 6"
59 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "eth0.2"
60 ucidef_add_switch
"switch0" "1" "1"
61 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
62 ucidef_add_switch_vlan
"switch0" "2" "0t 1"
63 ucidef_add_switch
"switch1" "1" "1"
64 ucidef_add_switch_vlan
"switch1" "1" "0 1 2 3 4 5"
68 ucidef_set_interface_raw
"sfp" "eth0.3"
69 ucidef_add_switch_vlan
"switch0" "3" "0t 6"
76 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
77 ucidef_add_switch
"switch0" "1" "1"
78 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 5t"
82 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
83 ucidef_add_switch
"switch0" "1" "1"
84 ucidef_add_switch_vlan
"switch0" "0" "0 1 2 3 5"
89 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
90 ucidef_add_switch
"switch0" "1" "1"
91 ucidef_add_switch_vlan
"switch0" "1" "1 2 5"
95 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
96 ucidef_add_switch
"switch0" "1" "1"
97 ucidef_add_switch_vlan
"switch0" "1" "0 1 2"
101 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
102 ucidef_add_switch
"switch0" "1" "1"
103 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 5"
108 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
109 ucidef_add_switch
"switch0" "1" "1"
110 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
118 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
119 ucidef_add_switch
"switch0" "1" "1"
120 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
121 ucidef_add_switch_vlan
"switch0" "2" "0t 1"
125 ucidef_set_interfaces_lan_wan
"eth0 eth1.1" "eth1.2"
126 ucidef_add_switch
"switch0" "1" "1"
127 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
128 ucidef_add_switch
"switch1" "1" "1"
129 ucidef_add_switch_vlan
"switch1" "1" "0t 1 2 3 4"
130 ucidef_add_switch_vlan
"switch1" "2" "0t 5"
136 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
137 ucidef_add_switch
"switch0" "1" "1"
138 ucidef_add_switch_vlan
"switch0" "1" "0t 1 3 4 5"
139 ucidef_add_switch_vlan
"switch0" "2" "0t 2"
144 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
145 ucidef_add_switch
"switch0" "1" "1"
146 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
147 ucidef_add_switch_vlan
"switch0" "2" "0t 1"
151 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
152 ucidef_add_switch
"switch0" "1" "1"
153 ucidef_add_switch_vlan
"switch0" "1" "1 2 3 4 5t"
154 ucidef_add_switch_vlan
"switch0" "2" "0 5t"
158 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
159 ucidef_add_switch
"switch0" "1" "1"
160 ucidef_add_switch_vlan
"switch0" "1" "1 2 3 4 9t"
161 ucidef_add_switch_vlan
"switch0" "2" "0 9t"
166 ucidef_set_interface_raw
"eth" "eth0"
167 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
175 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
176 ucidef_add_switch
"switch0" "1" "1"
177 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
181 ucidef_set_interface_lan
"eth0"
182 ucidef_add_switch
"switch0" "1" "1"
183 ucidef_add_switch_vlan
"switch0" "1" "0 1 2"
187 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
188 ucidef_add_switch
"switch0" "1" "1"
189 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4 5"
193 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
194 ucidef_add_switch
"switch0" "1" "1"
195 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 5t"
200 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
201 ucidef_add_switch
"switch0" "1" "1"
202 ucidef_add_switch_vlan
"switch0" "1" "0t 1 2 3 4"
203 ucidef_add_switch_vlan
"switch0" "2" "0t 5"
204 mac
=$
(mtd_get_mac_ascii nvram
"^wan_mac")
205 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
210 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
211 ucidef_add_switch
"switch0" "1" "1"
212 ucidef_add_switch_vlan
"switch0" "1" "0t 1 2 3 4"
213 ucidef_add_switch_vlan
"switch0" "2" "0t 5"
214 mac_lan
=$
(mtd_get_mac_binary caldata
0)
215 [ -n "$mac_lan" ] && ucidef_set_interface_macaddr
"lan" "$mac_lan"
216 mac_wan
=$
(mtd_get_mac_binary caldata
6)
217 [ -n "$mac_wan" ] && ucidef_set_interface_macaddr
"wan" "$mac_wan"
242 ucidef_set_interface_lan
"eth0"
246 ucidef_set_interface_lan
"eth1"
259 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
286 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
287 ucidef_add_switch
"switch0" "1" "1"
288 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
292 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
293 ucidef_add_switch
"switch0" "1" "1"
294 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
295 ucidef_add_switch_vlan
"switch0" "2" "0t 1"
299 ucidef_set_interface_lan
"eth0"
300 ucidef_add_switch
"switch0" "1" "1"
301 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3"
305 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
306 ucidef_add_switch
"switch0" "1" "1"
307 ucidef_add_switch_vlan
"switch0" "1" "0 2 3"
311 ucidef_set_interfaces_lan_wan
"eth0" "eth1"