Create a Network Bridge on CentOS 8 - Step by step guide ?

A network bridge is a device responsible for joining two networks and forming a single network. It operates on the famous OSI model’s data link layer, layer 2. The Network Bridge creates a table of MAC addresses used to forward traffic between the connected networks.

Each network, which the bridge is supposed to be connected, requires a network device to operate. The Network Bridge works as a virtual network switch.

Here at LinuxAPT , we shall look into how a Network Bridge can be created in CentOS 8.

Also, you will see that Network Bridge cannot be used or configured via Wi-Fi in Ad-Hoc.

 

Methods To Create a Network Bridge in CentOS 8

Network bridge can be created via the below ways:

  • nmcli command.
  • nm-connection editor.

 

How to use nmcli command to create a Network Bridge in CentOS ?

1. Ensure that the below conditions are met:
  • There are more than two network devices on the server.
  • Virtual or physical ethernet devices are installed, serving as a bridge port, and must be created before the bridge is built.

 

2. Now, run the below command to create a bridge interface:
$ sudo nmcli connection add type bridge con-name bridge0 iframe bridge0

This command will add the bridge "bridge0".

 

3. To list all the names of the interfaces to be used by the bridge,

Run the below command:

$ nmcli device status

You will see the bridge "bridge0" in the right of the center of the terminal output result.

 

4. Now, create new profiles for the ports that aren't configured and add them to the bridge0 connection.

You can use the following command:

$ nmcli connection add type ethernet slave-type bridge con-name bridge0-port1 iframe enp7s0 master bridge0

 

5. Now, configure the IPv4 settings.

You can use the following commands in the same sequence:

$ nmcli connection modify bridge0 ipv4.addresses '192.168.122.1'
$ nmcli connection modify bridge0 ipv4.gateway '192.168.122.1'
$ nmcli connection modify bridge0 ipv4.dns '192.168.122.1'
$ nmcli connection modify bridge0 ipv4.method manual

Next configure Ipv6 settings using the following commands:

$ nmcli connection modify bridge0 ipv6.addresses '2001:db8:1::1/64'
$ nmcli connection modify bridge0 ipv6.gateway '2001:db8:1::fffe'
$ nmcli connection modify bridge0 ipv6.dns '2001:db8:1::fffd'
$ nmcli connection modify bridge0 ipv6.dns-search 'example.com'
$ nmcli connection modify bridge0 ipv6.method manual

 

6. Now, activate the connection.

You can use the below command:

$ nmcli connection up bridge0

You will see that the connection is activated.

To check the status of the port, run the command:

$ nmcli device

 

How to Create Device Type State Connection ?

1. Ensure that the below conditions are met:
  • There are more than two network devices on the server.
  • Virtual or physical ethernet devices are installed, serving as a bridge port, and must be created before the bridge is built.

 

2. Run the below command on your terminal:
$ nm-connection-editor

You will see a small window which is the "Network Connections".

If you look beneath, you will see the "+" button. Click it to go to the "choosing the connection type" in the Ethernet page. Here, you can select from multiple options that are up to you to decide. This is called "The Bridge Tab".

 

3. Now, do the below activities:
  • Enter Connection/interface name.
  • Fill in the blanks and hit the save button.
  • Follow the previously mentioned steps until each required interface is added to the bridge.

 

4.  Save and close the nm-connection-editor.

 

[Need help in fixing Linux Network issues ? We can help you. ]

This article covers how to Create Network Bridges on Centos OS. In fact, the nmcli command-line tool can create a persistent bridge configuration without editing any files.
 

Related Posts