If your servers have an IPv6 address, your port exposure is probably wider than your IPv4 scan reports show. Sysadmins who carefully locked down IPv4 often find that IPv6 addressing has quietly opened a second route to the same services, with separate firewall rules, separate defaults and much less monitoring. This article covers how IPv6 changes port exposure, where dual-stack setups leak, and how to check and close the gaps.
The good news is that the problem is easy to fix once you can see it. The bad news is that most teams never look.
Why IPv6 Changes the Port Exposure Picture
On IPv4, most networks relied on NAT, whether they meant to or not. Hosts behind a router had private addresses, and nothing came in unless someone set up port forwarding. NAT was never designed as a security control, but it worked like one for 20 years.
IPv6 removes that accidental protection. Every host gets a globally routable address. If a service listens on that address and nothing filters it, the whole internet can reach it. Whether a port is reachable now depends only on the firewall and on how the service binds its socket.
Cloud providers have made this more urgent. AWS began charging $0.005 per hour for every public IPv4 address on February 1, 2024, which pushed many teams toward IPv6-only or dual-stack subnets. Many of them turned IPv6 on to save money and never reviewed what became reachable.
How Dual-Stack Servers Leak Exposed Services
The most common leak comes from how Linux handles sockets. The sysctl net.ipv6.bindv6only defaults to 0, so a service bound to [::] accepts both IPv6 and IPv4 traffic. MySQL, PostgreSQL, Redis and plenty of Node.js apps bind to all interfaces by default or with a single config change. The service ends up reachable on both stacks.
Firewalls often protect only one of them. On older systems iptables and ip6tables are separate rule sets, and a script that writes only iptables rules leaves IPv6 wide open. Plenty of hardening guides from the 2010s never mention ip6tables at all.
Here’s a realistic case. A team moves a VPS fleet to a provider that assigns a /64 per server by default. Their Ansible role writes careful iptables rules allowing only 22, 80 and 443. The ip6tables INPUT policy stays at ACCEPT. Eight months later an external scan over IPv6 finds PostgreSQL 5432, a Prometheus node_exporter on 9100 and a forgotten Redis on 6379, all reachable on every server. None of these showed up in any IPv4 report.
Myth: The IPv6 Address Space Is Too Big to Scan
A single /64 subnet holds 2^64 addresses. Brute-force sweeping it is impractical, so many admins assume nobody will find their hosts. That assumption is wrong.
Attackers don’t sweep blindly. They harvest addresses from DNS records (AAAA records are public by design), certificate transparency logs, reverse DNS zones, mail headers and application logs. Administrators also pick predictable addresses like ::1, ::10 or ::80, and hosts using EUI-64 SLAAC embed their MAC address in the interface identifier, which cuts the search space down to vendor prefixes. In 2016, researchers found that Shodan had been running NTP pool servers to collect the IPv6 addresses of clients that connected to them, and then scanning those addresses.
If your server has an AAAA record, assume it gets scanned. Obscurity buys you hours, not months.
Step-by-Step: Auditing IPv6 Port Exposure
An experienced penetration tester starts by comparing what a host listens on with what the outside world can actually reach. The process usually goes like this:
1. Inventory the listeners. Run ss -tulnp on each host and look for sockets bound to [::] or *. Each one is a candidate for dual-stack exposure.
2. Compare the firewall rule sets. Run ip6tables -S next to iptables -S, or nft list ruleset if you use nftables. A table using the inet family covers both stacks in one place, which is the main reason to migrate.
3. Scan from outside over IPv6. Run nmap -6 -sS -sV -p- against the global address from a host outside your network. Internal scans miss upstream filtering and NAT64 quirks. Read the results carefully, because the difference between open, closed and filtered port states often looks different on IPv6 when ICMPv6 handling differs.
4. Diff the two stacks. Every port open on IPv6 but not on IPv4 is almost certainly unintended. Treat it as a finding, not a curiosity.
5. Fix and re-verify. Add default-deny rules for IPv6, rebind services to specific addresses where possible, then scan again. A rule you haven’t tested from outside is only a hypothesis. External checks are the only reliable way to validate firewall rules on both stacks.
Common Mistakes in IPv6 Firewall Configuration
Blocking all ICMPv6. Admins who carry IPv4 habits over drop ICMPv6 entirely. That breaks Neighbor Discovery and Packet Too Big messages, which IPv6 needs for path MTU discovery because routers don’t fragment packets in transit. RFC 4890 lists the message types to allow. The symptom is connections that hang on large transfers, and that’s painful to debug.
Trusting cloud security groups to mirror each other. In AWS, Azure and GCP, a rule for 0.0.0.0/0 does not cover ::/0. Someone adds an IPv6 rule for testing, or a Terraform module creates both by default, and the two rule sets drift apart. Review them side by side. The cloud server port security guide covers provider-specific behavior.
Forgetting Docker. Docker’s IPv6 support has changed a lot across versions, and how published ports interact with ip6tables depends on the daemon config and the release. Teams that run Docker with IPv6 enabled should scan published container ports over both stacks rather than assume they behave the same.
Edge Cases Worth Knowing
Disabling IPv6 is sometimes the right call: an air-gapped on-prem network with no IPv6 routing, or a small team of 3-5 people running a few IPv4-only VPS instances where the provider never assigned IPv6. If you go that route, disable it properly with sysctl and confirm that no AAAA record points at the host.
Disabling IPv6 is the wrong fix in IPv6-only cloud subnets, on mobile-heavy services where carriers like T-Mobile US run IPv6-only networks with NAT64, and on Windows domains, where Microsoft explicitly advises against disabling IPv6. Tunneling also matters. Teredo, 6to4 and router-advertised prefixes can give a host an IPv6 address you never configured.
FAQ
Does a firewall on IPv4 automatically protect IPv6?
Not necessarily. iptables and ip6tables are separate, and cloud security groups treat 0.0.0.0/0 and ::/0 as separate rules. UFW and firewalld usually handle both, but check by scanning from outside.
Should I just disable IPv6 on my servers?
Only if IPv6 truly isn’t in use anywhere along the path. In most cloud and dual-stack environments, it’s more reliable to apply the same default-deny policy to both stacks.
How do I know whether my server has a public IPv6 address?
Run ip -6 addr show scope global. Any address outside fe80::/10 and fd00::/8 is probably globally routable and should be part of your external scans.
Summary
IPv6 doesn’t add new vulnerabilities to your services. It adds a second, often unfiltered path to the ones you already run. Sockets bound to [::], firewall rules written only for IPv4, and the belief that IPv6 addresses can’t be found all work in the attacker’s favor.
The fix is to scan both stacks from outside, compare the results, and apply a default-deny firewall policy to each. Make the IPv4-to-IPv6 diff a standing part of every port review, because any port open on only one stack means something is misconfigured.
