Ubuntu 22.04

To configure IPv6 on a Ubuntu 22 server you will have to edit the /etc/netplan/01-netcfg.yaml file. In this example, we will use the following IPv6 subnet: 2a00:7c80:0000:0112::/64

In an /64 IPv6 subnet there are an enormous amount of addresses, we will setup one address as an example. For the correct usage please refer to rfc5952. Below an example how to configure IPv6 address  2a00:7c80:0000:0112::2

First open the 01-netcfg.yaml with the text editor you prefer.

[root@worldstream ~]# nano /etc/netplan/01-netcfg.yaml

Add the IPv6 address with any number above 1 under the addresses section.

Ubuntu 22 does not officially use the gateway4 and gateway6 notations anymore.

Instead, you will see a “route:” parameter.

For IPv4 this is usually filled in, but for IPv6 this needs to be added manually.

This should be as follows :

- to: default

        via: 2a00:7c80:0000:0112::1

Below an example with an IPv6 address configured.

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      accept-ra: false
      addresses:
      - 192.168.1.2/24
      - 2a00:7c80:0000:0112::2/64
     routes:
- to: default
via 192.168.1.1
- to: default
via 2a00:7c80:0000:0112::1
nameservers:
          addresses:
              - "217.23.0.121"
             - "93.190.136.10"

After the IP address is configured you will have to apply the adjustments. You can do this with the following netplan command.

[root@worldstream ~]# netplan apply

To check if IPv6 is configured properly you can check this by using ping6. For example, you can ping the Google IPv6 DNS address.

[root@worldstream ~]# ping6 2001:4860:4860::8888

The response to the ipv6 ping request should be similar to the below example.

[root@worldstream ~]# ping6 2001:4860:4860::8888
PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
64 bytes from 2001:4860:4860::8888: icmp_seq=1 ttl=120 time=1.38 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=120 time=1.35 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=3 ttl=120 time=1.36 ms
64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=120 time=1.35 ms