An older version of KVM running on your Linux host won't offer you an easy way to create a bridged network interface. Fortunately, you can manually perform this procedure in Red Hat Enteprise Linux (RHEL) 6.3.
Networking with KVM infrastructures
Most virtual infrastructures use four kinds of networking, but KVM infrastructures often don't include one of those types: the bridged network.
The first type of networking, Network Address Translation, is used to install the virtual machine (VM) behind NAT. This is helpful if the VM has to access the Internet but no external machine has to access the VM. It is not an ideal option if you want to offer public services on the VM.
Use another type, routed networking, to install the VM on its own dedicated network. Traffic will be routed between the host network and the virtual network on which you install the VM. The third type, host-only networking, allows you to test functionality in a safe and isolated environment.
Finally, the benefit of bridged networking is that it allows a VM to access the same physical network as that on which the host machine is installed.
How to make a bridged networking interface
To create a bridged network interface, you first need to prepare the host. The preparation steps vary between Linux distributions, but the procedure below has been verified on RHEL 6.3:
- On the host computer, stop NetworkManager by using the service NetworkManager stop command, followed by the chkconfig NetworkManager off command.
- Modify the network configuration on the host computer. You need to create a virtual bridge network interface by creating the file /etc/sysconfig/network-scripts/ifcfg-br0and giving this file the following contents (be sure to change the IP addresses in the example to match your network environment):
3. Modify the contents of the file that controls your physical network card. Typically this is /etc/sysconfig/network-scripts/ifcfg-eth0, but the file name may differ depending on your configuration. If you're not sure, type ip link show to find out which network interfaces your host computer is using. The physical network card becomes a subordinate of the bridged network interface, so the configuration file will only have the following contents:
Type service network restart to restart the network.
At this point, the ip link show command should now show the virtual bridge. You can also use the brctl show command to display the bridging topology on the host computer. The topology will show that the normal physical network card is now a part of the bridge configuration. You can then install VMs on the host, and they will automatically bind to the bridged network card you created.
Dig Deeper on Network virtualization