Creating VLAN Bridges with systemd-networkd

This is an example of how to setup a machine with two bridges that trunk to two different VLANs (trusted:4 and untrusted:5) on the external network via the eth0.

All of the files are in /etc/systemd/network.

br-trusted.netdev

[NetDev]
Name=br-trusted
Kind=bridge

br-trusted.network

[Match]
Name=br-trusted

[Network]
Address=192.168.0.0/24
Gateway=192.168.0.1
DNS=192.168.0.1
Domains=example.com

br-untrusted.netdev

[NetDev]
Name=br-untrusted
Kind=bridge

br-untrusted.network

[Match]
Name=br-untrusted

eth0.network

[Match]
Name=eth0

[Network]
VLAN=trusted
VLAN=untrusted

trusted.netdev

[NetDev]
Name=trusted
Kind=vlan

[VLAN]
Id=4

trusted.network

[Match]
Name=trusted

[Network]
Bridge=br-trusted

untrusted.netdev

[NetDev]
Name=untrusted
Kind=vlan

[VLAN]
Id=5

untrusted.network

[Match]
Name=untrusted

[Network]
Bridge=br-untrusted

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.