How to setup a Linux KVM Bridge (br0) on our network
Here we show you how to setup a Linux KVM bridge set to (br0) for use in a KVM slave node. These setting are specific to our network configuration and won’t work with other providers. You should only ever use these settings on a clean OS install, never change these settings in a live environment. If you make a mistake you will need to reinstall the OS on your server before trying again. First2Host offers this guide as a complimentary service, we cannot help you in the setup of 3rd party software. If you need support, please contact the software developers of the hypervisor you are using or a systems administrator experienced in Linux KVM Bridge setups.
- The IPv4 Gateway is always your servers main IP address, but the final 3 digits are .254 so if your servers ip address is 18.104.22.168 then your Gateway will be 22.214.171.124
- Mac addresses for virtual containers will be needed on KVM slaves. Please contact support for these after you have an ip block to use for guest machines
- This guide is provided as a complementary service for our customers to use, we can not offer support for specific hypervisors , instead you should contact the vendor for support. Users from other hosting providers should not use this guide. These settings relate to our network configuration only.
To setup a bridge your server will need the bridge-utils package to be installed. First check to see if the package is already installed.
rpm -q bridge-utils
If you get a response, then the package is already installed in your server. If there is no output, then continue to install the package
yum install bridge-utils
Before you setup the bridge in your dedicated server the /etc/sysconfig/network-scripts/ifcfg-eth0 file will look like this
DEVICE=eth0 BOOTPROTO=static BROADCAST=192.168.2.1 HWADDR=00:22:0E:03:0C:E2 IPADDR=126.96.36.199 IPV6INIT=yes IPV6_AUTOCONF=yes NETMASK=255.255.255.255 NETWORK=188.8.131.52 ONBOOT=yes
Backup this file in case of any errors
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/backup-ifcfg-eth0
Now create a bridge file
nano -w /etc/sysconfig/network-scripts/ifcfg-br0
Copy the information from the /etc/sysconfig/network-scripts/ifcfg-eth0 file to the bridge file
DEVICE=br0 TYPE=Bridge BOOTPROTO=static IPADDR=SERVER-IP NETMASK=255.255.255.0 ONBOOT=yes #GATEWAY=IPv4 Gateway IPV6INIT=yes IPV6_AUTOCONF=no IPV6_DEFROUTE=yes #IPV6_FAILURE_FATAL=no IPV6ADDR="IPv6ADDRESS" IPV6_DEFAULTGW=IPv6 Gateway NETBOOT=no
Copy the bridge file exactly as you see it above swapping the ip information with your ip details. Don’t remove any (#) or “ from the file just swap the information. Save and close the bridge file.
Next in the /etc/sysconfig/network-scripts/ifcfg-eth0 file add the required bridge into this file and comment out (#) the information we have below. Make sure you leave DEVICE=eth0, BRIDGE=br0, ONBOOT=yes, NETBOOT=no, NM_CONTROLLED=”no” with no (#)
DEVICE=eth0 BRIDGE=br0 #BOOTPROTO=static #IPADDR=SERVER-IP #NETMASK=255.255.255.0 ONBOOT=yes #GATEWAY=IPv4 Gateway #IPV6INIT=yes #IPV6_AUTOCONF=no #IPV6_DEFROUTE=yes #IPV6_FAILURE_FATAL=no #IPV6_AUTOCONF=yes #IPV6ADDR=IPv6 Address NETBOOT=no NM_CONTROLLED="no"
Finally restart the network, you may get disconnected but you should be able to reconnect assuming you followed this guide and used the exact settings and information we have.
You can verify the bridge after restarting the network by
You should see the bridge listed at the top
How was this article?