You are here

Configuring a bridge in Ubuntu for KVM


In order for the network to work correctly on KVM virtual machines created on the Ubuntu host, you need to configure the bridge. If you do not configure it, the machine will have access to the Internet, but there will be no access to the other hosts on that network. The configuration is similar to setting up a network in Ubuntu with minor changes to the config.

To configure the bridge you need:

1) Install bridge-utils:

sudo apt-get install bridge-utils

2) Edit the configuration file - /etc/network/interfaces

sudo nano /etc/network/interfaces

In it, you need to change the section relating to your network interface to:

# The primary network interface
# For the place eno1 should be the name of your network interface
auto eno1
iface eno1 inet manual

And below you need to add lines:

auto br0
iface br0 inet dhcp
        bridge_ports eno1
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

If you want to register a static IP, then before bridge_ports you need to add lines with address settings, masks, gateway, DNS.

3) Restart the network:

sudo /etc/init.d/networking restart

4) Check settings:

ifconfig br0

You should see the address, the bridge configuration is finished, now in the properties of the network interface of the virtual machine you can specify bridge br0, and the network on the virtual machine will have to work as if it was connected to a physical switch.

0 0

Share the article with your friends in social networks, maybe it will be useful to them.


If the article helped you, you can >>thank the author<<