I installed the Ubuntu 18.04 and wanted to have a bridge interface instead of using the main interface directly for KVM virtualization:
Here is the Netplan default configuration after installation, which worked well:
----
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp4s0:
addresses: [ 176.9.199.230/27 ]
gateway4: 176.9.199.225
nameservers:
addresses:
- "8.8.8.8"
After reading the documentation for Netplan, I tried this setting for bridge mode:
---
network:
version: 2
renderer: networkd
ethernets:
enp4s0:
dhcp4: no
dhcp6: no
bridges:
vmbr0:
dhcp4: no
dhcp6: no
interfaces: [ enp4s0 ]
addresses: [ 176.9.199.230/27 ]
gateway4: 176.9.199.225
nameservers:
addresses:
- "127.0.0.1"
parameters:
stp: false
forward-delay: 1
hello-time: 2
max-age: 12
As you can tell from the IP address, the server is hosted on Hetzner.
On Ubuntu 16.04, bridges worked well with ifupdown, but now that Ubuntu 18.04 has Netplan instead of ifupdown, I need to know how configure a bridge in Netplan.