Using NetworkManager to manage a lxdbr0 bridge

Mark Constable

I like to create a lxdbr0 bridge on my laptop so I can easily deploy LXD containers and, as I treat my laptop like a workstation, I hardly ever move it so I can use an ethernet connection instead of wifi for full gigabit local area network speeds. Setting up a bridge to a wifi device is somewhere between difficult to impossible and not worth the time spent Googling it (as convenient as it might be.) In the past I used the networking systemd service and more recently I tried systemd-networkd and both of those methods work fine but require manual editing of files and switching to mobile via NetworkManager (being disabled) is awkward. A couple of times over the last few years I’ve tried using the bridging facility within the network manager gui (plasma-nm in my case) and it mostly creates the bridge config files but never seems to connect to the slaved ethernet interface.

So this is mostly a note for myself in the future when I do a reinstall and need to repeat this trick to get NetworkManager to finally create a full working bridge when activated. I call the bridge lxdbr0 because that is what LXD expects to use when and if I want to set up some containers. The trick is to manually add just two extra lines to the NetworkManager ethernet system config file such as (example only)…

master=lxdbr0
slave-type=bridge

Why on earth the NetworkManager gui won’t do this automatically is beyond me! So for reference here are my two NM bridge config files where my ethernet interface is called enp4s0f1…