If you want to configure all the parameters of your virtual machine, you can issue the command like this:
virsh edit ubuntu22.04-test
In the GUI of NIC configuration, you can choose a configuration item from a drop box,such as “default”,‘bridged-network’ or ‘docker machines’.
You also can issue this command to query the network defined:
virsh net-list
you can also edit those configuratoin by issue the command below, like this:
virsh net-edit bridged-network
sometimes you want to define your own network configuration, you can edit a network configuration in bridged-network2.xml like this:
Then you issue these commands to define this network configuration:
virsh net-define bridged-network2.xml
virsh net-autostart bridged-network2
virsh net-start bridged-network2
Noted that you should create bridge br1 first:
brctl addbr br1
After this, you can select bridged-network2 option on the libvrit virtual machine configuration UI.
Reference:
- https://wiki.libvirt.org/Networking.html#bridged-networking-aka-shared-physical-device
- https://wiki.debian.org/BridgeNetworkConnections