CentOS / Redhat: KVM Bridged Network Configuration

With bridged networking you can share actual network device with KVM machines. This is required for servers with multiple network cards and gives you good performance. You can choose to put multiple segments into one bridged network or to divide it into different networks interconnected by routers.

Our Sample Setup

The following describes the networking used by our setup:

		+------+       +-----+
LAN      -->	| eth0 |   | br0 |       -> KVM VMs connected to LAN for SAN/NFS
		+------+       +-----+

		+------+       +-----+
Internet -->	| eth1 |   | br1 |       -> KVM VMs connected to the Inernet
		+------+       +-----+


  • All other clients can reached to all VMs via br1 which is connected to public interface. br1 is our default gateway.
  • br0 is connected to private LAN to access other servers, services and storage devices such as SAN/NAS or NFS servers. br0 route is configured via route-br0 static networking configuration file.

Turn Off NetworkManager

The NetworkManager (GUI) tool can create problems with bridged based networking so disable it as follows, enter:
# chkconfig NetworkManager off
# chkconfig network on
# service NetworkManager stop

Edit /etc/sysconfig/network, enter:
# vi /etc/sysconfig/network
Update file as follows:


Save and close the file.

br0: Configure Bridging for eth0

Edit /etc/sysconfig/network-scripts/ifcfg-eth0, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Update it as follows:

ETHTOOL_OPTS="autoneg off speed 100 duplex full"

Save and close the file. Create /etc/sysconfig/network-scripts/ifcfg-br0, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-br0
Update it as follows (note options are case sensitive i.e. Bridge and bridge are two different options)


Save and close the file. Finally, create static routing file /etc/sysconfig/network-scripts/route-br0, enter :
# vi /etc/sysconfig/network-scripts/route-br0
Edit it as follows: via dev br0

Save and close the file. Delete old /etc/sysconfig/network-scripts/route-eth0 (if exists):
# rm /etc/sysconfig/network-scripts/route-eth0

br1: Configure Bridging for eth1

Edit /etc/sysconfig/network-scripts/ifcfg-eth1, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
Update it as follows:

ETHTOOL_OPTS="autoneg off speed 100 duplex full"

Please note that test server is set to 100Mbps full duplex. Save and close the file. Edit /etc/sysconfig/network-scripts/ifcfg-br1, enter:
# vi /etc/sysconfig/network-scripts/ifcfg-br1
Define public IP address including gateway as follows:


Save and close the file.

Restart Network Service

Type the following command:
# service network restart
Make sure everything is working fine:
# brctl show
Sample outputs:

bridge name	bridge id		STP enabled	interfaces
br0		8000.0030488e31ac	no		eth0
br1		8000.0030488e31ad	no		eth1
virbr0		8000.000000000000	yes		

Verify IPs and routing tables:
# ip addr show br0
# ip addr show br1
# ip route
# ping cyberciti.biz
# host google.com

🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
25 comments… add one
  • Tapas Mallick Jun 24, 2010 @ 14:58

    A small typo needs to be corrected Under “br1: Configure Bridging for eth1” heading, “vi /etc/sysconfig/network-scripts/ifcfg-eth0” should be changed with “vi /etc/sysconfig/network-scripts/ifcfg-eth1”

    • 🐧 nixCraft Jun 24, 2010 @ 15:01

      Thanks for the heads up! The post has been updated.

  • Slapper Oct 21, 2010 @ 12:24

    regarding the Bridging…
    watch the custom options ( ETHTOOL_OPTS ) you pass in eth0, eth1 etc !!
    you may find network issues in guest machines. I have three guest ( Ubuntu,Centos, Openbsd ) in my Centos host and the 3 guest had problems.Probably has to do with the model of the network card..so leave the default!!!
    something like this :

  • Kevin D Mar 14, 2011 @ 19:42

    How would a single eth0 nic grabbing its information from a DHCP server be handled?

  • Robert Jun 10, 2011 @ 13:44

    I think your GATEWAY parameter in /etc/sysconfig/network is incorrect. That parameter should be the IP address. If you want to direct to a device, then you need to use GATEWAYDEV parameter.


    Thanks for the good work on your site. I always learn something new.

  • Kapil Aug 4, 2011 @ 5:54

    Dear Vivek,

    Can U please elaborate on this entry. via dev br0

    • John Brier Dec 16, 2011 @ 15:51

      I also do not know why you would need a static route. This route should be included by default.

      The RHEL docs do not mention this.

  • Ibanez Aug 28, 2011 @ 1:08

    How if eth1 have 2 class ip ?

  • Cloud Strife Sep 16, 2011 @ 6:37

    I got up to the point where you have to edit

    I dont have that file….
    Its a clean install too….

  • Joel Nov 16, 2011 @ 22:45

    Ok how do I remove the bridge?

    • Floyd Maloto Nov 30, 2011 @ 19:58

      Delete ifcfg-brX and restart the network, make sure you restore your route-eth0 file if you’re removing the private network bridge

  • Satheesh Mar 14, 2012 @ 8:12

    Actually i am using wireless to connect to my modem (ifcfg-wlan0) from my host machine. if i create bridge as br0, in my host machine, will there be any change in ifcfg-br0 for wireless setup.
    Also, whether i need to include type=bridge parameter in ifcfg-wlan0 file of my host machine?

    Wheter i need to use eth0 or wlan0 in my kvm for connecting this bridge.

  • George Mar 23, 2012 @ 17:45

    What if I have only one nic which is connected (wired) to a wireless router and internet gateway and I want my guest VMs accessible from the LAN and can access the internet as well?

    Appreciating your support.

  • rtt Mar 26, 2012 @ 22:31

    Don’t try this on a remote production machine with a public IP……you’ll lose connectivity. I haven’t found a guide for bridging anything yet that won’t cause a production machine to go down :(

  • scooper Mar 28, 2012 @ 20:27

    My RHEL 5.8 box has one nic with two static IP’s (one VIP) – I have a DHCP server in my environment – do I need bridging?

  • damien May 23, 2012 @ 17:39

    How do you map your VM to use br0 ? When adding your VM using virt-manager, which network should my VM card be added to ?

    If I add to virbr0, i get mapped to the 192.168.x.x/24 private network.
    I can’t seem to create a new network with the same network as br0 cause it doesn’t allow it.
    Any help appreciated.

  • CheapIndianITGuy Mar 4, 2013 @ 22:20

    This is so idiotic. Doing things round about way in redhat KVM virualization. Just use Oracle’s Virtual box. So much easier and not at all confusing.

  • Jay Johnson Jun 15, 2013 @ 18:08

    @ CheapIndianITGuy: Why would anyone do this in Oracle virtualbox if their goal was to be an RHCSA or RHCE???? It defeats the purpose of developing a level of proficiency with RedHat KVM (a “known” RH Linux test objective) as well as gaining an overall familiarity of the OS’s functionality. Heck, even a linux enthusiast can gain from learning this method.

    Personally, the guy who delves a bit deeper into the woodworks has more than a “job;” he has a “career…”

  • gohar Jul 6, 2013 @ 12:23

    Thanks for the good work friends..
    I am also having bit issue in my KVM host machine.

    1- I have one eth0 interface in my HOST Machine.
    2- KVM Installed on RHEL 6.0 and XP is running as Guest

    I try making bridge from KVM GUI interface with eth0 for my KVM guests to use internet . BUt first it hangs up..i forcefully close the GUI of making bridge with eth0 and then I try remove “rm /etc/sysconfig/network-scripts/ifcfg-br0”

    File is removed but i didn’t get my eth0 back to normal When i use ifup eth0,it gives me:

    :: ERROR ::
    SIOCGMIIPHY on ‘eth0’ failed: Resource temporarily unavailable SIOCGMIIPHY

    Please i am not very experienced but i need help in this regard, ??

    Really thankful friends if you just help me in this

  • ChiefEngr Jul 16, 2013 @ 20:22

    Nice write-up. You apparently know what you are doing, so while I plan to study your post carefully and see if I can solve my own question(s) later tonight, I thought I would post my target topology and perhaps someone can let me know what is and isn’t possible, and perhaps point me in the right direction. Thanks in advance for any help!

    My host platform has 4 GigE ports and is running CentOS 6.3 with KVM virtualization. I will have three different VMs running — two will probably be Windows 7 and one will be RHEL. What I want to accomplish is to assign a separate, independent GigE port to each of the VMs. In a picture:

    eth0 Host System
    eth1 VM1
    eth2 VM2
    eth3 VM3

    The Host system will not use eth1, eth2, or eth3 *at all* and should not respond to any traffic on them. Similarly, each VM is oblivious to the traffic on the three ports that are not assigned to it. And if a VM needs to talk to different VM, the traffic should leave the platform via one port, be routed by the external network(s) and fed back in via a different port (assuming a route exists). [and by ‘external network’, I mean outside the VM Host, not outside the building]

    I know how to use ONE port to give each VM its own connection to the external network with unique MAC and IP Addresses, so I suppose I could implement a similar scheme where each VM gets its own connection via a different physical port, but how do I tell the host itself to keep its hands off that traffic.

    I am convinced there is a simple solution to this but I think I keep getting caught up in unnecessary complications (and confusions).

    Thanks in advance!

  • Tarek Esmail Nov 20, 2013 @ 11:54

    How i can add to NICs to KVM machine 1 for private and the 2 for public ?

  • Benjo Jun 19, 2014 @ 2:29

    is it mandatory to assign IP on bridge device ? Can we directly assign public IP to guest vm ?

  • Jaffo Oct 20, 2014 @ 19:18

    I’m trying to set up a KVM host with multiple NICs in a slightly different manner. I have two integrated broadcom nics on the motherboard and a PCIe board with 2x 10000Gbe fiber ports.

    The ixgbe port I am using works fine when I assign an IP, but I want it 802.1Q tagging to work between the local fiber port and the switch.

    The intent is to let the host communicate on eth0 for its own management and connectivity, and all the guest VMs to have a local static IP and a connection to a virtual device (bridge, I believe) talking on the appropriate VLAN.

    I think I need to create multiple virtual-bridge interfaces, one for each VLAN, but I’ve not found this clearly documented anywhere yet.

    Any ideas?

  • M Jul 21, 2016 @ 12:59

    Great howto but if my local lan is how should the static route look ?

  • Chad Oct 3, 2016 @ 12:58

    I have Centos 6 box installed with a few KVM machines. My question is how to add bulk IPs to a specific VM without doing it manually via SolusVM control panel.

    I followed your guide, but I think this is more specific for multiple NIC cards. Would appreciate if you can explain how one can add bulk IPs to a KVM VM on a Centos 6x NODE.

    I already have the first 3 steps set up accordingly.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @ webmaster@cyberciti.biz