netplan icon indicating copy to clipboard operation
netplan copied to clipboard

bridges: implement vlans & port-vlans options for NM backend

Open slyon opened this issue 5 years ago • 7 comments

Description

Implements the vlans & port-vlans option keys for bridges, as required by the "NetworkManager readwrite plugin" spec. Currently only supports the nm backend. I need to further research the networkd backend...

Checklist

  • [x] Runs make check successfully.
  • [x] Retains 100% code coverage (make check-coverage).
  • [x] New/changed keys in YAML format are documented.
  • [ ] (Optional) Closes an open bug in Launchpad.

slyon avatar Apr 03 '20 14:04 slyon

Ok, so I still need to think about this one for a bit. For now let's not consider getting this merged as a blocker for the NM read-write pieces, if anything.

sil2100 avatar Apr 08 '20 16:04 sil2100

For systemd, using default VLAN 1, using vlan 2 for the bridge and adding 2 and 3 to eth0...

br0.netdev:
[Bridge]
VLANFiltering=1
DefaultPVID=1

br0.network:
[BridgeVLAN]
PVID=2
EgressUntagged=2

eth0.network:
[BridgeVLAN]
PVID=1
EgressUntagged=1
VLAN=2
VLAN=3

nafallo avatar Jul 28 '21 17:07 nafallo

For systemd, using default VLAN 1, using vlan 2 for the bridge and adding 2 and 3 to eth0...

I do not really get this comment. Could you please give some more detail?

slyon avatar Jul 29 '21 10:07 slyon

That was in response to needing further research into the networkd backend, so I thought a comment with how my set up is looking might be helpful?

For the .netdev file of the bridge you need to turn on VLAN filtering and set a default VLAN to use, then tag VLANs in the .network files. You do need to tag the VLANs you want to use from the bridge on the interface going towards the switch, I've learnt the hard way.

nafallo avatar Jul 29 '21 10:07 nafallo

Ah, I see. So this is an example of how it could be implemented for the networkd backend. Thank you very much! I guess we need to adopt the PR accordingly, as right now this feature is not implemented at all for the networkd backend.

slyon avatar Jul 29 '21 14:07 slyon

Any updates on this? Having VLAN aware bridges as shown in the networkd example would be very useful.

gaby avatar Sep 22 '22 03:09 gaby

Any updates on this?

Unfortunately, no. This is an old PR which needs to be updated to the current codebase. Furthermore, we need to implement the networkd backend as described above. If anybody wants to work on this, feel free to pick it up.

As a workaround you should always be able to use networkd override configs manually, in addition to your normal eth0/br0 netplan definition, e.g.:

$ cat /etc/systemd/network/10-netplan-br0.network.d/override.conf
br0.network:
[BridgeVLAN]
PVID=2
EgressUntagged=2
$ cat /etc/systemd/network/10-netplan-eth0.network.d/override.conf
[BridgeVLAN]
PVID=1
EgressUntagged=1
VLAN=2
VLAN=3

slyon avatar Oct 27 '22 13:10 slyon

Closing due to inactivity, please re-open if this is still needed in the future.

slyon avatar Jun 26 '24 10:06 slyon