Operations 7 min read

How to Configure IPv6 Addresses on Ubuntu: Step-by-Step Guide

Learn how to enable and configure IPv6 on Ubuntu, covering its benefits, checking interface support, editing Netplan or legacy network files, setting static addresses, applying changes, and verifying the configuration with practical command examples.

Open Source Linux
Open Source Linux
Open Source Linux
How to Configure IPv6 Addresses on Ubuntu: Step-by-Step Guide

Configuring IPv6 addresses in Ubuntu is essential for enhancing network functionality and security. This brief guide walks you through the simple yet necessary process of setting up IPv6 on an Ubuntu system, ensuring you stay up‑to‑date with the latest Internet protocol technology.

What is an IPv6 address and its main functions

IPv6 (Internet Protocol version 6) is the latest version of the Internet protocol, providing a system for identifying and locating computers on a network and routing traffic on the Internet. In Ubuntu, as in other operating systems, IPv6 expands the available IP address space and addresses the limitations of IPv4.

Larger address space: IPv6 uses 128‑bit addresses, vastly increasing the number of possible addresses compared to IPv4’s 32‑bit addresses.

Simplified header structure: IPv6 headers are more streamlined, improving processing efficiency.

Improved security: IPv6 was designed with security in mind; IPsec is built into IPv6, offering end‑to‑end encryption and authentication.

No need for NAT: The abundant address space eliminates the need for Network Address Translation, simplifying routing and device configuration.

Automatic configuration: IPv6 supports both stateful and stateless address configuration (SLAAC), reducing reliance on DHCP servers.

In Ubuntu, IPv6 is usually enabled by default. You can manage it with tools such as ifconfig, ip, or by editing configuration files like /etc/network/interfaces or using GUI network managers.

Process of configuring an IPv6 address in Ubuntu

The steps vary slightly between desktop and server editions and between static and dynamic addressing. Below is a general guide for configuring a static IPv6 address.

1. Check IPv6 support

Open a terminal and run one of the following commands to see if an IPv6 address is already assigned, indicating that IPv6 is enabled. Ifconfig or

ip a

2. Edit the network configuration file

Edit the appropriate configuration file. For newer Ubuntu versions that use Netplan (18.04+), the file is typically located at /etc/netplan/01-netcfg.yaml. Older versions may use /etc/network/interfaces. sudo nano /etc/netplan/01-netcfg.yaml Note: replace 01-netcfg.yaml with the actual file name on your system.

3. Configure a static IPv6 address

Add the IPv6 details. Example Netplan configuration:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:  # replace with your network interface name
      dhcp4: no
      dhcp6: no
      addresses:
        - 2001:db8::c0ca:1eaf/64  # replace with your IPv6 address and prefix
      gateway6: 2001:db8::1       # replace with your IPv6 gateway
      nameservers:
        addresses:
          - 2001:4860:4860::8888  # Google's IPv6 DNS
          - 2001:4860:4860::8844

For older systems, the /etc/network/interfaces entry might look like:

iface eth0 inet6 static
address 2001:db8::c0ca:1eaf
netmask 64
gateway 2001:db8::1

4. Apply the changes

After editing the file, apply the configuration.

For Netplan: sudo netplan apply For older versions: sudo ifdown eth0 && sudo ifup eth0 Replace eth0 with your actual network interface name.

5. Verify the configuration

Check that the IPv6 address is correctly configured: ip -6 addr show You should see the new IPv6 address listed under the appropriate interface.

Additional notes

Replace eth0 and enp0s3 with the actual names of your network interfaces.

The example IPv6 address 2001:db8::c0ca:1eaf/64 and gateway 2001:db8::1 are placeholders; use the addresses provided by your network administrator or ISP.

Ensure the network prefix (e.g., /64) matches your network’s configuration.

If you prefer a GUI, you can configure IPv6 through the system settings panel’s network section.

IPv6LinuxNetwork ConfigurationUbuntuNetplan
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.