Operations 9 min read

Create and Manage Network Bridges on RHEL/CentOS 8 Using nmcli, Cockpit & Virtualization

This guide walks you through configuring software network bridges on RHEL/CentOS 8, covering command‑line setup with nmcli, graphical creation via Cockpit and nm‑connection‑editor, and applying the bridges in Oracle VirtualBox and KVM virtual machines.

ITPUB
ITPUB
ITPUB
Create and Manage Network Bridges on RHEL/CentOS 8 Using nmcli, Cockpit & Virtualization

Introduction

A network bridge operates at the data‑link layer, linking multiple network segments and forwarding traffic based on MAC addresses. Linux distributions such as RHEL and CentOS 8 provide software bridges that behave like virtual switches, useful for connecting virtual machines to the host’s physical network.

Setting Up a Bridge with nmcli

Identify existing interfaces: # ip add Assuming the Ethernet interface is enp2s0, create a bridge named br0:

# nmcli conn add type bridge con-name br0 ifname br0

Assign a static IPv4 address (adjust values for your environment):

# nmcli conn modify br0 ipv4.addresses '192.168.1.1/24'
# nmcli conn modify br0 ipv4.gateway '192.168.1.1'
# nmcli conn modify br0 ipv4.dns '192.168.1.1'
# nmcli conn modify br0 ipv4.method manual

Add the Ethernet interface as a bridge slave:

# nmcli conn add type ethernet slave-type bridge con-name bridge-br0 ifname enp2s0 master br0

Activate the bridge and deactivate the original wired connection:

# nmcli conn up br0
# nmcli conn down "Wired connection 1"

Verify the bridge is active: # nmcli conn show --active Display bridge ports and flags: # bridge link show To remove the bridge, reactivate the wired connection first, then delete:

# nmcli conn up "Wired connection 1"
# nmcli conn down br0
# nmcli conn del br0
# nmcli conn del bridge-br0

Creating a Bridge via Cockpit Web Console

Cockpit provides a lightweight web UI that interacts with NetworkManager. In the “Network” section, click “Add Bridge”, set the bridge name, select ports, optionally enable STP, and apply the changes.

Creating a Bridge with nm-connection-editor

Launch the graphical editor as root: # nm-connection-editor Click the “+” button, choose “Bridge” as the connection type, configure the bridge name and ports, then save.

Using the Bridge in Virtualization Environments

Oracle VirtualBox

In the VM’s settings, open the “Network” tab, enable the adapter, select “Bridged Adapter”, and choose the bridge interface br0.

KVM

When creating a VM with virt-install, specify the bridge:

# virt-install --virt-type=kvm --name Ubuntu18.04 --ram 1536 --vcpus=4 \
  --os-variant=ubuntu18.04 --cdrom=/path/to/install.iso \
  --network=bridge=br0,model=virtio \
  --graphics vnc \
  --disk path=/var/lib/libvirt/images/ubuntu18.04.qcow2,size=20,bus=virtio,format=qcow2

You can also create additional networks with virsh or edit the VM’s XML definition to attach the bridge.

Cleanup and Further Reading

To deactivate and delete a bridge, ensure the physical interface is up, then use the nmcli commands shown earlier. For detailed options, consult the nmcli man page ( # man nmcli).

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

KVMCentOSRHELCockpitVirtualBoxnmcliNetwork Bridge
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.