Making Pi4 act as VLAN switch

Hi,

First of all - I'm almost clueless about networks, there are a lots of posts here about vlans and tagging, but I cannot figure out which info is relevant to my situation, I'm overwhelmed.

  1. What I have:
    I have IPTV service, which works on multicast network with tag 6 (incoming on WAN).
    To make IPTV box to work I have to untag that VLAN to port where IPTV box is connected.
    I'm using Xiomi router with OpenWRT to do that.

I've got another IPTV box somewhere else in the network connected to simple switch with bunch of other devices, like computers, etc.

I also have raspberry Pi4 with 2 nic adapters (internal + USB).

  1. What I'm trying to do:
    My idea was to send tagged traffic from WAN to the same port as regular traffic, mixing tagged and untagged. And then use Pi4 with OpenWRT to accept that traffic on eth0.6 untag it and send everything to IPTV box2 directly connected to eth1 on Pi4.
    Not sure if my idea even makes sense.

  2. So far I've managed to lock myself out of raspberry pi4 by creating several bridges with wrong tagging options. So I just flashed the rom again and now I'm at clean slate, vanilla Pi4 OpenWrt configuration with 2 NICs connected.

  3. It should be simple, but I'm lost now. Can anyone point me in the right direction? By the way I've ordered VLAN capable smart switch to replace the unmanaged one, so I can split VLANs properly.

Thanks

Can you show a diagram of your physical topology?

You need a managed switch to achieve your goal, if my understanding of your setup is correct.

I'm waiting for managed switch, which arrives next week.
Right now it's
WAN
|-> Xiomi Router
--|-> Port 4 vlan6 untagged -> IPTV box 1
--|-> Port 1 vlan 1 untagged
----|-> Unmanaged Switch
------|-> Desktop PC, Smart TV, Kodi Box
------|-> Raspberry Pi4 to eth0
--------|-> eth1-> IPTV Box 2

I know it will never work like that, not even sure what I was thinking connecting everything like that.
As I understand, my unmanaged switch has to be replaced with managed one, and split vlan 1 for regular devices, vlan 6 to IPTV box. Pi4 box would have no use here, and I'm planning to put it between WAN and Xiomi, as main router, and Xiomi would work as dumb AP and managed switch.

As it is right now - may be I could use some kind of tunnel (GRE?) from xiomi to Pi4 and forward everything to eth1.
But I think I'll wait a little.

Thanks

It is possible to put a bridge together on the Pi with devices eth0.6 and eth1.6 (if it needs to be tagged) or just eth1 (if it should be untagged). You'd then connect that bridge device with a network interface that has proto none (unmanaged).

In the current state, you don't have VLAN6 connecting to the Pi in the first place. And you shouldn't attempt to put VLAN6 through the unmanaged switch. You need a managed switch (which is on its way!) to do deal with multiple VLANs.

Meanwhile, I am uncertain why you want to connect the IPTV box to the Pi on eth1 -- why pass it though the Pi at all? If you replace your unmanaged switch with a managed one, you can connect the IPTV box directly to a port on the new managed switch.

1 Like

I removed Pi from its previous place and moved it between ISP and Xiomi wireless router (which is now dumb AP and managed switch). Iptv box2 will be connected to the new managed switch.

Thank you for the tips, I'm new at openwrt configuration, did not know how to bridge vlans properly, but after some trial and err I think I got it.

New network as I imagine:
ISP Fibre modem
| eth1 (WAN) Pi4
--| eth0 (LAN) to port 2 (VLAN 1, 6 tagged) on Xiomi Router
----| port 3 (VLAN6 untagged) -> IPTV box 1
----| port 1 (VLAN 1, 6 tagged) -> Managed switch
------| ports 2, 3, 4 (VLAN 1 untagged) -> TV, Desktop, Kodi
------| port 5 (VLAN 6 untagged) -> IPTV box 2

Glad things are working for you now.

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.