I'm trying to achieve something simple.
I have a machine which has a single physical port enp89s0
. this is connected to the native VLAN (VLAN=1
).
I need to create VMs and place them on a separate VLAN=166
.
In order to not specify the interface name of the machines in the systemd networkd, I have created a bridge and connect VMs there.
This bridge has as uplink an vlan interface eth.166
which is connected to the main bridge.
the design would look like the following
------------- -------------
enps890 | | eth.166 | |
-------------| br0 |-------------| br166 |
| | | |
-------------- --------------
the VMs get connected to the br166
.
The VMs do not tag the traffic so the traffic arrives untagged and the interface eth.166
should tag it and pass it to the switch. My switch is configured with trunk port so I do not think is an issue of the switch. I've spent some time to it but I could not find the way.
Here my configuration
br0.netdev
[NetDev]
Name=br0
Kind=bridge
[Bridge]
VLANFiltering=yes
br0.network
[Match]
Name=br0
[Network]
DHCP=yes
[Network]
VLAN=eth.166
enps890.network
[Match]
Name=enp89s0
[Network]
Bridge=br0
[BridgeVLAN]
VLAN=166
br166.netdev
[NetDev]
Name=br166
Kind=bridge
[Bridge]
VLANFiltering=yes
br166.network
[Match]
Name=br166
[Network]
DHCP=no
eth.166.network
[Match]
Name=eth.166
[Network]
Bridge=br166
DHCP=no
[BridgeVLAN]
VLAN=166
PVID=166
EgressUntagged=166
eth.166.netdev
[NetDev]
Name=eth.166
Kind=vlan
[VLAN]
Id=166
$ bridge vlan
port vlan-id
enp89s0 1 PVID Egress Untagged
166
br0 1 PVID Egress Untagged
br166 1 PVID Egress Untagged
eth.166 1 Egress Untagged
166 PVID Egress Untagged
virbr0 1 PVID Egress Untagged