In this article I will share step by step guide to configure bridged network in virt-manager (Virtual Machine Manager).
Virtual Machine Manager provides a graphical tool for administering virtual machines for KVM, Xen, and LXC. Start, stop, add or remove virtual devices, connect to a graphical or serial console. You can also see resource usage statistics for existing VMs on local or remote machines. Uses libvirt as the backend management API.
What is Bridged Networking?
Bridged networking (also known as network bridging or virtual network switching) will place virtual machine network interfaces on the same network as the physical interface. Bridges require minimal configuration and make a virtual machine appear on an existing network, which reduces management overhead and network complexity. As bridges contain few components and configuration variables, they provide a transparent setup which is straightforward to understand and troubleshoot, if required.
Steps to configure bridged network in virt-manager
To configure bridged network in virt-manager for your virtual machine you must have a network bridge
active on your host machine so make sure your host have an active working bridge network interface configured on your host machine.
Next install virt-manager
on your host machine
Create a new virtual machine by adding all the resources like CPU, Storage, Memory etc.
Next Add NIC card (if not already added) as shown below by clicking on Add Hardware
Look out for the bridge interface from the drop down menu. If the bridge available on your host is shown then you can directly select that bridge but if it is not visible in the drop down menu then select Specify shared device name
as shown in the image.
Lastly provide the bridge name from your host machine as shown in the image. The virt-manager will try to connect to the provided bridge interface once you apply the changes.
Now I already have a bridge network interface nm-bridge1
, on my host machine
nm-bridge1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.43.138.12 netmask 255.255.255.255 broadcast 10.43.138.12 inet6 fe80::9edc:71ff:fe77:ef59 prefixlen 64 scopeid 0x20 ether 9c:dc:71:77:ef:59 txqueuelen 1000 (Ethernet) RX packets 46 bytes 2324 (2.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 37 bytes 5336 (5.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
So I will use this interface to configure bridged network in virt-manager.
Click on Apply
and power on the VM.
Once your virtual machine is UP you can continue with the network configuration using the same network subnet as your physical host's bridge interface or if you have a DHCP server then you can leave the default configuration and the interface should be able to get the IP address automatically.
Now my vm is also running on the same subnet as the bridge interface from the host Linux node.
# ifconfig ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.43.138.27 netmask 255.255.255.224 broadcast 10.43.138.31 inet6 fe80::5054:ff:fea2:5a8 prefixlen 64 scopeid 0x20 ether 52:54:00:7f:7b:ef txqueuelen 1000 (Ethernet) RX packets 132006 bytes 71553811 (68.2 MiB) RX errors 0 dropped 248 overruns 0 frame 0 TX packets 25193 bytes 13135239 (12.5 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I hope this article to configure bridged network in virt-manager was useful. Let me know your suggestions and feedback using the comment section.