Menu
User

DropVPS Team

Writer: Cooper Reagan

How to Enable IPv6 on Ubuntu 25.10?

How to Enable IPv6 on Ubuntu 25.10?

Publication Date

10/19/2025

Category

Articles

Reading Time

5 Min

Table of Contents

IPv6 on Ubuntu 25.10 improves performance, reachability, and future-proofs your server. Many providers already route native IPv6, and netplan makes configuration predictable. Follow the steps below to enable IPv6, configure SLAAC or static addressing, open the firewall correctly, and validate your routes and DNS for dual-stack uptime.

Identify your network interface and current IPv6 state

Confirm the interface name and whether the kernel has IPv6 enabled. This avoids editing the wrong device or missing a global kernel toggle.

ip -br link
ip -br -6 addr
cat /proc/sys/net/ipv6/conf/all/disable_ipv6

Expected output example for a single NIC named ens3 and IPv6 enabled (0):

ens3             UP             fe80::5054:ff:fe12:3456/64
0

Enable IPv6 at the kernel level (if disabled)

Some templates ship with IPv6 disabled via sysctl. Persistently enable it and reload sysctl without rebooting.

sudo tee /etc/sysctl.d/99-ipv6.conf >/dev/null <<'EOF'
net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.default.disable_ipv6=0
# Optional: allow Router Advertisements (RA) on non-forwarding hosts
net.ipv6.conf.all.accept_ra=1
net.ipv6.conf.default.accept_ra=1
EOF
sudo sysctl --system
cat /proc/sys/net/ipv6/conf/all/disable_ipv6

Expected value:

0

Choose addressing: SLAAC/DHCPv6 or static

If your VPS or network offers Router Advertisements (SLAAC) or DHCPv6, automatic configuration is easiest. If your provider gave a fixed /64 and gateway, use static. The next two steps show both with netplan.

Configure IPv6 with SLAAC or DHCPv6 (netplan)

Enable dhcp6 and accept-ra for automatic addressing. This works with systemd-networkd (server) or NetworkManager (desktop) renderers.

sudo nano /etc/netplan/01-ipv6.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    ens3:
      dhcp4: false
      dhcp6: true
      accept-ra: true
      nameservers:
        addresses:
          - 2606:4700:4700::1111
          - 2606:4700:4700::1001

Apply and validate:

sudo netplan generate
sudo netplan try
sudo netplan apply
ip -6 addr show dev ens3
ip -6 route

Expected to see a global IPv6 (2001:…) plus a default route via fe80::/ link-local gateway.

Configure a static IPv6 (netplan)

Use this when the provider supplies a static /64 and gateway. Replace addresses and gateway6 with your values.

sudo nano /etc/netplan/01-ipv6.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    ens3:
      dhcp4: false
      dhcp6: false
      addresses:
        - 2001:db8:1234:abcd::10/64
      gateway6: 2001:db8:1234:abcd::1
      nameservers:
        addresses:
          - 2606:4700:4700::1111
          - 2620:fe::9

Apply and check routes:

sudo netplan generate
sudo netplan apply
ip -6 addr show dev ens3
ip -6 route show default

Verify IPv6 connectivity

Test reachability, routing, and DNS resolution over IPv6 only. This confirms a working dual-stack setup without relying on IPv4.

ping -6 -c 3 ipv6.google.com
curl -6 https://ifconfig.co
dig AAAA google.com +short
traceroute -6 ipv6.google.com

Example output snippet:

PING ipv6.google.com(arn09s16-in-x0e.1e100.net (2a00:1450:400f:80e::200e)) 56 data bytes
64 bytes from 2a00:1450:400f:80e::200e: icmp_seq=1 ttl=115 time=12.3 ms

Enable IPv6 in UFW and reload rules

Ensure the firewall manages IPv6 rules. UFW mirrors v4 rules to v6 when IPv6 is enabled. ICMPv6 essentials are allowed by default in before6.rules.

sudo sed -i 's/^IPV6=.*/IPV6=yes/' /etc/ufw/ufw.conf
sudo ufw reload
sudo ufw status verbose

Add your service rules as usual; UFW will create IPv6 entries automatically.

sudo ufw allow 22/tcp
sudo ufw allow 80,443/tcp
sudo ufw status numbered

Set IPv6 DNS resolvers (optional)

Specify IPv6 resolvers for consistency. If netplan already sets nameservers, this step is optional. For systemd-resolved, set fallback DNS and restart.

sudo nano /etc/systemd/resolved.conf
[Resolve]
DNS=2606:4700:4700::1111 1.1.1.1
FallbackDNS=2620:fe::9 9.9.9.9
sudo systemctl restart systemd-resolved
resolvectl status

Enable privacy extensions or stable addresses (optional)

Privacy addresses randomize the interface identifier; stable addresses are predictable. Choose per your security and logging needs.

sudo tee /etc/sysctl.d/99-ipv6-privacy.conf >/dev/null <<'EOF'
# Temporary (privacy) addresses
net.ipv6.conf.all.use_tempaddr=2
net.ipv6.conf.default.use_tempaddr=2
# Or prefer stable privacy addresses (networkd):
# net.ipv6.conf.all.addr_gen_mode=3
# net.ipv6.conf.default.addr_gen_mode=3
EOF
sudo sysctl --system

Forward IPv6 for routing/containers (optional)

Enable forwarding only if the host routes IPv6 to downstream networks or containers. When forwarding, accept_ra should be 0 or 2 depending on topology.

sudo tee /etc/sysctl.d/99-ipv6-forwarding.conf >/dev/null <<'EOF'
net.ipv6.conf.all.forwarding=1
# If this box must also learn a default route via RA while forwarding:
net.ipv6.conf.all.accept_ra=2
EOF
sudo sysctl --system
sysctl net.ipv6.conf.all.forwarding

Troubleshoot no-route or no-address issues

Common causes are missing RA on the network, wrong gateway, or provider-side IPv6 not enabled. Use logs and neighbor discovery to pinpoint.

journalctl -u systemd-networkd --no-pager -g ipv6
ip -6 addr; ip -6 route
ip -6 neigh
sudo tcpdump -i ens3 icmp6 -vv -c 10

If RA packets are absent, switch to static configuration with your assigned gateway, or request IPv6 enablement from your provider. In clouds, ensure IPv6 is enabled at the VPC/VNet/subnet and attached to the NIC.

Revert or temporarily disable IPv6 (if required)

For testing or rollback, disable IPv6 via sysctl and undo netplan changes. Use only as a temporary measure.

sudo tee /etc/sysctl.d/99-ipv6.conf >/dev/null <<'EOF'
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
EOF
sudo sysctl --system
sudo mv /etc/netplan/01-ipv6.yaml /root/01-ipv6.yaml.bak
sudo netplan apply

IPv6 on Ubuntu 25.10 is straightforward with netplan, correct sysctl settings, and UFW awareness. Test with ping6, curl -6, and AAAA DNS to confirm dual-stack. For more guides and support, visit dropvps.com. برای مطالعه و راهنمایی‌های بیشتر و خرید انواع سرور و پشتیبانی می‌تونین از dropvps استفاده کنین

Linux VPS
U
Loading...

Related Posts