I'm configuring eth1 on my NanoPi R4S (running OpenWrt 22.03.2) to carry two VLANs to a managed switch. When I apply the changes, the computer which is attached to the R4S no longer receives an IP address; after 90s, the changes are rolled back in LuCI and I can login again.
Clearly, I'm overlooking something, but I can't spot my error. Perhaps someone can spot the issue in my config?
At least this looks odd. Should be :t.
An untagged port can be written just as lan1.
For sanity stay away from assigning explicit PVIDs and the like. Just stick to that a Vlan have just ports tagged or untagged and that it has its Vlan id.
Which port is your computer attached to? It looks like eth0 is set up for wan and eth1 is only carrying tagged packets, so how would a vlan-unaware computer reach the router?
You're right: eth0 is wan and the computer is attached to eth1. I had assumed that eth1:t* would mean that untagged frames from my VLAN-unaware computer would take the PVID.
So, it seems that I should connect my computer to my switch rather than to eth1?
That is one option if you only want tagged data on you trunk, but you can also set br-lan device to use untagged packets by default so that your vlan-unaware devices can still reach it.
A few weeks ago I had many questions, too and Yet another DSA-"I still have questions"-thread gives plenty of useful answers. And just to repeat: under "normal" circumstances there is barley a need to fiddle with PVIDs manually at all. Just stick with the VLAN-ID and call it a day.
If you have a linux system running on your pc/laptop you can easily configure your ethernet port to have a vlan, too.
Assuming you have NetworkManager running:
# As your normal user
nmcli device set eth0 managed no
# As root or via sudo
ip link add link eth0 name eth0.100 type vlan id 100
ip link set dev eth0.100 up
ip addr add 192.168.100.23/24 dev eth0.100
# And to revert
ip link set dev eth0.100 down
ip link delete eth0.100
# Again, as your normal user
nmcli device set eth0 managed yes