I'm trying to replicate a DigitalOcean VM on my home network. They are using a static IP configured in /etc/netplan/50-cloud-init.yaml. It has stuff for IPv4, and v6 and works how I want it to. My home VM with default 18.04.2 has only the following:
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
ens33:
dhcp4: true
version: 2
I created /etc/netplan/99-ipv6.yaml with appropriate settings and that adds the static IP with the right prefix, gateway, and DNS. I tried with dhcp6: false in both this file and the above mentioned file to no effect.
network:
version: 2
ethernets:
ens33:
addresses:
- 2607:f2c0:beef:beef::200/64
gateway6: 2607:f2c0:beef:beef::1
match:
macaddress: 00:re:al:ma:ca:dd:re:ss
nameservers:
addresses:
- 2001:4860:4860::8888
- 2001:4860:4860::8844
search: [mydomain.net]
How do I disable the auto configured IPv6 address? It is a proper address with my assigned prefix, but I only want the static address. Much of what I have seen here disables IPv6 all together, or doesn't use the 18.04 modern conventions for changes. Others mention /etc/sysctl.conf, but by default everything in that file is commented out, so I'm not sure what is necessary.
Below is the output from ip a:
inet6 routable-address/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 86165sec preferred_lft 14165sec