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"
27 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
28 ucidef_add_switch
"switch0" "1" "1"
29 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
30 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"
43 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
44 ucidef_add_switch
"switch0" "1" "1"
45 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
46 ucidef_add_switch_vlan
"switch0" "2" "5 6"
50 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
51 ucidef_add_switch
"switch0" "1" "1"
52 ucidef_add_switch_vlan
"switch0" "1" "0 2 3 4 5"
53 ucidef_add_switch_vlan
"switch0" "2" "1 6"
60 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "eth0.2"
61 ucidef_add_switch
"switch0" "1" "1"
62 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
63 ucidef_add_switch_vlan
"switch0" "2" "0t 1"
64 ucidef_add_switch
"switch1" "1" "1"
65 ucidef_add_switch_vlan
"switch1" "1" "0 1 2 3 4 5"
69 ucidef_set_interface_raw
"sfp" "eth0.3"
70 ucidef_add_switch_vlan
"switch0" "3" "0t 6"
77 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
78 ucidef_add_switch
"switch0" "1" "1"
79 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 5t"
83 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
84 ucidef_add_switch
"switch0" "1" "1"
85 ucidef_add_switch_vlan
"switch0" "0" "0 1 2 3 5"
90 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
91 ucidef_add_switch
"switch0" "1" "1"
92 ucidef_add_switch_vlan
"switch0" "1" "1 2 5"
96 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
97 ucidef_add_switch
"switch0" "1" "1"
98 ucidef_add_switch_vlan
"switch0" "1" "0 1 2"
102 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
103 ucidef_add_switch
"switch0" "1" "1"
104 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 5"
109 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
110 ucidef_add_switch
"switch0" "1" "1"
111 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
119 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
120 ucidef_add_switch
"switch0" "1" "1"
121 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
122 ucidef_add_switch_vlan
"switch0" "2" "0t 1"
126 ucidef_set_interfaces_lan_wan
"eth0 eth1.1" "eth1.2"
127 ucidef_add_switch
"switch0" "1" "1"
128 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
129 ucidef_add_switch
"switch1" "1" "1"
130 ucidef_add_switch_vlan
"switch1" "1" "0t 1 2 3 4"
131 ucidef_add_switch_vlan
"switch1" "2" "0t 5"
137 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
138 ucidef_add_switch
"switch0" "1" "1"
139 ucidef_add_switch_vlan
"switch0" "1" "0t 1 3 4 5"
140 ucidef_add_switch_vlan
"switch0" "2" "0t 2"
145 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
146 ucidef_add_switch
"switch0" "1" "1"
147 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
148 ucidef_add_switch_vlan
"switch0" "2" "0t 1"
152 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
153 ucidef_add_switch
"switch0" "1" "1"
154 ucidef_add_switch_vlan
"switch0" "1" "1 2 3 4 5t"
155 ucidef_add_switch_vlan
"switch0" "2" "0 5t"
159 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
160 ucidef_add_switch
"switch0" "1" "1"
161 ucidef_add_switch_vlan
"switch0" "1" "1 2 3 4 9t"
162 ucidef_add_switch_vlan
"switch0" "2" "0 9t"
167 ucidef_set_interface_raw
"eth" "eth0"
168 ucidef_set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
177 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
178 ucidef_add_switch
"switch0" "1" "1"
179 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
183 ucidef_set_interface_lan
"eth0"
184 ucidef_add_switch
"switch0" "1" "1"
185 ucidef_add_switch_vlan
"switch0" "1" "0 1 2"
189 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
190 ucidef_add_switch
"switch0" "1" "1"
191 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4 5"
195 ucidef_set_interfaces_lan_wan
"eth0.1" "eth1"
196 ucidef_add_switch
"switch0" "1" "1"
197 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 5t"
202 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
203 ucidef_add_switch
"switch0" "1" "1"
204 ucidef_add_switch_vlan
"switch0" "1" "0t 1 2 3 4"
205 ucidef_add_switch_vlan
"switch0" "2" "0t 5"
206 mac
=$
(mtd_get_mac_ascii nvram
"^wan_mac")
207 [ -n "$mac" ] && ucidef_set_interface_macaddr
"wan" "$mac"
212 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
213 ucidef_add_switch
"switch0" "1" "1"
214 ucidef_add_switch_vlan
"switch0" "1" "0t 1 2 3 4"
215 ucidef_add_switch_vlan
"switch0" "2" "0t 5"
216 mac_lan
=$
(mtd_get_mac_binary caldata
0)
217 [ -n "$mac_lan" ] && ucidef_set_interface_macaddr
"lan" "$mac_lan"
218 mac_wan
=$
(mtd_get_mac_binary caldata
6)
219 [ -n "$mac_wan" ] && ucidef_set_interface_macaddr
"wan" "$mac_wan"
246 ucidef_set_interface_lan
"eth0"
250 ucidef_set_interface_lan
"eth1"
263 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
290 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
291 ucidef_add_switch
"switch0" "1" "1"
292 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 4"
296 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
297 ucidef_add_switch
"switch0" "1" "1"
298 ucidef_add_switch_vlan
"switch0" "1" "0t 2 3 4 5"
299 ucidef_add_switch_vlan
"switch0" "2" "0t 1"
303 ucidef_set_interface_lan
"eth0"
304 ucidef_add_switch
"switch0" "1" "1"
305 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3"
309 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
310 ucidef_add_switch
"switch0" "1" "1"
311 ucidef_add_switch_vlan
"switch0" "1" "0 2 3"
315 ucidef_set_interfaces_lan_wan
"eth0" "eth1"