0

I want to create two bridges with two upstream WAN interfaces. Virtual Machines connected to the bridges should be able to communicate with each other, but each bridge would have a different WAN interface.

Bridge 1 (br1)'s traffic headed to the Internet would exit out of ens3, Bridge 2 (br2)'s traffic headed to the Internet would exit out of ens4.

So far, I have attempted to do this setup with systemd-networkd, with no success. I am using VLAN because attaching the WAN interface ens3 to any bridge kills my internet connection. With the below setup, VM's connected to that bridge can ping each other and the gateway IP, but they cannot access the internet.

Are there any configuration changes or iptables rules I can add to fix this problem? IF having two bridges with different upstream WAN interfaces is impossible with systemd-networkd, are there other solutions that can do this?

Here are the configuration files for Bridge 1:

cat /etc/systemd/network/ens3.network

[Match]
Name=ens3

[Network]
DNS=1.1.1.1
DNS=1.0.0.1
NTP=pool.ntp.org
VLAN=br1vlan

[Address]
Address=(wan ip of ens3)/24

[Route]
Gateway=(wan gateway of ens3)

cat /etc/systemd/network/br1vlan.network

Name=br1vlan

[Network]
Bridge=br1

cat /etc/systemd/network/br1.network

[Match]
Name=br1

[Network]
IPv6AcceptRA=false
IPForward=yes
IPMasquerade=yes
DNS=10.1.0.1
Address=10.1.0.10/24
Gateway=10.1.0.1

and here are the configuration files for Bridge 2:

cat /etc/systemd/network/ens4.network

[Match]
Name=ens4

[Network]
DNS=1.1.1.1
DNS=1.0.0.1
NTP=pool.ntp.org
VLAN=br2vlan

[Address]
Address=(wan ip of ens4)/24

[Route]
Gateway=(wan gateway of ens4)

cat /etc/systemd/network/br2vlan.network

[Match]
Name=br2vlan

[Network]
Bridge=br2

cat /etc/systemd/network/br2.network

[Match]
Name=br2

[Network]
IPv6AcceptRA=false
IPForward=yes
IPMasquerade=yes
DNS=10.2.0.1
Address=10.2.0.10/24
Gateway=10.2.0.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.