• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Create a Bridge Interface Using nmcli in CentOS/RHEL 7 and 8

by admin

Here is a short post on creating a bridge interface using the nmcli command in CentOS/RHEL 7 and 8 systems.

1. Get a list of the system’s active network connections:

# nmcli conn show --active

2. Next, create a network bridge by typing:

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

3. Next, set a static IPv4 address for the bridge network:

# nmcli conn mod br0 ipv4.address '192.168.xxx.yy/27'
# nmcli conn mod br0 ipv4.gateway '192.168.xxx.1'
# nmcli conn mod br0 ipv4.method manual

4. Now, add the ethernet interface, ens3, to the bridge, br0, connection:

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

5. Activate the bridge connection:

# nmcli conn up br0

6. Deactivate the ethernet interface, ens3:

# nmcli conn down ens3

7. Get a list of the active network connections:

# nmcli conn show --active

8. Display the current bridge port configuration and flags:

# bridge link show

9. Display the new network bridge interface:

# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 52:12:34:56:78:5d brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:12:34:56:78:5d brd ff:ff:ff:ff:ff:ff
    inet 192.168.xxx.yy/27 brd 192.168.122.31 scope global noprefixroute br0
       valid_lft forever preferred_lft forever
Note: The primary interface name in this example is ens3. The commands above should be run at the console if you are switching the Primary NIC to a bridge interface. The “ip addr” command shows the static IPv4 network address assigned has transitioned from the primary NIC, ens3, to the bridge, br0.

Filed Under: CentOS/RHEL, CentOS/RHEL 7, CentOS/RHEL 8, Linux

Some more articles you might also be interested in …

  1. How to Tune Btrfs Filesystem for Better Performance
  2. How To Configure NIS (Network Information System) Master and Slave Servers in CentOS/RHEL
  3. pscp – ssh_init: Network error: Cannot assign requested address
  4. firejail: command not found
  5. Time goes out of sync on a node running CentOS/RHEL 7
  6. rsync: command not found
  7. How To Calculate The Memory Reserved By HugePages in CentOS/RHEL
  8. quota Command Examples in Linux
  9. aa-enforce: command not found
  10. Common Init.ora Parameters and Unix, Linux Kernel Parameters and Relationship Between Them

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright