- print "#### Loopback configuration"
- print "config interface loopback"
- print " option ifname \"lo\""
- print " option proto static"
- print " option ipaddr 127.0.0.1"
- print " option netmask 255.0.0.0"
- print ""
- print ""
- print "#### LAN configuration"
- print "config interface lan"
- print " option type bridge"
- p("ifname", "lan_ifname")
- p("macaddr", "lan_macaddr")
- print " option proto static"
- print " option ipaddr 192.168.1.1"
- print " option netmask 255.255.255.0"
- print ""
- print ""
- if (c["wan_ifname"]) {
- print "#### WAN configuration"
- print "config interface wan"
- p("ifname", "wan_ifname")
- p("macaddr", "wan_macaddr")
- print " option proto dhcp"
- } else {
- print "#### WAN configuration (disabled)"
- print "#config interface wan"
- print "# option proto dhcp"
+ [ -n "$vlan2ports" ] && {
+ cfg=`ucidef_add_switch_vlan "switch0" 2 "$vlan2ports"`
+ [ -n "$cfg" ] && uci rename network.$cfg=eth0_2