c118e5edf4
This allows IPv6 to set up without IPv4 being up thus IPv6-only or IPv6+DS-Lite working with the default config. Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 42848
53 lines
951 B
Text
53 lines
951 B
Text
config_simple() {
|
|
cat >> /etc/config/network <<EOF
|
|
config interface lan
|
|
option ifname eth0
|
|
option type bridge
|
|
option proto static
|
|
option ipaddr 192.168.1.1
|
|
option netmask 255.255.255.0
|
|
option ip6assign 60
|
|
EOF
|
|
}
|
|
|
|
config_dsa() {
|
|
cat >> /etc/config/network <<EOF
|
|
config interface eth0
|
|
option ifname eth0
|
|
|
|
config interface wan
|
|
option ifname wan
|
|
option proto dhcp
|
|
option hostname openwrt
|
|
|
|
config interface lan
|
|
option ifname "lan1 lan2 lan3 lan4"
|
|
option type bridge
|
|
option proto static
|
|
option ipaddr 192.168.1.1
|
|
option netmask 255.255.255.0
|
|
option ip6assign 60
|
|
|
|
config interface wan6
|
|
option ifname wan
|
|
option proto dhcpv6
|
|
|
|
config globals globals
|
|
option ula_prefix auto
|
|
EOF
|
|
}
|
|
|
|
cat > /etc/config/network <<EOF
|
|
config interface loopback
|
|
option ifname lo
|
|
option proto static
|
|
option ipaddr 127.0.0.1
|
|
option netmask 255.0.0.0
|
|
|
|
EOF
|
|
|
|
if grep -q lan /proc/net/dev; then
|
|
config_dsa
|
|
else
|
|
config_simple
|
|
fi
|