Hot Summer Sale - up to 36% OFF

How to Configure IPv6 on a Linux Dedicated Server

How to Configure IPv6 on a Linux Dedicated Server
Published on Sep 2, 2025 Updated on Sep 5, 2025

The internet is continuously changing, and the depletion of IPv4 addresses is not far-fetched. IPv6 is not something of the future anymore but a requirement that needs to be considered now. Having a fundamental understanding of IPv6 is essential for future-proofing your infrastructure. It can play a crucial role in decision-making, especially when managing a dedicated Linux server, particularly one running the latest Ubuntu 24 release.

This guide has everything you need to know to configure IPv6 on a Linux dedicated server. At the end of this guide, you will have a working IPv6 solution to the point where you can accept the new era of the internet connection.

#Why IPv6 matters now more than ever

Before going over the technical details, let us understand the importance of IPv6:

  • Address Exhaustion: IP addresses (IPv4) are running out, and most of the increasing devices and services are becoming dependent on IPv6.
  • Scalability: IPv6 provides a number of addresses that are nearly astronomical, which means that it can connect every device on Earth.
  • Efficiency: IPv6 has simplified the process of network configuration through stateless autoconfiguration (SLAAC) and also enhances the routing efficiency.
  • Security: IPv6 has been thought out with security in mind, with IPsec being a mandatory component.
  • Performance: In multiple cases, IPv6 is superior in performance; its packet headers are less complicated, and the routing paths are more straightforward.

To a dedicated server case, IPv6 will enable your server to connect directly with services and users that exclusively use IPv6, increasing its reach and making it compatible in the long term.

#Prerequisites

Before starting, ensure you have:

#Configuring IPv6 on a Linux dedicated server

Below are the steps involved in configuring IPv6 on a Linux dedicated server.

#Step 1: Verify IPv6 support

First, check if your server has IPv6 enabled and if the kernel supports it.

Command Line
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
Output0
  • 0 means IPv6 is enabled.
  • 1 means IPv6 is disabled.

If the output is 1, enable IPv6 by running:

Command Line
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0

#Step 2: Check current network configuration

Verify the network interfaces and their current IPv6 configuration.

Command Line
ip -6 addr show
Output1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fd7d:106f:a73e:8d9c:b310:2e19:39e5:628f/64 scope global temporary dynamic 
       valid_lft 604028sec preferred_lft 85297sec
    inet6 fd7d:106f:a73e:8d9c:8483:b6ff:feae:3a4c/64 scope global dynamic mngtmpaddr 
       valid_lft 2591974sec preferred_lft 604774sec
    inet6 fe80::8483:b6ff:feae:3a4c/64 scope link 
       valid_lft forever preferred_lft forever
  • lo is the loopback interface with ::1/128.
  • enp0s1 (or your interface name) may show a link-local address (fe80::/64) or/and a Unique Local Address (fd7d::/64). If no global IPv6 address (e.g., 2001:db8::) appears, you need to configure one.

#Step 3: Configure IPv6 address

Ubuntu 24 uses Netplan for network configuration. Netplan configuration files are located in /etc/netplan/.

#Check Existing Netplan Configuration

List the Netplan configuration files:

Command Line
ls /etc/netplan/
Output50-cloud-init.yaml 01-network-manager-all.yaml

#Backup the Configuration

Always back up the existing configuration:

Command Line
sudo cp /etc/netplan/01-network-manager-all.yaml /etc/netplan/01-network-manager-all-yaml.backup

#Edit the Netplan Configuration

Open the Netplan file for editing:

Command Line
sudo nano /etc/netplan/01-network-manager-all.yaml

Add or modify the IPv6 configuration under the appropriate interface. Here’s an example configuration:

network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp0s1:
      dhcp4: no
      addresses:
        - 192.168.2.107/24
        - 2001:db8:abcd:0012::1/64
      routes:
        - to: default
          via: 192.168.2.1
        - to: default
          via: "2001:db8:abcd:0012::1"

      nameservers:
        addresses:
          - 8.8.8.8
          - 2001:4860:4860::8888

Here, I am configuring the address starting with 2001 to use publicly routable IPv6 addresses. 2001:4860:4860::8888 is the address of Google DNS that your server will use to translate domain names into IP addresses, facilitating outbound connections to other services on the internet.

Below are the details of configuration parameters:

  • addresses: Specifies the static IPv6 address and subnet
  • nameservers: Lists IPv6 DNS servers
  • Save the file (Ctrl+O, Enter, Ctrl+X in nano)

#Step 4: Apply the Netplan configuration

Test and apply the new configuration:

Command Line
sudo netplan try
OutputDo you want to keep these settings?

Press ENTER before the timeout to accept the new configuration

Changes will revert in 88 seconds

Press Enter to accept. If there are errors, Netplan will revert after 120 seconds, allowing you to fix the configuration.

If the test is successful, apply the configuration permanently:

Command Line
sudo netplan apply

#Step 5: Verify IPv6 configuration

Check if the IPv6 address is assigned:

Command Line
ip  -6 addr show
Outputubuntu@ubuntu:~$ ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp0s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 2001:db8:abcd:12::1/64 scope global 
       valid_lft forever preferred_lft forever

Check the routing table:

Command Line
ip -6 route
Output2001:db8:abcd:12::/64 dev enp0s1 proto kernel metric 256 pref medium

#Step 6: Test IPv6 connectivity

Test connectivity to an IPv6-enabled server (e.g., Google’s DNS server):

Command Line
ping6 google.com
OutputPING google.com(2404:6800:4003:c01::8b) 56 data bytes
64 bytes from 2404:6800:4003:c01::8b: icmp_seq=1 ttl=117 time=12.3 ms

#Step 7: Configure the firewall for IPv6

Ubuntu 24 uses UFW (Uncomplicated Firewall) by default. Ensure IPv6 is enabled in UFW.

#Enable IPv6 in UFW

Edit the UFW configuration:

Command Line
sudo nano /etc/default/ufw

Ensure the IPV6 setting is enabled:

IPV6=yes

Save and exit the file.

#Allow necessary ports

For example, allow SSH (port 22) and HTTP (port 80):

Command Line
sudo ufw allow proto tcp to any port 22
OutputRules updated
Rules updated (v6)
Command Line
sudo ufw allow proto tcp to any port 80
OutputRules updated
Rules updated (v6)

Reload UFW:

Command Line
sudo ufw reload
OutputFirewall reloaded
Command Line
sudo ufw status
OutputStatus: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
22/tcp (v6)                ALLOW       Anywhere (v6)             
80/tcp (v6)                ALLOW       Anywhere (v6)  

#Conclusion

When configuring IPv6 on a dedicated Ubuntu 24 server, the main steps are to verify that a feature is supported in the kernel. Following these instructions, your server would become IPv6-ready and make it work in the new networks. To maintain a healthy configuration, you have to frequently consult documentation about the concrete IPv6 configuration at your hosting provider and fiddle to maintain connectivity.

Bare Metal Servers - 15 Minute Deployment

Get 100% dedicated resources for high-performance workloads.

Share this article

Related Articles

Published on May 9, 2022 Updated on Nov 6, 2023

How to Install MongoDB on Ubuntu 20.04 | Step-by-Step Tutorial

Learn how to install and start using MongoDB - an open-source document-oriented NoSQL database that is popular in building fast and scalable applications

Read More
Published on Nov 3, 2023 Updated on Dec 6, 2023

How to Use numpy.where Function [With Examples]

This tutorial illustrates how you can use Python numpy.where function, along with some practical examples.

Read More
Published on Oct 29, 2021 Updated on Jan 24, 2024

How to Install and Configure Apache Web Server on Ubuntu 20.04

Apache is one of the most widely used web servers in the world. Learn how to install and configure Apache Web Server on Ubuntu 20.04 to host your website

Read More
We use cookies to ensure seamless user experience for our website. Required cookies - technical, functional and analytical - are set automatically. Please accept the use of targeted cookies to ensure the best marketing experience for your user journey. You may revoke your consent at any time through our Cookie Policy.
build: cb0d38298.1374