Linux, Windows, Virtualization, OpenSource & Blogging

Configure bridged networking for KVM on Ubuntu 16.04 / Ubuntu 14.10

0

Ubuntu Logo

Bridged networking or network is a dedicated network card to a virtual machine which provides communication path to outside network, this must be setup before creating a virtual machine using Virtual Manager.

READ: How to install and use KVM on Ubuntu

This guide will help you to configure bridged networking on Ubuntu 16.04 / Ubuntu 14.10, you can either use a command line or graphical mode.

Command line:

Edit interface file to create bridge “br1“, this should be executed on KVM host. My machine has two network cards eth0 and eth1, so I have created a bridge using both network card.

sudo nano /etc/network/interfaces

##Bridge  Name ###
auto br1
### Bridge Information
iface br1 inet static
bridge_ports eth1 eth0
bridge_stp on
bridge_fd 0.0
### Bride IP ###
address 192.168.12.7
netmask 255.255.255.0
network 192.168.12.0
broadcast 192.168.12.255
gateway 192.168.12.1
dns-nameservers 8.8.8.8

Bring up the bridge.

sudo ifup br1

Graphical Mode:

Make sure you have graphical mode installed, click on the dash and search for Virtual Machine Manager.

Ubuntu 14.10 - Bridged Networking Virt Manager
Ubuntu 14.10 – Bridged Networking Virt Manager

or

virt-manager

Edit –> Connection details –> Click on Plus sign.

Configure bridged networking for KVM on Ubuntu 16.04 - Bridged Networking Connection Details
Configure bridged networking for KVM on Ubuntu 16.04 – Bridged Networking Connection Details

Choose bridge as an interface type and then click on forward.

Configure bridged networking for KVM on Ubuntu 16.04 - Bridged Networking Interface type
Configure bridged networking for KVM on Ubuntu 16.04 – Bridged Networking Interface type

Set a Name, start mode as on boot and choose to activate now.

Configure bridged networking for KVM on Ubuntu 16.04 - Bridged Networking Configure Interface
Configure bridged networking for KVM on Ubuntu 16.04 – Bridged Networking Configure Interface

You can configure ip address by clicking on Configure right to IP settings.  Once IP is configured, click OK.

Configure bridged networking for KVM on Ubuntu 16.04 - Bridged Networking Configure IP for bridge
Configure bridged networking for KVM on Ubuntu 16.04 – Bridged Networking Configure IP for bridge

Clik on finish, Virtual Machine Manager will create a bridge called “br1”.

Configure bridged networking for KVM on Ubuntu 16.04 - Bridged Networking
Configure bridged networking for KVM on Ubuntu 16.04 – Bridged Networking

Verify ip address by using the following command.

Configure bridged networking for KVM on Ubuntu 16.04 - Bridged Networking Verifying details
Configure bridged networking for KVM on Ubuntu 16.04 – Bridged Networking Verifying details

Thats All.

You might also like
Shares