Configure KVM Bridge Network on Debian 10
Before you configure bridge network, make sure you have bridge-utils installed.
1 |
apt install bridge-utils |
You may also need ifdown and resolvconf packages installed
1 |
apt install ifupdown resolvconf |
Here is the default /etc/network/interfaces i had on the server
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
root@PAR-199235:~# cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto enp1s0f0 allow-hotplug enp1s0f0 iface enp1s0f0 inet static address 163.172.107.119 broadcast 163.172.107.255 netmask 255.255.255.0 gateway 163.172.107.1 dns-nameservers 8.8.8.8 root@PAR-199235:~# |
enp1s0f0 is name of the network interface card on the server.
To convert it to brudge configuration. You need to replace enp1s0f0 with br0.
Then add following to the file
1 2 3 |
bridge_ports enp1s0f0 bridge_stp off bridge_maxwait 5 |
Remember to replace enp1s0f0 with your actual network card interface name.
Also remove the line
1 |
allow-hotplug enp1s0f0 |
Here is the final /etc/network/interface file i have.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
root@PAR-199235:~# cat /etc/network/interface cat: /etc/network/interface: No such file or directory root@PAR-199235:~# cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto br0 iface br0 inet static address 163.172.107.119 broadcast 163.172.107.255 netmask 255.255.255.0 gateway 163.172.107.1 bridge_ports enp1s0f0 bridge_stp off bridge_maxwait 5 dns-nameservers 8.8.8.8 root@PAR-199235:~# |