Netplan

Netplan is ifupdown replacement for Ubuntu. It’s used by default in Ubuntu Server.

Static IPv6

/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:
    ens18:
      addresses:
          - 192.0.2.10/24
          - 2001:db8:cafe::1337:1/64
      gateway4: 192.0.2.1
      gateway6: 2001:470:cafe::1
      nameservers:
          search: [ example.com ]
          addresses:
              - "192.0.2.1"
              - "2001:db8:cafe::1"