> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Configure IPv6 on Ubuntu Server and Linux

> Configure IPv6 on Ubuntu Server and other Linux: add your IPv6 address and default route in Netplan, nmcli or ifupdown, then test with ping -6 and curl -6.

To configure IPv6 on Ubuntu Server, add your IPv6 address (for example `"2001:db8::10/64"`) under `addresses` in your Netplan file and a route `- to: default via: "2001:db8::1"` using the gateway your provider gives you, then run `sudo netplan try`. On AlmaLinux/Rocky use `nmcli` with `ipv6.method manual`. Test with `ping -6 -c 3 example.com`.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Intermediate | 10 minutes | Ubuntu 22.04/24.04, Debian 12/13, AlmaLinux/Rocky 9/10 | Your IPv6 address, prefix length and gateway; console access as a fallback |

## Before you start

* **IPv6** is the newer internet address format, written in hexadecimal groups like `2001:db8::10`. `::` means "all zeros here". The `/64` after it is the prefix length.
* Get your IPv6 address and gateway. On a VPS they're in the **IPv6** table on the [Network tab of the VPS Panel](https://help.freakhosting.com/portals/vps-panel/how-to-view-and-manage-network-settings.md); if there's no IPv6 table, your server has no IPv6 range.
* Open the [VNC console](https://help.freakhosting.com/portals/vps-panel/how-to-enable-and-use-vnc-console-access.md) first. A mistake in the network file can drop IPv4 too.
* Commands use `sudo`; as root, leave it out.

## How to check if IPv6 already works

```bash theme={null}
ip -6 addr show scope global
ip -6 route show default
ping -6 -c 3 example.com
```

If you see a global address (starting with `2` or `3`), a default route and replies, IPv6 already works. If you only see `fe80::` addresses, configure it below.

Also check IPv6 isn't switched off in the kernel:

```bash theme={null}
sysctl net.ipv6.conf.all.disable_ipv6
```

`= 0` means enabled. If it shows `1`, look for the setting in `/etc/sysctl.conf` and `/etc/sysctl.d/`, remove it, and run `sudo sysctl --system`.

## How to add a static IPv6 address

> [tab] Ubuntu (Netplan)
>
> **1. Edit the Netplan file**
>
> ```bash theme={null}
> sudo nano /etc/netplan/50-cloud-init.yaml
> ```
>
> Add the IPv6 address and a second default route:
>
> ```yaml theme={null}
> network:
>   version: 2
>   ethernets:
>     eth0:
>       dhcp4: false
>       dhcp6: false
>       addresses:
>         - 203.0.113.10/24
>         - "2001:db8::10/64"
>       routes:
>         - to: default
>           via: 203.0.113.1
>         - to: default
>           via: "2001:db8::1"
>       nameservers:
>         addresses: [1.1.1.1, "2606:4700:4700::1111"]
> ```
>
> If the gateway is outside your IPv6 prefix, add `on-link: true` under the IPv6 route.
>
> **2. Test and apply**
>
> ```bash theme={null}
> sudo netplan try
> ```
>
> Open a new SSH session; if it connects, press **Enter** in the first one.

> [tab] AlmaLinux / Rocky (nmcli)
>
> **1. Find the connection name**
>
> ```bash theme={null}
> nmcli connection show
> ```
>
> **2. Set the IPv6 address and gateway**
>
> ```bash theme={null}
> sudo nmcli connection modify "System eth0" ipv6.method manual ipv6.addresses 2001:db8::10/64 ipv6.gateway 2001:db8::1
> ```
>
> Add an IPv6 DNS server if you want one: `ipv6.dns 2606:4700:4700::1111`.
>
> **3. Activate**
>
> ```bash theme={null}
> sudo nmcli connection up "System eth0"
> ```

> [tab] Debian (ifupdown)
>
> **1. Add an inet6 stanza**
>
> ```bash theme={null}
> sudo nano /etc/network/interfaces
> ```
>
> Below the existing IPv4 stanza for the interface:
>
> ```ini theme={null}
> iface eth0 inet6 static
>     address 2001:db8::10/64
>     gateway 2001:db8::1
> ```
>
> **2. Apply from the console**
>
> ```bash theme={null}
> sudo ifdown eth0 && sudo ifup eth0
> ```

## How to check it worked

```bash theme={null}
ip -6 addr show dev eth0 scope global
ip -6 route show default
ping -6 -c 3 example.com
curl -6 -I https://example.com
```

```text theme={null}
default via 2001:db8::1 dev eth0 proto static metric 1024 pref medium
```

Then test from outside: `ping 2001:db8::10` from another IPv6-enabled machine, or check the service you run.

## Does my firewall cover IPv6?

* **UFW** (Ubuntu): `IPV6=yes` in `/etc/default/ufw` is the default, so `ufw allow` rules apply to both IPv4 and IPv6. Check with `grep IPV6 /etc/default/ufw`.
* **firewalld** (AlmaLinux/Rocky): zones apply to IPv4 and IPv6.
* **iptables**: IPv6 rules are separate and use `ip6tables`. See [nftables and iptables](https://help.freakhosting.com/portals/other/how-to-use-nftables-and-iptables.md).

> [!WARNING]
>
> With IPv6 configured, your services can be reached on the IPv6 address as well. Make sure your firewall rules cover IPv6 before you open services such as databases.

## Frequently asked questions

### Why does `ping -6` to an address work but not to a domain name?

The domain may have no IPv6 address. Check for an AAAA record with `dig AAAA example.com +short`. If it returns nothing, that site isn't reachable over IPv6 and your setup is fine.

### Do I need to put the IPv6 address in quotes in Netplan?

No. Netplan 1.1 on Ubuntu 24.04 reads `- 2001:db8::10/64` with or without quotes. Quotes do no harm and make the value clearly a string, so this guide uses them.

### How do I add more IPv6 addresses from my range?

Add more lines under `addresses` (Netplan), use `+ipv6.addresses` with `nmcli`, or add more `inet6` stanzas (Debian). Each must be from the range assigned to your server.

### Should I disable IPv6 if I don't use it?

You don't have to. Check `ip -6 addr show scope global`: if it shows no address, the server can't be reached over IPv6 from the internet. If it does, make sure your firewall covers IPv6.

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Static IP with Netplan](https://help.freakhosting.com/portals/other/how-to-configure-a-static-ip-with-netplan.md)
>
> Full Netplan setup on Ubuntu.

> [card] [Add more IP addresses](https://help.freakhosting.com/portals/other/how-to-add-additional-ip-addresses-on-linux.md)
>
> Extra IPv4 or IPv6 addresses.

> [card] [Point a domain to your server](https://help.freakhosting.com/portals/other/how-to-point-a-domain-to-your-server.md)
>
> Add an AAAA record.

> [card] [Enable IPv6 on Windows Server](https://help.freakhosting.com/portals/other/how-to-enable-ipv6-on-windows-server.md)
>
> The same task on Windows.

> [card] [Reverse DNS](https://help.freakhosting.com/portals/vps-panel/how-to-configure-reverse-dns.md)
>
> Set a PTR record for your IPv6 address.

***

> [!NOTE]
>
> **Checked against the official [Netplan documentation](https://netplan.readthedocs.io/en/stable/using-static-ip-addresses/), [Red Hat Enterprise Linux 9 networking guide](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_basic_system_settings/assembly_configuring-and-managing-network-access_configuring-basic-system-settings) and Debian's [interfaces(5) manual](https://manpages.debian.org/trixie/ifupdown/interfaces.5.en.html)** on 4 November 2026; the Netplan example was validated with `netplan generate` (Netplan 1.1.2) and the UFW default checked on Ubuntu 24.04 LTS. Commands can differ on other distributions or releases.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.