Ubuntu 18 / 20
This guide assumes you want your bridge name to be virbr0 if you want any other name you’re free to use it but you have to update the bridge name in the slave settings in master panel.
If you want to make this change permanent please follow the following instructions
For Legacy Networks
Lets assume your network file initially may look like this /etc/network/interfaces
x
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8
Ok now let's convert that configuration into a bridge configuration.
# The loopback network interface
auto lo
iface lo inet loopback
auto virbr0
iface virbr0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 8.8.8.8
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
For Netplan Networks
If you're comfortable using netplan then the following guide might be helpful, however, setting up ifupdown package will get rid of netplan and give you control to deal with legacy network format ( eg. /etc/network/interfaces ).
Location /etc/netplan/whatever-named-network.yaml
# For Hetzner based servers
network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: no
bridges:
virbr0:
addresses:
- 192.168.1.2/24
interfaces: [ eno1 ]
routes:
- on-link: true
to: 0.0.0.0/0
via: 192.168.1.1
macaddress: 00:16:3e:6d:be:34
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
# For other server providers
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
bridges:
virbr0:
addresses:
- 192.168.1.2/24
interfaces: [ eno1 ]
gateway4: 192.168.1.1
macaddress: 00:16:3e:6d:be:34
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4