Help understanding switch port number on VLANs

I'm in the process of building my own router (Fujitsu S920) and am following https://openwrt.org/docs/guide-user/network/vlan/switch_configuration, and using my existing OpenWrt setup (TP-Link Archer C5) as a reference.

I'm a little confused what port number in option 'ports' maps to which physical ports on my device.

On my old/current router, the order of the ports listed in LuCI on /luci/admin/network/switch don't match the order listed in /etc/config/network.
On my new device, ls -l /sys/class/net gives 5 devices. eth4 is my WAN port. eth0-3 are ports on my HP NC365T PCIe card.

I am able to deduce what port in LuCI maps to what port in /etc/config/network, but I am at a loss for what is should be on my new device.
It's not as simple as eth0 maps to port 0 in option 'ports', and so I'm a bit confused on what ports need to be listed in my two VLANs.

My goal is to have all four ports on the PCIe card on one VLAN, and the WAN on another, such as a "common" setup as mentioned at the start of this section.

Can anyone please point me in the right direction?

There is no switch in this x86 box. Each port has a direct, independent link to the CPU. Don't try to use swconfig or switch-vlans.

Linking multiple ports at layer 2 (simulating a switch) is done with software bridges. A suitable bridge br-lan already exists. Add eth0 through eth3 to it.

To make a port emit and receive VLAN tags so it can be used as a trunk link of multiple networks, use the notation ethX.N, where X is the port number and N is the VLAN number. The same port can be in multiple bridges or networks as long as the VLAN number is different in each one.

2 Likes

Wow I cannot believe how fast you replied!
It works, I can finally plug my PC and configure this thing from SSH/LuCI and not walk back and forth from my PC to where this is set up.

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