CentOS 7
This guide assumes you want your bridge name to be virbr0 if you want any other name you’re free to use it but you have to update the bridge name in the slave settings in master panel.
If you want to make this change permanent please follow the following instructions
For RHEL Distributions
Lets assume your network file initially may look like this /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eth0"
UUID="8d6f722c-b945-4083-b50e-9661bf62ae5f"
DEVICE="eth0"
ONBOOT="yes"
IPADDR="192.168.0.2"
PREFIX="24"
GATEWAY="192.168.0.1"
DNS1="8.8.8.8"
Its safe to have a backup in case there's a misconfiguration, you can do that by copying the file and renaming it to a different name.
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak
Now lets copy contents of ifcfg-eth0 to a new file which will be our bridge file with name virbr0
nano /etc/sysconfig/network-scripts/ifcfg-virbr0
TYPE="Bridge"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="virbr0"
DEVICE="virbr0"
ONBOOT="yes"
IPADDR="192.168.0.2"
PREFIX="24"
GATEWAY="192.168.0.1"
DNS1="8.8.8.8"
You an now save it.
Lets change the contents of our ifcfg-eth0 slightly.
Once the above is done we can restart the networking service.
service network restart
Once restart is done, if everything went well you should be able to see the bridge active.
[root@dev1 ~]# ifconfig
virbr0 Link encap:Ethernet HWaddr 00:27:0E:09:9C:B2
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::227:eff:fe09:cb2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:48 errors:0 dropped:0 overruns:0 frame:0
TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2984 (2.9 KiB) TX bytes:13154 (12.8 KiB)
eth0 Link encap:Ethernet HWaddr 00:27:0E:09:0C:B2
inet6 addr: fe80::227:eff:fe09:cb2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31613 errors:0 dropped:0 overruns:0 frame:0
TX packets:9564 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2981335 (2.8 MiB) TX bytes:2880868 (2.7 MiB)
Memory:d0700000-d0720000