3 # Copyright (C) 2011 OpenWrt.org
6 set_interface_loopback
() {
8 set network.loopback='interface'
9 set network.loopback.ifname='lo'
10 set network.loopback.proto='static'
11 set network.loopback.ipaddr='127.0.0.1'
12 set network.loopback.netmask='255.0.0.0'
21 set network.$cfg='interface'
22 set network.$cfg.ifname='$ifname'
23 set network.$cfg.proto='none'
31 set network.lan='interface'
32 set network.lan.ifname='$ifname'
33 set network.lan.type='bridge'
34 set network.lan.proto='static'
35 set network.lan.ipaddr='192.168.1.1'
36 set network.lan.netmask='255.255.255.0'
44 set network.wan='interface'
45 set network.wan.ifname='$ifname'
46 set network.wan.proto='dhcp'
50 set_interfaces_lan_wan
() {
54 set_interface_lan
"$lan_ifname"
55 set_interface_wan
"$wan_ifname"
64 set network.@switch[-1].name='$name'
65 set network.@switch[-1].reset='$reset'
66 set network.@switch[-1].enable_vlan='$enable'
75 add network switch_vlan
76 set network.@switch_vlan[-1].device='$device'
77 set network.@switch_vlan[-1].vlan='$vlan'
78 set network.@switch_vlan[-1].ports='$ports'
82 [ -e /etc
/config
/network
] && exit 0
84 touch /etc
/config
/network
86 set_interface_loopback
90 board
=$
(ar71xx_board_name
)
94 set_interface_lan
"eth0 eth1"
98 set_interfaces_lan_wan
"eth0.1" "eth1"
99 add_switch
"rtl8366s" "1" "1"
100 add_switch_vlan
"rtl8366s" "1" "0 1 2 3 5t"
104 set_interfaces_lan_wan
"eth0" "eth1"
105 add_switch
"rtl8366s" "1" "1"
106 add_switch_vlan
"rtl8366s" "0" "0 1 2 3 5"
111 set_interfaces_lan_wan
"eth1" "eth0"
112 add_switch
"switch0" "1" "1"
113 add_switch_vlan
"switch0" "1" "1 2 5"
117 set_interfaces_lan_wan
"eth1" "eth0"
118 add_switch
"eth1" "1" "1"
119 add_switch_vlan
"eth1" "1" "0 1 2 3 5"
124 set_interfaces_lan_wan
"eth1" "eth0"
125 add_switch
"switch0" "1" "1"
126 add_switch_vlan
"switch0" "1" "0 1 2 3 4"
130 set_interfaces_lan_wan
"eth0 eth1.1" "eth1.2"
131 add_switch
"switch0" "1" "1"
132 add_switch_vlan
"switch0" "1" "0 1 2 3 4"
133 add_switch
"switch1" "1" "1"
134 add_switch_vlan
"switch1" "1" "0t 1 2 3 4"
135 add_switch_vlan
"switch1" "2" "0t 5"
139 set_interfaces_lan_wan
"eth0.1" "eth0.2"
140 add_switch
"eth0" "1" "1"
141 add_switch_vlan
"eth0" "1" "0t 1 3 4 5"
142 add_switch_vlan
"eth0" "2" "0t 2"
146 set_interface_raw
"eth" "eth0"
147 set_interface_lan
"lan"
151 set_interfaces_lan_wan
"eth0.1" "eth0.2"
152 add_switch
"rtl8366rb" "1" "1"
153 add_switch_vlan
"rtl8366rb" "1" "1 2 3 4 5t"
154 add_switch_vlan
"rtl8366rb" "2" "0 5t"
159 set_interface_raw
"eth" "eth0"
160 set_interfaces_lan_wan
"lan1 lan2 lan3 lan4" "wan"
164 set_interfaces_lan_wan
"eth0" "eth1"
165 add_switch
"eth0" "1" "1"
166 add_switch_vlan
"eth0" "1" "0 1 2 3 4 5"
170 set_interfaces_lan_wan
"eth0.1" "eth1"
171 add_switch
"switch0" "1" "1"
172 add_switch_vlan
"switch0" "1" "0 1 2 3 5t"
182 set_interface_lan
"eth0"
190 set_interfaces_lan_wan
"eth1" "eth0"
209 set_interfaces_lan_wan
"eth0" "eth1"
210 add_switch
"eth0" "1" "1"
211 add_switch_vlan
"eth0" "1" "0 1 2 3 4"
215 set_interfaces_lan_wan
"eth0" "eth1"
This page took 0.048821 seconds and 5 git commands to generate.