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"
176 ucidef_set_interfaces_lan_wan "eth1" "eth0"
177 ucidef_add_switch "switch0" "1" "1"
178 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
182 ucidef_set_interface_lan "eth0"
183 ucidef_add_switch "switch0" "1" "1"
184 ucidef_add_switch_vlan "switch0" "1" "0 1 2"
188 ucidef_set_interfaces_lan_wan "eth0" "eth1"
189 ucidef_add_switch "switch0" "1" "1"
190 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 5"
194 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
195 ucidef_add_switch "switch0" "1" "1"
196 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
201 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
202 ucidef_add_switch "switch0" "1" "1"
203 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
204 ucidef_add_switch_vlan "switch0" "2" "0t 5"
205 mac=$(mtd_get_mac_ascii nvram "^wan_mac")
206 [ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
211 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
212 ucidef_add_switch "switch0" "1" "1"
213 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
214 ucidef_add_switch_vlan "switch0" "2" "0t 5"
215 mac_lan=$(mtd_get_mac_binary caldata 0)
216 [ -n "$mac_lan" ] && ucidef_set_interface_macaddr "lan" "$mac_lan"
217 mac_wan=$(mtd_get_mac_binary caldata 6)
218 [ -n "$mac_wan" ] && ucidef_set_interface_macaddr "wan" "$mac_wan"
243 ucidef_set_interface_lan "eth0"
247 ucidef_set_interface_lan "eth1"
260 ucidef_set_interfaces_lan_wan "eth1" "eth0"
287 ucidef_set_interfaces_lan_wan "eth0" "eth1"
288 ucidef_add_switch "switch0" "1" "1"
289 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
293 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
294 ucidef_add_switch "switch0" "1" "1"
295 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
296 ucidef_add_switch_vlan "switch0" "2" "0t 1"
300 ucidef_set_interface_lan "eth0"
301 ucidef_add_switch "switch0" "1" "1"
302 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3"
306 ucidef_set_interfaces_lan_wan "eth0" "eth1"
307 ucidef_add_switch "switch0" "1" "1"
308 ucidef_add_switch_vlan "switch0" "1" "0 2 3"
312 ucidef_set_interfaces_lan_wan "eth0" "eth1"