Network & Transit 2 min read Last updated: 2026-10-14

IPv6 Dual-Stack Configuration & Routing Optimization

Master native IPv6 on FlawlessNode: Linux network interfaces, IPv4/IPv6 precedence with gai.conf, and UFW firewall security.

As next-generation internet adoption expands globally, native IPv6 plays a vital role in high-throughput international data transmission, bypassing carrier-grade NAT (CGNAT) chokepoints and reducing TCP handshake round-trips. Every FlawlessNode Los Angeles instance receives dedicated native IPv6 subnetting (typically a full /64 prefix). This guide walks you through activating, tuning, and securing IPv6 on your Linux server.

1. Finding Your IPv6 Address & Gateway

Before configuring your network interfaces, retrieve your IPv6 allocation from VirtFusion:

  1. Log into your VirtFusion Control Panel;
  2. Navigate to the Network Interfaces or IP Addresses tab;
  3. Note the following configuration values:
    • IPv6 Address: e.g., 2602:xxxx:xxxx:xxxx::1
    • Subnet Prefix: typically /64
    • IPv6 Gateway: hypervisor upstream gateway, e.g., 2602:xxxx:xxxx::1 or fe80::1

2. Linux Distribution Network Configuration

FlawlessNode standard templates automatically configure IPv6 via Cloud-Init upon deployment. If you customized your installation or rebuild, use the following distribution-specific examples:

2.1 Ubuntu 22.04 / 24.04 / 26.04 LTS (Netplan)

Edit your configuration file under /etc/netplan/ (e.g. 50-cloud-init.yaml):

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true
      dhcp6: false
      addresses:
        - 2602:xxxx:xxxx:xxxx::1/64
      routes:
        - to: default
          via: 2602:xxxx:xxxx::1
      nameservers:
        addresses:
          - 2001:4860:4860::8888  # Google IPv6 DNS
          - 2606:4700:4700::1111  # Cloudflare IPv6 DNS

Apply the configuration and verify:

sudo netplan apply
ip -6 addr show eth0

2.2 Debian 12 / 13 (/etc/network/interfaces)

Edit /etc/network/interfaces and append the following stanza:

iface eth0 inet6 static
    address 2602:xxxx:xxxx:xxxx::1
    netmask 64
    gateway 2602:xxxx:xxxx::1
    dns-nameservers 2001:4860:4860::8888 2606:4700:4700::1111

Restart the networking daemon:

systemctl restart networking

2.3 AlmaLinux / Rocky Linux 9 & 10 (NetworkManager)

Apply configuration using nmcli:

nmcli connection modify eth0 ipv6.addresses "2602:xxxx:xxxx:xxxx::1/64"
nmcli connection modify eth0 ipv6.gateway "2602:xxxx:xxxx::1"
nmcli connection modify eth0 ipv6.dns "2001:4860:4860::8888 2606:4700:4700::1111"
nmcli connection modify eth0 ipv6.method manual
nmcli connection up eth0

3. Testing IPv6 Connectivity

Verify bidirectional public IPv6 connectivity:

# 1. ICMPv6 Ping test
ping6 -c 4 2001:4860:4860::8888

# 2. Check outbound IPv6 public identity
curl -6 https://api64.ipify.org
# Should print your assigned FlawlessNode native IPv6 address

4. Prioritizing IPv4 vs. IPv6 Resolution (/etc/gai.conf)

By default in Linux dual-stack environments, the getaddrinfo() resolver prioritizes IPv6 over IPv4 for outbound connections (such as during apt update or git clone).

If remote targets experience high transit packet loss over international IPv6 routes, connection timeouts can slow down terminal operations. You can configure /etc/gai.conf to prefer high-performance IPv4 transit routes while keeping IPv6 fully operational:

nano /etc/gai.conf

Uncomment the precedence line:

precedence ::ffff:0:0/96  100

Save and exit.

[!TIP] This change takes effect immediately without requiring a reboot. Dual-stack lookups will prefer IPv4, while pure IPv6 endpoints and explicit curl -6 calls continue to utilize native IPv6.


5. IPv6 Security Hardening (UFW & ip6tables)

Because IPv6 does not use Network Address Translation (NAT), every virtual machine address is a globally routable public endpoint. Properly configured firewalls are critical.

Ensuring UFW Protects IPv6:

Verify /etc/default/ufw contains:

IPV6=yes

Reload UFW:

ufw reload
ufw status verbose

With this setting enabled, any allow rule added to UFW (e.g., ufw allow 22/tcp or ufw allow 443/tcp) will automatically bind to both iptables (IPv4) and ip6tables (IPv6), while dropping all unauthorized ports.

Was this page helpful?