How to use a bridged network in virt-manager?

After following this steps I’m creating a new virtual machine in virt-manager and I want to use a bridged network. On the Manjaro guide it doesn’t mention it and on the Network bridge ArchWiki it says to use iproute2 because

The use of brctl is deprecated and is considered obsolete. See the Notes section in brctl(8) § NOTES for details.

I followed this steps

# ip link add name vnet0 type bridge
# ip link set dev vnet0 up

To find the ethernet interface I wrote

$ ip address
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.130/24 brd 192.168.1.255 scope global dynamic noprefixroute enp4s0
       valid_lft 81291sec preferred_lft 81291sec
    inet6 xxxx::xxxx:xxxx:xxxx/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

and copied the interface name with the computer ip.

# ip link set enp4s0 up
# ip link set enp4s0 master vnet0

After doing this I lost my internet connection so I had to undo it with

# ip link set enp4s0 nomaster

in the virt-manager GUI there are two possible sessions to choose from:
QEMU/KVM user session - as far as I know you can not use the bridge there
and
QEMU/KVM system session
click on “Details” in the right click context menu
and enable the virtual network and start it
the name of the interface is virbr0 by default

KVM with the network bridge should work fine for me.

The interface virbr0 uses NAT, not bridge. In some situation, users need to use the network bridge for the connection between other computers and KVM guest in the same local network.


@Individual-Heart-719

I recommend using the command nmcli that comes from the package networkmanager, which is installed by default for many desktop environments. It solved this issue to create a new local interface with the bridge. You do not need to run root.

https://wiki.archlinux.org/title/network_bridge#With_NetworkManager