Configure bridge for KVM on Debian Bookworm
Table of Contents
This is mainly for myself to remember how I did it. Might be helpful for others as well.
Install bridge-utils#
The bridge-utils are needed to configure a bridge.
apt install bridge-utils
Configure the bridge interface with DHCP#
Check with the following command which interface your physical interface is
ip -f inet a s
Mine is enp1s0
Create the file /etc/network/interfaces.d/br0. I prefer using DHCP over a static configuration. It allows me to configure everything on my DHCP server.
## DHCP ip config file for br0 ##
auto br0
# Bridge setup
iface br0 inet dhcp
bridge_ports enp1s0
Restart the network
systemctl restart networking
Configure interface for KVM#
Create a xml file, e.g. host-bridge.xml
<network>
<name>host-bridge</name>
<forward mode="bridge"/>
<bridge name="br0"/>
</network>
Execute the following commands to configure the interface for KVM
virsh net-define host-bridge.xml
virsh net-start host-bridge
virsh net-autostart host-bridge
Firewall#
Allow all traffic on bridge interface
firewall-cmd --add-interface br0 --zone=trusted --permanent
firewall-cmd --reload
Read other posts