Creating a Bridge with NetworkManager

Source: Network bridge - ArchWiki

Important bits excerpted below.


Creating a Bridge

With NetworkManager

GNOME’s Network settings can create bridges, but currently will not auto-connect to them or slave/attached interfaces. Open Network Settings, add a new interface of type Bridge, add a new bridged connection, and select the MAC address of the device to attach to the bridge.

KDE’s plasma-nm can create bridges. In order to view, create and modify bridge interfaces open the Connections window either by right clicking the Networks applet in the system tray and selecting Configure Network Connections… or from System Settings > Connections. Click the Configuration button in the lower left corner of the module and enable “Show virtual connections”. A session restart will be necessary to use the enabled functionality.

nm-connection-editor can create bridges in the same manner as GNOME’s Network settings.

nmcli from networkmanager can create bridges. Creating a bridge with STP disabled (to avoid the bridge being advertised on the network):

$ nmcli connection add type bridge ifname br0 stp no

Making interface enp30s0 a slave to the bridge:

$ nmcli connection add type bridge-slave ifname enp30s0 master br0

Setting the existing connection as down (you can get it with nmcli connection show --active):

$ nmcli connection down _Connection_

Setting the new bridge as up:

$ nmcli connection up bridge-br0

If NetworkManager’s default interface for the device you added to the bridge connects automatically, you may want to disable that by clicking the gear next to it in Network Settings, and unchecking “Connect automatically” under “Identity.”

Assigning an IP address

With NetworkManager

Give it the desired address:

nmcli connection modify _interface_ ipv4.addresses _desired_IP_

Set up a DNS server (this will also avoid not being able to load any pages after you apply the changes):

nmcli connection modify _interface_ ipv4.dns _DNS_server_

Set the IP address to static:

nmcli connection modify _interface_ ipv4.method manual

Apply the changes:

nmcli connection up _interface_

About

I'm a technology professional who's been passionate about computers since my Grandad introduced me to an Intel 386 back in the 90s when I was a kid. Those moments inspired a passion within for technology, and I've been playing around with anything with a circuit board ever since. Whenever I have a moment you can probably find me working on something computer-related, and this is where I like to write about those moments.