Linux Commands and Scripts

Configure Network Bridge Interface For CentOS KVM Slave

In this article, we will discuss how to configure network bridge interface for CentOS KVM slave.

If you want to setup a dedicated network bridge for Linux KVM virtualization, this article will help you.

For this demonstration, we are using network interface name as a eth0 and the bridge name will be br0. In your case network interface name might be different.

Warning: This is very sensitive configuration, if you miss something or wrote with spelling mistake, you would loose server connectivity. In that case, contact your service provide to revert changes back.

1. Access the server using SSH with root user.
2. Keep the server up-to-date

# yum update -y

3. Install bridge utils package

# yum install bridge-utils -y

4. Next, create a backup of network interface file ifcfg-eth0

# cp /etc/sysconfig/network-scripts/ifcfg-eth0 ~/ifcfg-eth0.bak

5. Create the bridge ifcfg-br0

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

6. Modify the bridge file to make it look like below

DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
IPADDR="127.0.0.2″
NETMASK="255.255.255.255″
GATEWAY="127.0.0.1″

Note: We have not added IPv6 values. In your case IP address details will be different.

7. Now, edit the ifcfg-eth0 as below

NAME=eth0
DEVICE=eth0
ONBOOT=yes
BRIDGE=br0

Note: We have not added IPv6 values.

8. Restart the network service to apply the changes

# systemctl restart network

That’s it. We have successfully created bridge network. You can verify it using following command

# ip a

In this article, we have seen how our support engineers configure network bridge interface for CentOS KVM slave.

[Need assistance to fix this error or install tools? We’ll help you.]

 

Related Articles