On the Discovery network, we automatically configure IPv4 but sometimes to enable IPv6, Netplan needs some tweaks. In Ubuntu NVMe VPS instances, Netplan is used to configure the network and the networking details are provided to the instance using Cloud-init. On Ubuntu instances, we run scripts at startup to automatically add static routes to the gateway. This does not include IPv6 on older OS images.
Get IP Information
In the client area, you can see your IPv6 network information. Navigate to Services > My Services and select your instance. You will need the IPv6 Address and gateway to add to the Netplan configuration files.
Enable IPv6 in Netplan Configuration
Inside the /etc/netplan folder you will find the 50-cloud-init.yaml file. This contains all of the networking information from Cloud-init. Here to enable IPv6 we will make some changes to the default configuration. The file will look like this;
network: version: 2 ethernets: eth0: addresses: - 22.214.171.124/25 gateway4: 10.10.19.117 match: macaddress: ea:7f:f6:2a:cd:01 nameservers: addresses: - 126.96.36.199 - 188.8.131.52 - 184.108.40.206 search: - f2h.cloud set-name: eth0
In some files, you may see an IPv6 address in the Netplan file. This is normal. So, we need to edit the file to specify our IPv6 information. It’s important that you do not use tab in the Netplan file. Only use the spacebar to create spaces and ensure the spaces remain in place.
network: version: 2 ethernets: eth0: addresses: - 220.127.116.11/25 - 2001:41d0:800:2c78::87c6/120 gateway4: 10.10.19.117 routes: - on-link: true to: ::/0 via: 2001:21d0:100:2cff:1 match: macaddress: ea:7f:f6:2a:cd:01 nameservers: addresses: - 18.104.22.168 - 22.214.171.124 - 2001:4860:4860::8888 search: - f2h.cloud set-name: eth0
So, in this file, we have added the IPv6 address to the Netplan file and specified a route to the IPv6 gateway. You do not specify the IPv6 gateway. We have also included IPv6 nameservers. Finally, to enable IPv6 Netplan Save and close the file and test the configuration with netplan try and if all is well issue netplan apply. IPv6 will now function.
How was this article?
You might also like
More from Instance Management
How To Expand A Logical Volume After Attaching Further Space
If you have installed your Discovery instance using a distribution ISO. Then it's likely your drive will be using a …
How To Configure An Internal MySQL Database Server
How To Configure An Internal MySQL Database Server High-value assets like database servers are always a target for hackers. Typically, these …
How To Hotplug Resources To Meet Spikes In Demand
How To Hotplug Resources To Meet Spikes In Demand These days it's important that your network is online as much as …