Configure Network Bridge on AlmaLinux 9

In this guide, you will learn to Configure Network Bridge on AlmaLinux 9. A network bridge configuration includes connecting two or more network interfaces on a system to create a single logical network interface, known as a bridge. This bridge allows network traffic to pass transparently between the connected interfaces, effectively joining them into a single network segment.

Network bridges are commonly used in scenarios where it is necessary to extend a local area network (LAN) across multiple physical or virtual interfaces, such as in virtualization environments, container networking, or network segmentation.

In this tutorial, you will learn Network Bridge Configuration on AlmaLinux 9.

Learn To Configure Network Bridge on AlmaLinux 9

To complete this guide, you must access your server as a non-root user with sudo privileges. For this purpose, you can check the Initial Server Setup with AlmaLinux 9.

Now proceed to the following steps to start your network bridge configuration.

Step 1 – Install bridge-utils on AlmaLinux 9

First, you need to run the system update with the following command:

sudo dnf update -y

Then, you must install the bridge-utils package for managing your network bridges. To do this, run the commands below:

# sudo dnf install epel-release -y
# sudo dnf install bridge-utils -y

Step 2 – Find Physical Interface on AlmaLinux 9

At this point, you must find your physical interface by using the following command:

sudo ip -f inet a s

In this example, eth0 is my physical interface.

Example Output
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    altname enp0s3
    altname ens3
    inet  brd  scope global noprefixroute eth0
       valid_lft forever preferred_lft forever

Step 3 – Configure Ethernet Interface on AlmaLinux 9

At this point, you must edit the network configuration file. To open the file, you can use your favorite text editor like Vi editor or Nano editor:

sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0

Now you need to modify the configuration file for your Ethernet interface, for example, eth0, to include the following lines:

TYPE=Ethernet
BOOTPROTO=none
NAME=eth0
DEVICE=eth0
ONBOOT=yes
BRIDGE=br0

Once you are done, save and close the file.

Step 4 – Create a Bridge Interface on AlmaLinux 9

At this point, you need to create a new configuration file for the bridge interface (br0) in the same directory. To do this, you can run the command below:

sudo vi /etc/sysconfig/network-scripts/ifcfg-br0

Add the following lines to the configuration file for the bridge interface (br0):

TYPE=Bridge
BOOTPROTO=none
NAME=br0
DEVICE=br0
ONBOOT=yes
IPADDR=<bridge_ip_address>
NETMASK=<subnet_mask>
GATEWAY=<gateway_ip_address>

Note: Remember to set the appropriate values for your network configuration.

When you are done, save and close the file.

Next, restart the network service to apply the changes:

sudo systemctl restart network

Step 5 – AlmaLinux 9 brctl Command

At this point, you can verify that the bridge interface is correctly configured and operational by using the brctl command:

sudo brctl show

Also, use the command below to show your current bridges:

bridge link

Conclusion

By following these steps, you can configure a network bridge on AlmaLinux 9, allowing you to bridge multiple network interfaces and manage network traffic. Make sure to adjust the configuration settings according to your specific network requirements. Hope you enjoy it.

Also, you may like to read the following articles:

Use the arp command in Linux Networking

Install Sniffnet on AlmaLinux 9 – Network Traffic Analysis

Restart Network Service on AlmaLinux 9 and RHEL 9

Configure Networking on AlmaLinux

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!