Setting up a bridge network on Ubuntu 24.04 Desktop

Hi,

i would like to set up a bridge network to be used with KVM virtual machines, there seems to be no way do do so using the Gnome network setting and looking to find out the best method to do it.
Looking for various tutorials or infos I can find very outdated guides but it seems that Ubuntu official network managing tool is called “netplan” am i correct and if not what is it?

Thanks

yep, it is called netplan, general documentation is at:

https://netplan.io/

and bridging examples are at:

https://netplan.readthedocs.io/en/stable/examples/#how-to-configure-network-bridges

1 Like

Thanks ogra,

it seems to me that on desktop the NetworkManager renderer is the default one but all examples for bridge network are using Systemd-networkd as a renderer, so I tried anyway to set up a config file into /etc/netplan dir but it is not working:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s25:
      dhcp4: no
  bridges:
    br0:
      addresses: [ "10.10.10.2/24" ]
      nameservers:
        addresses: [8.8.8.8,8.8.4.4]
      routes:
        - to: default
          via: 10.10.10.1
          on-link: true
      interfaces:
        - enp0s25 

now I wonder is it ok to use netword renderer on desktop or is it possible?
if yes my config file must be wrong any help if this is the case on fixing it?

thanks

the renderer: property can be used per-device like:

network:
  version: 2
  ethernets:
    enp1s0:
      renderer: NetworkManager
    enp2s0:
      renderer: networkd
      dhcp4: true

please use three backticks ``` above and below code snippets in text (like i did above), that will keep the indentation intact, which is kind of critical for YAML :slight_smile:

1 Like

Thanks ogra, i’m happy to say it’s working now using the per-device renderer as you suggested.

1 Like

Trying to install packages( deb package) with App Center I have a:

PackageKit error: PackageKitError.noNetwork
Cannot download packages whilst offline

seems like PackageKit does not like this configuration, is there some workaround for this?

Solution:

create fake NetworkManager connection

I recently installed Ubuntu 24.04 Desktop on a mini PC (Beelink EQ12, Intel N100/16GB RAN/500GB SSD). This has embedded 2x2.5Gbe NICs which I have bridged together. I am planning to use it as a traffic shaping box with Netem. The bridge establishes fine and Netem works fine for both delay/jitter/PLR and Bandwidth control. I am sharing below my Netplan config. One NIC connects to my client and the other NIC connects to a switch to access the network.

However, the problem I am facing is the bridge stability. Even if I don’t enable any Netem traffic shaping over few hours of use I see the NIC facing the server going into listening mode (from forwarding) and the server loses connection. After few seconds it auto-recovers but it happens again later on.

The box is remotely accessed via the WiFi 6 adaptor, and that connection always works fine.

Anyone faced something similar or any recommendations on how to help solve this?

network:
    version: 2
    wifis: {}
    ethernets:
      enp1s0:
        dhcp4: no
        optional: true
        ignore-carrier: true
      enp2s0:
        dhcp4: no
        optional: true
        ignore-carrier: true

    bridges:
      netem_bridge:
        dhcp4: no
        interfaces:
          - enp1s0
          - enp2s0
1 Like

Replying to myself in case anyone else comes up with same issue in the future.

After adding following 2 entries (forward-delay and stp) in my Netplan file the bridge (2x2.5Gbe) is now super stable for endless hours. Been doing some stress testing with constant uploads/downloads/pings with and without Netem in use and all working fine as expected.

I have also completed my integration of traffic shaping from Home Assistant GUI and works perfectly. Commercial traffic shaping products like the Entropy from Apposite cost thousands and you need to pay even more if you want >1Gbps, and the box is also much bigger and consumes more power. This is 10W box that fits in your palm and costs £200.

network:
    version: 2
    wifis: {}
    ethernets:
      enp1s0:
        dhcp4: no
        optional: true
        ignore-carrier: true
      enp2s0:
        dhcp4: no
        optional: true
        ignore-carrier: true

    bridges:
      netem_bridge:
        dhcp4: no
        interfaces:
          - enp1s0
          - enp2s0
        parameters:
          forward-delay: 0
          stp: false

2 Likes