ipv6 tunnel in Ubuntu 17.10?

I used to be able to do the configuration below with no issues in /etc/network/interfaces but now it's not picked up anymore. How do I configure a ipv6 tunnel now? I see see the new netplan software to configure interfaces but I can't seem to find the equivalent commands to the ones below

auto he-ipv6
iface he-ipv6 inet6 v4tunnel
        address 2001:550:120e:6b7::2
        netmask 64
        endpoint 184.105.253.10
        local my.public.ip.addr
        ttl 255
        gateway 2001:550:120e:6b7::1

How do I configure Ubuntu to keep this configuration permanently on the next reboot?


I figured it out.

I created the following files:

/etc/systemd/network/he-ipv6.network

[Match]

[Network]
Tunnel=he-ipv6

/etc/systemd/network/he-ipv6-tunnel.netdev

[Match]                                                                                                                                                                                                            

[NetDev]                                                                                                                                                                                                           
Name=he-ipv6                                        
Kind=sit                                            

[Tunnel]
Independent=true                                            
Local=192.168.0.x #Private IP if behind NAT or Public IP without NAT                                   
Remote=184.105.250.46 #Tunnel broker's IPv4 address                         
TTL=255

/etc/netplan/01-netcfg.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
      he-ipv6:
          dhcp4: no
          dhcp6: no
          addresses: ['2001:470:xxx:xxx::2/64']
          gateway6: 2001:470:xxx:xxx::1
      enp0s3:
      ...

Where 2001:470:xxx:xxx::2/64 is your Client IP address from tunnelbroker.net

Then reboot or restart your network with systemctl restart systemd-networkd && netplan apply

Update/Warning This won't work unless you're already using Ubuntu Bionic Beaver or specifically speaking Systemd Version 235. You need the Independent flag under [Tunnel] for this configuration to work on every reboot along with systemd version 235.

The Independent flag doesn't work in systemd version 234 and below. You can check your systemd version with systemd --version