I have an Ubuntu 16.04 host with 6 LXC/LXD containers connected to the Internet in both directions using a routed setup. Each container gets one IPv4 address from a routed IPv4/29 subnet. In addition it gets one IPv6 address from an IPv6/64 subnet.
Now, as I'm migrating to Ubuntu 18.04 I wanted to migrate my setup to Netplan as well but got stuck. I have no problems creating the basic Netplan configuration for the host. But I dont know how to create the "bridge/router". Any attempt to configure a bridge (layer 3) failed in one or the other way.
This is how my old configuration looks like:
# /etc/network/interfaces # Loopback device: auto lo iface lo inet loopback iface lo inet6 loopback # device: eth0 auto eth0 iface eth0 inet static address 184.108.40.206 netmask 255.255.255.192 pointopoint 220.127.116.11 gateway 18.104.22.168 iface eth0 inet6 static address 2a01:4f9:c010:32bc::2 netmask 128 gateway fe80::1 up sysctl -p ### From here on I dont know how to do this in Netplan!!! # Bridge router to VMs (brouter) auto br0 iface br0 inet static address 22.214.171.124 netmask 255.255.255.192 bridge_ports none bridge_stp off bridge_fd 0 # Add IPv4 subnet route up ip route add 126.96.36.199/29 dev br0 iface br0 inet6 static address 2a01:4f9:c010:32bc::2 netmask 128 # Add IPv6 route up ip -6 route add 2a01:4f9:c010:32bc::/64
To make it more clear for people who dont know LXC/LXD, I have another host with a much similar configuration for VirtualBox where I called the bridge "virbr0" (instead of "br0" in my example). The VM's in the VirtualBox are then attached to the Bridged Adapter with the name "virbr0".
In the VM's running in the VirtualBox it's a simple static configuration. I have no problems with Netplan inside the VM's. My issues are related to the host only.
Maybe someone can post an example for this kind of routed setup.