Trouble trying to configure 2 devices with VLAN

Hi guys,
I'm having trouble trying to configure 2 devices. It only happens when using VLAN.

ALL PC's can access ISP
PC1 can't access AP, PC2 or PC4
PC2 can't access PC1
PC3 can access all devices
PC4 can't access PC1

Related topic: Mouting AP with 2 openwrt routers bridged (DumbAP)

Mi Router 4A Gigabit - OpenWrt SNAPSHOT, r15668-d33cd383ed

root@router:~# cat /etc/config/network

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

config globals 'globals'
        option packet_steering '1'
        option ula_prefix 'fd86:5e9b:17d1::/48'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ifname 'lan1 lan2 wan.1'

config interface 'wan'
        option ifname 'wan.2'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        option gateway '192.168.2.254'
        list dns '192.168.2.254'

WR841N - OpenWrt 19.07.5, r11257-5090152ae3

root@ap:~# cat /etc/config/network

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

config globals 'globals'
        option ula_prefix 'fdc6:4858:6dc1::/48'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.1.2'
        option gateway '192.168.1.1'
        list dns '192.168.1.1'
        option ifname 'eth0.1 eth1'

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 4 3 2t'

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

Short stupid question: Why don't you just switch router and ap and behind the router continue with a lan zone ? Your landscape looks quite unusual...

ISP Router isn't in a good spot for wifi coverage and I'll replace the ap with a gigabit switch TL-SG105E soon.

There is no vlan config for your router. How should it now that you want to use the wan port with tagged vlans ? I would expect that you need to configure the switch inside your router like you did with the ap, add 2 vlans, mark the wan port as tagged. Maybe part of that comes out of the box, but the wan port by default is untagged, I would think. So probably in the ap you get wan from an untagged port, route it to a tagged port, from there to a tagged port on your router, and the lan connection from your router goes via the same tagged port back to your ap.

The router is running snapshot, so there's no switch config anymore, just DSA. I use wan.1 and wan.2 in the ifname option to define the vlan (the port name is just wan, without the .1 or .2).

So DSA nows that wan is a tagged port just because wa.1 and wan.2 are used ?

I would try out /evaluate 2 things:

  1. There is one cable between router wan and AP port 2, no hub, ... ?
  2. What happens, if you configure your routers lan2 to be the port with vlan (so put lan2.2 in interface wan, and lan2.1 in interface lan ) and change the cable to lan port 2 ?

In my understanding yes, with DSA we don't have switchs anymore, each port is a separeted interface (like wan@eth0 lan1@eth0 lan2@eth0).

When you use .1 ou .2 at ending of the interface, you are assigning that interface (as tagged) to the vlan id after the dot.

  1. Yes, there's only one cable.
  2. I'll try when I get home.

I changed the VLAN from the wan port to the lan port, but got the same results.

Then I am running out of ideas.

  • bringing the wan through your ap works
  • your pc3 can access all clients on the ap, and is visible to all of them
  • does pc1 see pc3 ?
  • please post the router wireless config - I assume the wifi-iface uses network lan

Hey man, I found out!!!!

All I had to do has enable vlan_filtering:

root@Router1:/# echo "1" > /sys/class/net/br-lan/bridge/vlan_filtering

Thanks anyways

Great! Still I do not understand, how with dsa one can distinguish between a tagged and an untagged port. But it looks like luci support for this has been provided:

I found it hard to understand too, but openwrt support is a WIP.

Maybe this post can help you undertand.

This topic was automatically closed 0 minutes after the last reply. New replies are no longer allowed.