Linux KVM Bridge network on Ubuntu
On Ubuntu 18.04 server, first i get Ubuntu to use /etc/network/interface, by default Ubuntu 18.04 and newer use netplan.
First install ifdown
1 |
apt install ifupdown -y |
Install bridge utils and resolvconf.
1 |
apt install bridge-utils resolvconf |
Now you can configure your network interface by editing file
1 |
vi /etc/network/interface |
Here is my network configuration on an OVH server.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
root@ns3048991:~# cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d auto eno3 iface eno3 inet static address 149.202.199.137 netmask 255.255.255.255 broadcast 149.202.199.137 gateway 149.202.199.254 dns-nameservers 8.8.8.8 8.8.4.4 root@ns3048991:~# |
To convert this interface to bridge network, do the following
1) Replace all occurance of “eno3” with “br0”
2) Add following lines
1 2 3 |
bridge_ports eno3 bridge_stp off bridge_maxwait 5 |
In above, replace “eno3” with name of your physical interface.
Here is my final network configuration.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
root@ns3048991:~# cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d auto br0 iface br0 inet static address 149.202.199.137 netmask 255.255.255.255 broadcast 149.202.199.137 gateway 149.202.199.254 bridge_ports eno3 bridge_stp off bridge_maxwait 5 dns-nameservers 8.8.8.8 8.8.4.4 root@ns3048991:~# |