[luci] Problem setting VLANs on the WRT54GL switch

Fred Boiteux fblistes at free.fr
Mon Oct 10 22:57:40 CEST 2011


	Hello,

  I tried to use VLAN tagging on a WRT54GL to test a configuration with
a switch with VLANS, to let a system with a unique Ethernet
interface to access different networks/hosts.

  Here is my setup :

           +----------+
           | System A |
           +----------+
                 |
         +-------|--------------------------------------+
         |       |                         WRT54GL      |
         |     +---+   +---+   +---+   +---+   +---+    |
         |     | i |   | 1 |   | 2 |   | 3 |   | 4 |-------- Admin
         |     +---+   +---+   +---+   +---+   +---+    |
         |               |       |       |              |
         +---------------|-------|-------|--------------+
                         |       |       |
                  +--------+     |   +--------+
                  | host 1 |     |   | host 3 |
                  +--------+     |   +--------+
                                 |
                            +--------+
                            | host 2 |
                            +--------+

The System A is plugged in the "Internet" interface ; It can talk to
three hosts with VLAN tagged trafic (VLAN 5, 10 and 15).
The three hosts are each one on a different VLAN, but aren't aware of
this : each port 1, 2 and 3 is set to VLAN 5, 10 and 15, untagged.
Finally, the 4rth port is using VLAN 0 (no tag) for admin.

I've put on the WRT54GL an OpenWRT Backfire 10.03.1-rc5. and used the
Luci's menu Network->Switch to configure it, as in the attached
picture :
- Port1 is internet port (with 3 VLANs 5, 10, 15 tagged, 0 untagged to
  be accessible from admin port)
- Port2 is labelled 1 and go to host1 (VLAN5)
- Port3 is labelled 2 and go to host2 (VLAN10)
- Port4 is labelled 3 and go to host3 (VLAN15)
- Port5 is labelled 4 and is the admin port (VLAN0 = no tag).

With this setup, my SystemA was unable to contact any of the 3
hosts :-( As it was my fist VLAN setup on this kind of hardware (and
not so much experience in VLANs anyway), I looked around where was my
error, until I found that something was missing in the OpenWRT setup :

the settings in /proc/switch/eth0/vlan/*/ports was wrong : I got :

# cat /proc/switch/eth0/vlan/0/ports
0       4       5t*
and all other vlan's ports files were empty !


I bring this setup in a working state by adding these script lines :

echo '0t 1 5t*' > /proc/switch/eth0/vlan/5/ports
echo '0t 2 5t*' > /proc/switch/eth0/vlan/10/ports
echo '0t 3 5t*' > /proc/switch/eth0/vlan/15/ports


For reference, the /etc/config/network is containing :

config 'switch' 'eth0'

config 'switch_vlan' 'eth0_0'
        option 'device' 'eth0'
        option 'vlan' '0'
        option 'ports' '0 4 5t'

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'

config 'interface' 'lan'
        option 'type' 'bridge'
        option 'ifname' 'eth0.0'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'

config 'switch_vlan'
        option 'vlan' '5'
        option 'ports' '0t 1 5t'

config 'switch_vlan'
        option 'vlan' '10'
        option 'ports' '0t 2 5t'

config 'switch_vlan'
        option 'vlan' '15'
        option 'ports' '0t 3 5t'

config 'interface' 'vlan5'
        option 'proto' 'none'
        option 'ifname' 'eth0.5'

config 'interface' 'vlan10'
        option 'proto' 'none'
        option 'ifname' 'eth0.10'

config 'interface' 'vlan15'
        option 'proto' 'none'
        option 'ifname' 'eth0.15'


  I'm not sure if the problem is in Luci nor in OpenWRT core. If you
need more info, please tell me.

    regards,
	Fred.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture-OpenWrt - Switch - LuCI - Iceweasel.png
Type: image/png
Size: 45326 bytes
Desc: not available
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20111010/2647f934/attachment-0001.png>


More information about the luci mailing list