NetworkManager at the command line

Building Bridges

NetworkManager for Bridges

More complex setups follow this setup pattern. If you want to set up, say, a bridge, follow the instructions in Listing 1. The virtual bridge device is given the name virt-br0 in the example. This is assigned to the virtbridge connection and receives two slave devices, which also each have their own connection. This is necessary, because you might want to change the properties of these devices, such as the MTU size of the Ethernet device.

Listing 1

Setting up a Bridge with nmcli

01 # nmcli con add type bridge con-name virtbridge ifname virt-br0
02 Connection 'virtbridge' (dbbf82a2-06f7-431a-9d14-0027173ef89d) successfully added.
03 # nmcli con add type bridge slave con virtbridge-port1 name ifname enp0s25 master virt-br0
04 Connection 'virtbridge-port1' (dab53884-15cf-4d95-8886-a24ffaccfc7b) successfully added.
05 # nmcli con add type bridge-slave con-name virtbridge-port2 ifname virbr0-nic master virt-br0
06 Connection 'virtbridge-port2' (f598a4ce-6564-4b3f-b46e-c3da256915af) successfully added.
07 # brctl show virt-br0 bridge name bridge id STP enabled interfaces virt-br0 8000.5254003504fe yes enp0s25 virbr0-nic

The actual bridge can be configured via the virtbridge connection, as shown in the first example for the Ethernet device. If you are not sure what options are available for the bridge device, you can again rely on Bash completion. Setting up other devices is similar and quickly learned.

Conclusion

NetworkManager is an extensive service tool for configuring the network stack on Linux systems. Thanks to extensive compatibility with the well-known init scripts, you will be able to find your way around the configuration files quickly without a learning curve. If you fail to make friends with the new tool, you can always disable NetworkManager using systemctl stop NetworkManager; systemctl disable NetworkManager.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • What's New in NetworkManager
    The current version of NetworkManager introduces some changes to this de facto standard for configuring the network stack on Linux. We look at the configuration changes you need to make to keep the network running smoothly.
  • Systemd network management and container handling
    Version 219 of the controversial systemd init system introduces a number of comprehensive changes. We take a closer look at the innovations in network management and container handling.
  • networkd and nspawn in systemd
    Version 219 of the controversial init system, systemd, comes with a few major changes. We look at the new features in network management and container handling.
  • Spanning Tree Protocol
    Ethernet is so popular because it simply works and is inexpensive. However, the administration side looks a bit more complicated: For the network to run smoothly, the admin might need to make important decisions about the Spanning Tree protocol.
  • Software-defined networking with Windows Server 2016
    Windows Server 2016 takes a big step toward software-defined networking, with the Network Controller server role handling the centralized management, monitoring, and configuration of network devices and virtual networks. This service can also be controlled with PowerShell and is particularly interesting for Hyper-V infrastructures.
comments powered by Disqus