How does one set up tun and tap interfaces on systems that use netplan?
Normally you'd use pre-up in /etc/network/interfaces to call ip tuntap for creating the interface, but I haven't found anything in the netplan docs to do this.
linux-networkingubuntu-18.04
How does one set up tun and tap interfaces on systems that use netplan?
Normally you'd use pre-up in /etc/network/interfaces to call ip tuntap for creating the interface, but I haven't found anything in the netplan docs to do this.
Best Answer
I ran into this problem when upgrading to 18.04 broke my tap based OpenVPN server. It is quite annoying when a headless server just stops working because Ubuntu dropped support for defining bridges in /etc/network/interfaces. There are a few examples already but pretty much you need to create a .yaml file in /etc/netplan that looks something like one of the configs below. Note that you will need the
bridge-utils
package installed.Replace
eth0
with the name of your ethernet device. You can find this usingifconfig -a
.Additionally you can set the MAC address of the bridge using the
macaddress: xx:xx:xx:xx:xx:xx
option wherexx:xx:xx:xx:xx:xx
is replaced with the address you want to use./etc/netplan/00-bridge.yaml
For DHCP:
For a static IP: