With Ubuntu 22.04, the gateway
option is deprecated and nearly every example I find for configuring netplan
with static IPv6 uses gateway
.
My ISP's default /etc/netplan/01-netcfg.yaml
only includes dynamic IPv4 and they do not provide DHCP support for IPv6, but they do provide support for static IPv6.
What do I add to the configuration to support IPv6?
$ cat /etc/netplan/01-netcfg.yaml
network:
version: 2
ethernets:
eth0:
dhcp4: true
I should also add that my ISP also does not provide nameserver support for IPv6 but they do provide an IPv6 address and a gateway IPv6 address.
Gateway IPv6 address:
2001:DB8:6404::1
Instance IPv6 address:
2001:DB8:6404:10fB:928a:b151:d721:51bc
Best Answer
First of all - Please take a backup of the file 01-netcfg.yaml.
To configure IPv6, you would need to configure the file
/etc/netplan/01-netcfg.yaml
From your above code, I have assumed the interface server is using eth0
Replace IPv6-Address/IPv6-Netmask & IPv6-Address/IPv6-Netmask with your ISP provided values.
Save the file & to apply the configurations using
Reboot
For Nameservers, I have used Google's Public DNS
You can also use Cloudflares DNS
In case after reboot the Internet Connection does not work properly in your system, Just revert the file
01-netcfg.yaml
& usesudo netplan apply
&sudo reboot now