Ar71xx switch VLAN?

Greetings,

I'm running 18.06.2 on TP-Link TL-WR841N (ar71xx chipset) and I can get additional VLANs to work. No matter if I use LuCI or edit /etc/config/network, no new VLAN interfaces are coming up.
By default it has eth1.1 where all 4 ports are added as untagged. I've tried this thing:

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option vid '1'
        option ports '0t 1 2 4'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option vid '2'
        option ports '3'

And swconfig dev switch0 show:

...
Port 3:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 2
        link: port:3 link:down
Port 4:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 1
        link: port:4 link:down
VLAN 0:
        vid: 0
        ports: 0t 
VLAN 1:
        vid: 1
        ports: 0t 1 2 4 
VLAN 2:
        vid: 2
        ports: 3 

I still can see only eth1.1 interface. If I connect device to that port I can't ping it. Seems like it's really attached to a VLAN ID 2, but I can't bring any interface on that VLAN.
8021q config options doesn't works either.

ls -l /sys/class/net
lrwxrwxrwx    1 root     root             0 Jul 12 16:09 br-lan -> ../../devices/virtual/net/br-lan
lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth0 -> ../../devices/platform/ag71xx.0/net/eth0
lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth1 -> ../../devices/platform/ag71xx.1/net/eth1
lrwxrwxrwx    1 root     root             0 Jul 12 16:09 eth1.1 -> ../../devices/virtual/net/eth1.1
lrwxrwxrwx    1 root     root             0 Jan  1  1970 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx    1 root     root             0 Jul 12 16:18 tap0 -> ../../devices/virtual/net/tap0
lrwxrwxrwx    1 root     root             0 Jul 12 16:18 wlan0 -> ../../devices/platform/ar934x_wmac/net/wlan0

Does that means that this switch chip aren't VLAN enabled or am I missing some package?

If you want vid 2 vlan, you need to add there the CPU port. Without CPU port it is invisible.
option ports '0t 3'

And interfaces don't "come up" when you add vlans, you need to define e.g. eth1.2

4 Likes

@NStorm were you able to make it work ?
I have a WR841N v8 with a similar issue (it worked before, with an older openwrt release, using the same config).

@hmronline, Sorry, I was busy and didn't had time to check it out after @Pilot6 reply. Might check it soon, will reply here with results.