View previous topic :: View next topic |
Author |
Message |
KShots Guru
Joined: 09 Oct 2003 Posts: 591 Location: Florida
|
Posted: Thu Jun 23, 2022 9:16 pm Post subject: systemd-networkd and bridge/vlan setup with single interface |
|
|
I've got a single physical interface (device=network) that I'd like to place two bridges on, each with a different VLAN. I've been successful in setting up a single VLAN'd bridge with the following config: Code: | # /etc/systemd/network/network.network
[Match]
Name=network
[Network]
Bridge=lanbridge
# /etc/systemd/network/lanbridge.netdev
[NetDev]
Name=lanbridge
Description=Virtual Switch for the LAN network
Kind=bridge
[Bridge]
DefaultPVID=1
VLANFiltering=yes
# /etc/systemd/network/lanbridge.network
[Match]
Name=lanbridge
[Network]
#VLAN=lan
Address=10.4.12.4/24
Gateway=10.4.12.10
DNS=10.4.12.10
Domains=mydomainhere
[BridgeVLAN]
PVID=1
VLAN=1
EgressUntagged=1 | ... and this works. Traffic gets routed as I'd expect. Then I try adding a second bridge with the following configs: Code: | # /etc/systemd/network/dmzbridge.netdev
[NetDev]
Name=dmzbridge
Description=Virtual Switch for the DMZ network
Kind=bridge
[Bridge]
DefaultPVID=2
VLANFiltering=yes
# /etc/systemd/network/dmzbridge.network
[Match]
Name=dmzbridge
[Network]
VLAN=2
[BridgeVLAN]
PVID=2
VLAN=2 | ... I then modify /etc/systemd/network/network.network to the following: Code: | [Match]
Name=network
[Network]
Bridge=lanbridge
Bridge=dmzbridge
| ... and it fails. The lanbridge fails to come up (no carrier), and the dmzbridge is degraded according to networkctl. Am I missing something basic here?
EDIT: I've also tried the following notations without success in /etc/systemd/network/network.network: Code: | [Network]
Bridge=lanbridge dmzbridge # All on one line |
Code: | [Network]
Bridge=lanbridge
[Network]
Bridge=dmzbridge # Separate [Network] entries |
_________________ Life without passion is death in disguise |
|
Back to top |
|
|
KShots Guru
Joined: 09 Oct 2003 Posts: 591 Location: Florida
|
Posted: Mon Jun 27, 2022 8:59 pm Post subject: |
|
|
So... after doing some reading, apparently I do have a fundamentally flawed approach. Linux interfaces do not support more than one bridge. Consequently, I am setting up a three-bridge approach - a top-level bridge with both VLANs on it tied to the physical interface, two ports on that bridge defined with the specific VLANs wanted, and two bridges (one each to each port) that I can then pass off to my VMs so that the VLAN stuff is handled outside of their scope. Note that the top-most bridge must not have an address configured... Unfortunately, this is still not working. Here's my new config:
00-network.link Code: | [Match]
MACAddress=*masked*
[Link]
Description=Local Network Adapter
Name=network | 00-network.network Code: | [Match]
Name=network
[Network]
Bridge=trunkbridge | 10-trunkbridge.netdev Code: | [NetDev]
Name=trunkbridge
Kind=bridge
[Bridge]
DefaultPVID=1
VLANFiltering=1 | 10-trunkbridge.network Code: | [Match]
Name=trunkbridge
[BridgeVLAN]
PVID=1
EgressUntagged=1
VLAN=1-2 | 20-dmzport.network Code: | [Match]
Name=dmzport
[Network]
Bridge=trunkbridge
[BridgeVLAN]
PVID=2
VLAN=2 | 20-localport.network Code: | [Match]
Name=localport
[Network]
Bridge=trunkbridge
[BridgeVLAN]
PVID=1
EgressUntagged=1
VLAN=1 | 30-localbridge.netdev Code: | [NetDev]
Name=localbridge
Kind=bridge
[Bridge]
VLANFiltering=1
DefaultPVID=1 | 30-localbridge.network Code: | [Match]
Name=localbridge
[Network]
Address=*masked*
Gateway=*masked*
DNS=*masked*
Domains=*masked*
[BridgeVLAN]
VLAN=1
PVID=1
EgressUntagged=1 | 40-dmzbridge.netdev Code: | [NetDev]
Name=dmzbridge
Kind=bridge
[Bridge]
VLANFiltering=1
DefaultPVID=2 | 40-dmzbridge.network Code: | [Match]
Name=dmzbridge
[BridgeVLAN]
VLAN=2
PVID=2 | With all of this done, I get the following state from systemd-networkd's networkctl (after settling for a minute): Code: | IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 network ether enslaved configured
3 sit0 sit off unmanaged
4 enp9s0 ether off unmanaged
5 trunkbridge bridge degraded configuring
6 localbridge bridge no-carrier configuring
7 dmzbridge bridge no-carrier configuring
7 links listed. | Clearly not working as intended What else can I do here?? _________________ Life without passion is death in disguise |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|