To define VLANs in /etc/config/network change (with a editor or UCI) the file like this:
#### VLAN configuration
config switch eth0
option vlan0 '0 1 2 5'
option vlan1 '3 5'
option vlan2 '4 5'
config interface vlan1
option ifname 'eth0.1'
option proto 'dhcp'
config interface vlan2
option ifname 'eth0.2'
option proto 'dhcp'
#### Loopback configuration
config interface loopback
option ifname "lo"
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
#### LAN configuration
config interface lan
option type bridge
option ifname "eth0.0"
option proto static
option ipaddr '192.168.178.3'
option netmask 255.255.255.0
option gateway '192.168.178.1'
option dns '192.168.178.1'
#### WAN configuration
#config interface wan
# option ifname "eth0.1"
# option proto 'none'
eth0.0 = vlan0, eth0.1 = vlan1, eth0.2 = vlan2 and so on. eth0 is the switch itself...
Once you changed the file you can bring up the new interfaces with 'ifup vlan1; ifup vlan2'.
This currently only works on routers with a Broadcom switch.
(Last edited by forum2006 on 31 Aug 2007, 09:00)