This guide explains how to configure a static IPv6 address on common Linux operating systems.
You will need:
-
IPv6 Address:
IPv6/64 -
Gateway:
gateway address -
Network Interface:
eth0orenX0(replace as applicable)
Replace the above values with your actual details.
Ubuntu (18.04 / 20.04 / 22.04 / 24.04) – Netplan
Step 1: Identify the network interface
Step 2: Edit the Netplan configuration file
(On some systems, this may be /etc/netplan/50-cloud-init.yaml)
Step 3: Configure IPv6 (latest Netplan routing method)
Replace eth0, IPv6/64, and gateway as required.
Step 4: Apply changes
Step 5: Verify
Debian (9 / 10 / 11 / 12)
Step 1: Edit the interfaces file
Step 2: Add IPv6 configuration
Step 3: Restart networking
Step 4: Verify
CentOS / RHEL / AlmaLinux / Rocky Linux (7 / 8 / 9)
Step 1: Identify the interface
Step 2: Edit the interface configuration file
(or ifcfg-enX0)
Step 3: Add IPv6 configuration
Step 4: Restart networking
CentOS 7
CentOS 8 / 9
Step 5: Verify
Temporary IPv6 Configuration (All OS – Not Persistent)
Note: This configuration will be lost after reboot.
Test IPv6 Connectivity
Notes
-
IPv6 must be enabled at the provider level
-
Ensure firewalls allow IPv6 traffic
-
Network interface names may vary (
eth0,ens3,enX0)
