What you'd need to do first is to put your hypervisor's network on a bridged interface that the VMs can connect to.
Let's say this is going to be br0
and the current physical interface is eth0
.
Any IP configuration you have on eth0
should be moved to br0
.
The way to do this is persistently depends on how you configure your network and that differs even on the same distro (NetworkManager, netplan, systemd-networkd, classic distro scripts - all have different configuration).
If you wanted to do this once on the command line to try it out the below may work, and if you mess it up, a reboot would put your configuration back:
brctl addbr br0
ip a flush eth0
ip a add a.b.c.d/xx dev br0
brctl addif br0 eth0
ip link set br0 up
Then you can either attach a new network to your VM which is on the bridge (this can be done while the VM is running), or change the current interface (this would require a shutdown of the VM).
In general, all this is much easier if you use virt-manager
- there is a GUI that makes the whole experience very easy.
Otherwise, you can add a new network to your VM with:
virsh attach-interface --domain your-vm-name \
--type bridge \
--source br0 \
--model virtio \
--config \
--live
Here, --live
will add the configuration to the running machine, and --config
would persist it to its XML file so it is there after your shutdown the VM.
Alternatively, you can virsh edit your-vm-name
and edit the network configuration you have now to mimic the one you posted (replace the current <interface>...</interface>
so it is type bridge, source br0. You can keep the model and mac, and pci information as it is.