How to set up a separate wifi SSID with VLAN on OpenWrt?

If you cannot avoid the intermediate unmanaged switches, connect the dumbAP directly on the Mikrotik router to verify that the behavior is the same.

Everything seems to be tagged on vlan 1. It doesn't agree with the network configuration you have.

Like that vlan1 will be tagged too.
Maybe it is some leftover from previous testing and network has not been restarted?

Yep, brought up a tiny lab with just Mikrotik and OpenWrt. The same.

I have no idea, this is what I see (even tried powering off and on OpenWrt AP). What do I need to change?

Before changing anything, verify that it indeed sends tagged frames on vlan 1 by capturing the packets with wireshark or tcpdump.

Tried Mikrotik Packet Sniffer. So OpenWrt does not tag VLAN1 frames on eth1 (WAN) and tags both VLAN1 and VLAN12 on eth0 (Switch).

That's what I thought, too. This should not be happening, but as the device is old and no longer supported in current stable 19.07 don't expect any fix.
One last thing to try is

swconfig dev eth0 vlan 1 set ports '0t 1 2 3 4'
swconfig dev eth0 set apply
swconfig dev eth0 show

In any case, use the wan port for uplink to the mikrotik and, if the swconfig commands work, use the lan ports for downstream hosts.

root@OpenWrt:~# swconfig dev eth0 vlan 1 set ports '0t 1 2 3 4'
root@OpenWrt:~# swconfig dev eth0 set apply
root@OpenWrt:~# swconfig dev eth0 show
Global attributes:
        enable_vlan: 1
        mirror_monitor_port: 15
Port 0:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 1
        link: port:1 link:down
Port 2:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 1
        link: port:2 link:down
Port 3:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 1
        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 3 4
VLAN 2:
        vid: 12
        ports: 0t
root@OpenWrt:~#

Obviously after this, using eth0 only vlan1 is working.

How about now?

root@OpenWrt:~# swconfig dev eth0 vlan 1 set ports '0t 1 2 3 4'
root@OpenWrt:~# swconfig dev eth0 vlan 2 set ports '0t 1t 2t 3t 4t'
root@OpenWrt:~# swconfig dev eth0 set apply
root@OpenWrt:~# swconfig dev eth0 show
Global attributes:
        enable_vlan: 1
        mirror_monitor_port: 15
Port 0:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 1
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 1
        link: port:1 link:down
Port 2:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 1
        link: port:2 link:down
Port 3:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 1
        link: port:3 link:down
Port 4:
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        pvid: 1
        link: port:4 link:down
VLAN 1:
        vid: 1
        ports: 0t 1t 2t 3t 4t
VLAN 2:
        vid: 12
        ports: 0t 1t 2t 3t 4t
root@OpenWrt:~#

I guess you'll have to stick with eth1 then.

OK! Anyway, thank you very much!

1 Like

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

The solution in this case (TP-Link TL-WR740N router with OpenWrt 18.06.9 installed) is: there is no way to make simultaniously tagged and untagged VLANs on eth0 (Switch ports), so you cannot use untagged VLAN and tagged VLAN, but: you can use eth1 (WAN port) with "Software VLAN" (just adding eth1.N to bridge), this way you can use eth0 (Switch ports) as a switch, connected to either untagged OR tagged VLAN.
Also, if you have only tagged VLANs, you can use any eth0 port to bridge it with different SSIDs.

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