KVM Guest: Shared Physical Network Device With Host (bridging configuration)

www.lau‮irutt‬.com
KVM Guest: Shared Physical Network Device With Host (bridging configuration)

To configure a KVM guest to use a shared physical network device (i.e. bridge) with the host on a Linux system, you can follow these steps:

  1. Install the necessary packages. You will need the bridge-utils package to create and configure the bridge, and the libvirt-bin package to manage virtual machines with libvirt. You can install these packages by running the following command:
sudo apt-get install bridge-utils libvirt-bin
  1. Create a bridge interface. You can create a bridge interface using the brctl utility. For example, to create a bridge interface called br0 that uses the physical Ethernet interface eth0, you can run the following command:
sudo brctl addbr br0
sudo brctl addif br0 eth0
  1. Configure the bridge interface. You will need to configure the bridge interface with an IP address and netmask. You can do this using the ip command. For example, to set the IP address to 192.168.1.1 and the netmask to 255.255.255.0, you can run the following commands:
sudo ip addr add 192.168.1.1/24 dev br0
sudo ip link set br0 up
  1. Configure the virtual machine to use the bridge.
Created Time:2017-10-29 22:08:50  Author:lautturi