Set Up Public IPv6 on Ubuntu Server 22.04 and Raspberry Pi: A Beginner's Guide

Abstract: Configure Ubuntu Server 22.04 and Raspberry Pi to obtain public IPv6 addresses via SLAAC for direct internet access without NAT.

Created: 2026-09-14 by

Ubuntu Server 22.04 and Raspberry Pi devices can obtain public IPv6 addresses automatically through Stateless Address Autoconfiguration (SLAAC) provided your router advertises the correct prefix. This setup eliminates the need for Network Address Translation (NAT), allowing direct inbound connections to your server from the internet without complex port forwarding rules.

Verifying Your Router Configuration

Before configuring the operating system, you must ensure that your network infrastructure is actually providing IPv6 connectivity. Most modern home routers support IPv6, but it is often disabled by default or configured in a way that restricts external access. The first step is to log into your router’s administration panel and locate the WAN or Internet settings. Look for an option labeled IPv6, PPPoE, or Static IP depending on your ISP connection type. You need to confirm two critical pieces of information: the IPv6 prefix delegation and the firewall settings. The router should be set to receive a /64 prefix from your ISP. This prefix is essential because it defines the block of addresses available to your local network. If your router only receives a smaller prefix, such as a /56 or /48, it can still delegate a /64 to your LAN, which is sufficient for most home setups. Additionally, check if there is a specific "IPv6 Firewall" or "SPI Firewall" setting. For a beginner-friendly setup where you want to host services, you may need to disable the router's built-in IPv6 firewall temporarily to test connectivity, though this is not recommended for long-term security without additional hardening. Once the router is configured, verify that your Ubuntu or Raspberry Pi device is receiving an address. You can do this by running ip -6 addr show. Look for an address that starts with your ISP's assigned prefix range rather than fe80::, which is a link-local address. If you see a global unicast address starting with 2a00:, 2001:, or similar ranges assigned by your provider, the DHCPv6 or SLAAC process is working correctly at the network layer. For more details on troubleshooting network interface issues, you might find our guide on Doesn't ifconfig show IPv4 address? (IPv6 related) helpful, as understanding how interfaces report their status is crucial for diagnosing these problems.

Configuring NetworkManager for Automatic Assignment

Ubuntu Server 22.04 uses NetworkManager by default, which handles IPv6 configuration efficiently. In many cases, no additional configuration is required if your router is properly set up. However, if your device is not obtaining an address, you may need to explicitly enable IPv6 in the NetworkManager configuration files. These files are typically located in /etc/NetworkManager/system-connections/ or managed via nmtui (Network Manager Text User Interface). If you prefer using the command line, you can edit the connection profile associated with your Ethernet or Wi-Fi interface. Use the command nmtui to select your connection, then navigate to the IPv6 CONFIGURATION section. Set the method to either Automatic or Link-local only if you are testing, but for public access, Automatic is preferred. This tells NetworkManager to request an address from the router using SLAAC and optionally use DHCPv6 for DNS servers. After making changes, restart the NetworkManager service with sudo systemctl restart NetworkManager. Check the logs using journalctl -u NetworkManager to ensure there are no errors during the acquisition phase. A successful acquisition will result in an output showing a new global IPv6 address assigned to your interface. It is important to note that Raspberry Pi OS (formerly Raspbian) also uses NetworkManager or systemd-networkd depending on the version. The principles remain the same: ensure the interface is set to auto-configure IPv6. If you are using a minimal install of Ubuntu Server, you might be using netplan. In /etc/netplan/, ensure your YAML configuration includes accept-ra: true under the network interface definition. This allows the kernel to accept Router Advertisements, which contain the necessary prefix information for SLAAC.

Testing Public Accessibility

Obtaining an address does not guarantee that it is publicly accessible. Many ISPs implement Carrier-Grade NAT (CGNAT) even for IPv6, although this is rare compared to IPv4. To test if your address is truly public, you can use online tools like test-ipv6.com or simply try connecting to your server from a mobile data network (turn off Wi-Fi on your phone). If you can ping your IPv6 address from outside your local network, the path is clear. However, even if the router allows traffic, the Linux kernel itself has a firewall. Ubuntu Server comes with ufw (Uncomplicated Firewall) enabled by default. By default, UFW blocks incoming connections. You must explicitly allow traffic on the ports you intend to serve. For example, to allow HTTP traffic, run sudo ufw allow 80/tcp. Similarly, for SSH, ensure sudo ufw allow 22/tcp is set. If you encounter issues where packets are being dropped despite UFW rules, it might be due to other iptables rules or kernel parameters. For advanced users who need to debug packet drops specifically related to IPv6, reviewing guides on Explicitly Dropping IPv6 Packets with ip6tables - A Tech Support Guide can provide deeper insights into low-level packet filtering.

Security Considerations for Direct Exposure

Running a server directly on a public IPv6 address exposes it to the entire internet. Unlike IPv4, where attackers must scan millions of addresses to find one, IPv6 provides each device with a unique /64 subnet, making scanning easier if you have static addresses. Therefore, security is paramount. First, keep your system updated with sudo apt update && sudo apt upgrade. Second, use strong SSH keys instead of passwords. Third, consider using fail2ban to protect against brute-force attacks. Finally, while you may disable the router's firewall for testing, always re-enable it or configure it to allow only specific inbound ports. Never leave all ports open on a public interface. For those experiencing connectivity issues after changing network configurations, especially when trying to access the server remotely, refer to our article on Troubleshooting SSH Connection Issues on a Fresh Install of Ubuntu Server 23.10 on a Raspberry Pi for common pitfalls in remote access setups.

Frequently Asked Questions

Why is my IPv6 address starting with fe80?

Addresses starting with fe80:: are link-local addresses, which are only valid within your local network segment and cannot be routed over the internet. To have a public IPv6 address, you must ensure your router is advertising a global prefix and that your device is configured to accept these advertisements via SLAAC or DHCPv6.

Do I need to forward ports on my router for IPv6?

No, traditional port forwarding is not used in IPv6. Instead, you rely on the global uniqueness of the IPv6 address. Any device with a public IPv6 address can be reached directly by anyone on the internet, provided that firewalls (both on the router and the server) allow the traffic.

How can I hide my IPv6 address for privacy?

Linux systems use Privacy Extensions by default, which generate temporary IPv6 addresses for outbound connections to prevent tracking. These addresses change periodically. You can view them using ip -6 addr show. While this protects your identity for outgoing traffic, your stable address derived from the router's prefix remains visible for incoming connections unless you manually manage the addresses.

What if my ISP does not provide IPv6?

If your ISP does not support IPv6 natively, you cannot obtain a public IPv6 address directly. In this case, you would need to use a tunnel broker like Hurricane Electric (HE) to create an IPv6-over-IPv4 tunnel, which encapsulates IPv6 packets inside IPv4 packets, allowing you to access the IPv6 internet despite your ISP's limitations.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More