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"
33 ucidef_set_interfaces_lan_wan "eth0" "eth1"
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"
41 ucidef_set_interfaces_lan_wan "eth1" "eth0"
42 ucidef_add_switch "switch0" "1" "1"
43 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
44 ucidef_add_switch_vlan "switch0" "2" "5 6"
48 ucidef_set_interfaces_lan_wan "eth1" "eth0"
49 ucidef_add_switch "switch0" "1" "1"
50 ucidef_add_switch_vlan "switch0" "1" "0 2 3 4 5"
51 ucidef_add_switch_vlan "switch0" "2" "1 6"
58 ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2"
59 ucidef_add_switch "switch0" "1" "1"
60 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
61 ucidef_add_switch_vlan "switch0" "2" "0t 1"
62 ucidef_add_switch "switch1" "1" "1"
63 ucidef_add_switch_vlan "switch1" "1" "0 1 2 3 4 5"
67 ucidef_set_interface_raw "sfp" "eth0.3"
68 ucidef_add_switch_vlan "switch0" "3" "0t 6"
75 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
76 ucidef_add_switch "switch0" "1" "1"
77 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
81 ucidef_set_interfaces_lan_wan "eth0" "eth1"
82 ucidef_add_switch "switch0" "1" "1"
83 ucidef_add_switch_vlan "switch0" "0" "0 1 2 3 5"
88 ucidef_set_interfaces_lan_wan "eth1" "eth0"
89 ucidef_add_switch "switch0" "1" "1"
90 ucidef_add_switch_vlan "switch0" "1" "1 2 5"
94 ucidef_set_interfaces_lan_wan "eth1" "eth0"
95 ucidef_add_switch "switch0" "1" "1"
96 ucidef_add_switch_vlan "switch0" "1" "0 1 2"
100 ucidef_set_interfaces_lan_wan "eth1" "eth0"
101 ucidef_add_switch "switch0" "1" "1"
102 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5"
107 ucidef_set_interfaces_lan_wan "eth1" "eth0"
108 ucidef_add_switch "switch0" "1" "1"
109 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
117 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
118 ucidef_add_switch "switch0" "1" "1"
119 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
120 ucidef_add_switch_vlan "switch0" "2" "0t 1"
124 ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
125 ucidef_add_switch "switch0" "1" "1"
126 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
127 ucidef_add_switch "switch1" "1" "1"
128 ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
129 ucidef_add_switch_vlan "switch1" "2" "0t 5"
135 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
136 ucidef_add_switch "switch0" "1" "1"
137 ucidef_add_switch_vlan "switch0" "1" "0t 1 3 4 5"
138 ucidef_add_switch_vlan "switch0" "2" "0t 2"
143 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
144 ucidef_add_switch "switch0" "1" "1"
145 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
146 ucidef_add_switch_vlan "switch0" "2" "0t 1"
150 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
151 ucidef_add_switch "switch0" "1" "1"
152 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t"
153 ucidef_add_switch_vlan "switch0" "2" "0 5t"
157 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
158 ucidef_add_switch "switch0" "1" "1"
159 ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
160 ucidef_add_switch_vlan "switch0" "2" "0 9t"
165 ucidef_set_interface_raw "eth" "eth0"
166 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
174 ucidef_set_interfaces_lan_wan "eth1" "eth0"
175 ucidef_add_switch "switch0" "1" "1"
176 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
180 ucidef_set_interface_lan "eth0"
181 ucidef_add_switch "switch0" "1" "1"
182 ucidef_add_switch_vlan "switch0" "1" "0 1 2"
186 ucidef_set_interfaces_lan_wan "eth0" "eth1"
187 ucidef_add_switch "switch0" "1" "1"
188 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 5"
192 ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
193 ucidef_add_switch "switch0" "1" "1"
194 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
199 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
200 ucidef_add_switch "switch0" "1" "1"
201 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
202 ucidef_add_switch_vlan "switch0" "2" "0t 5"
203 mac=$(mtd_get_mac_ascii nvram "^wan_mac")
204 [ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
209 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
210 ucidef_add_switch "switch0" "1" "1"
211 ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
212 ucidef_add_switch_vlan "switch0" "2" "0t 5"
233 ucidef_set_interface_lan "eth0"
237 ucidef_set_interface_lan "eth1"
250 ucidef_set_interfaces_lan_wan "eth1" "eth0"
277 ucidef_set_interfaces_lan_wan "eth0" "eth1"
278 ucidef_add_switch "switch0" "1" "1"
279 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
283 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
284 ucidef_add_switch "switch0" "1" "1"
285 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
286 ucidef_add_switch_vlan "switch0" "2" "0t 1"
290 ucidef_set_interface_lan "eth0"
291 ucidef_add_switch "switch0" "1" "1"
292 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3"
296 ucidef_set_interfaces_lan_wan "eth0" "eth1"
297 ucidef_add_switch "switch0" "1" "1"
298 ucidef_add_switch_vlan "switch0" "1" "0 2 3"
302 ucidef_set_interfaces_lan_wan "eth0" "eth1"