You are not logged in.

#1 2025-12-30 21:16:22

Sedenion
Member
Registered: 2016-07-03
Posts: 31

[Solved]Creating network bridge causes host to lose access to internet

I want to setup a network where qemu virtual machines can access the internet and communicate with each other, with each machine keeping a static address.

Before the setup, my networkctl looks like this

$ networkctl
 IDX LINK            TYPE     OPERATIONAL SETUP
   1 lo              loopback carrier     unmanaged
   2 enp5s0          ether    routable    configured

I have these 4 files in /etc/systemd/network, following the guide here https://wiki.archlinux.org/title/System … containers

# 20-br0.link
[Match]
OriginalName=br0

[Link]
MACAddressPolicy=none

# 20-br0-en.network
[Match]
Name=en*

[Network]
Bridge=br0

# 20-br0.netdev
[NetDev]
Name=br0
Kind=bridge
MACAddress=none

# 20-br0.network
[Match]
Name=br0

[Link]
RequiredForOnline=routable

[Network]
DNS=192.168.250.1
Address=192.168.250.33/24
Gateway=192.168.250.1

After I restart both systemd-networkd and systemd-resolved, networkctl shows that the enp5s0 link becomes enslaved:

$ networkctl
 IDX LINK            TYPE     OPERATIONAL SETUP
   1 lo              loopback carrier     unmanaged
   2 enp5s0          ether    enslaved    configured
   ...
2452 br0             bridge   routable    configured

and when this happens, the host loses access to the internet. `ping 8.8.8.8` ends in a 100% packet loss rate.

If I change 20-br0.network to DHCP instead, the problem goes away, but according to the wiki I have to use DNS-Address-Gateway if I want static addresses.

[Match]
Name=br0

[Link]
RequiredForOnline=routable

[Network]
DHCP=yes

How should I solve this problem?

Edit: Solved. This is because of a misunderstanding in how bridges work. Setting the bridge to DHCP mode and configuring new network devices for each virtual machine solved the problem.

Last edited by Sedenion (2025-12-31 00:04:34)

Offline

Board footer

Powered by FluxBB