CentOS 8.x Creating bridge interfaces (br0) for virtual hosts to use shared interface

From Notes_Wiki
Revision as of 05:53, 12 January 2021 by Saurabh (talk | contribs)

<yambe:breadcrumb self="Creating bridge interfaces (br0) for virtual hosts to use shared interface">CentOS 8.x Network configuration|Network configuration</yambe:breadcrumb>

CentOS 8.x Creating bridge interfaces (br0) for virtual hosts to use shared interface

To create bridge interfaces in CentOS 8.0 (or even 7.0) almost same settings as described in older Creating bridge interfaces (br0) for virtual hosts to use shared interface, with an additional 'NAME=' parameter in both interface configuration files. Example configuration files for CentOS 8.0 bridge are:

In /etc/sysconfig/network-scripts/ifcfg-br0

   NAME="br0"
   DEVICE="br0"
   TYPE="Bridge"
   BOOTPROTO="dhcp"
   ONBOOT="yes"

In /etc/sysconfig/network-scripts/ifcfg-<interface-name>

   NAME="<interface-name>"
   DEVICE="<interface-name>"
   TYPE="Ethernet"
   BOOTPROTO="none"
   ONBOOT="yes"
   BRIDGE="br0"

where <interface-name> can be eth0, enp0s1, eno1, etc.


If you want to specify additional settings such as for IPV6 they should all go in ifcfg-br0 file only. Example settings that can go to ifcfg-br0 are:

DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy

These should be removed from ifcfg-<interface-name> file to avoid duplication.


For changes to take effect restart NetworkManager service using:

systemctl stop NetworkManager
systemctl start NetworkManager

OR stop / start networking using:

nmcli networking off
nmcli networking on


Validate that bridge is having ip address and not interface:

nmcli connection show
nmcli connection show <ethernet-interface> | grep br0

Should show

connection.master: br0


Disabling bridge on laptop to use wifi

If we create bridge using above steps, it might be required to disable it on laptop so that wifi can be used. Without changing config files or restarting network services use following to disable bridge on laptop and switch network to wifi:

  1. Ensure that both ifcfg-br0 and ifcg-<interface-name> files have
    NM_CONTROLLED=yes
  2. Then we can shutdown bridge if required using:
    nmcli connection down br0
  3. After this use ping to test if traffic is now getting routed via wireless as desired or not.



Older information on this can be found at:


Refer:


<yambe:breadcrumb self="Creating bridge interfaces (br0) for virtual hosts to use shared interface">CentOS 8.x Network configuration|Network configuration</yambe:breadcrumb>