ping6.net
Security

IPv6 Security: Threats, Mitigations, and Best Practices

IPv6 isn't inherently more or less secure than IPv4. Learn about real IPv6 security threats, how to configure firewalls properly, and protect your network.

ping6.netDecember 14, 20248 min read
IPv6securityfirewallNDPICMPv6

One concern comes up constantly when organizations consider IPv6: "Without NAT, aren't we exposed?"

No. NAT was never a security feature. It was a workaround for address scarcity that happened to hide internal addresses. A stateful firewall provides the same protection—blocking unsolicited inbound connections—without the downsides of address translation.

The real issue is different: many networks have IPv6 enabled but forgot to configure IPv6 firewall rules. That's a serious problem, and it's entirely preventable.

TL;DR - Quick Summary

Key Points:

  • NAT isn't security: Stateful firewalls provide the same protection without address translation
  • IPv6 requires explicit firewall rules: The biggest risk is enabling IPv6 without configuring security
  • ICMPv6 is essential: Unlike IPv4, blocking ICMPv6 breaks basic network operations
  • NDP attacks are real: Deploy RA Guard and first-hop security on switches
  • Same security fundamentals apply: Access control, monitoring, and patching remain critical

Skip to: Firewall Configuration | NDP Security | Security Checklist


The NAT Myth#

NAT was never a security feature. It was a workaround for address scarcity that happened to hide internal addresses. A stateful firewall provides the same protection—blocking unsolicited inbound connections—without the downsides of address translation.

What's Actually Different About IPv6 Security#

IPv6 changes the threat landscape in specific ways:

Larger address space cuts both ways. Scanning a /64 subnet takes centuries with brute force. But attackers don't brute-force—they use DNS records, certificate transparency logs, and traffic analysis to find targets. Don't rely on address obscurity.

Every device is potentially reachable. With global addresses on every host, your firewall is the only barrier. This makes firewall configuration more critical, not optional.

ICMPv6 is essential, not optional. Unlike IPv4 where you could block all ICMP without breaking things, IPv6 requires ICMPv6 for basic operations. Block the wrong messages and your network stops working.

New protocols, new attack surface. Neighbor Discovery Protocol (NDP) replaces ARP and introduces new vectors. Extension headers add complexity that attackers can exploit.

IPv6-Specific Attack Vectors#

NDP Spoofing#

Neighbor Discovery Protocol handles address resolution, router discovery, and duplicate address detection. Like ARP in IPv4, it's trusting by default.

An attacker on the local network can:

  • Spoof Neighbor Advertisements to redirect traffic (man-in-the-middle)
  • Send fake Router Advertisements to become the default gateway
  • Perform Duplicate Address Detection attacks to deny addresses to legitimate hosts

These attacks require local network access—they're not Internet-scale threats. But on shared networks (offices, data centers, WiFi), they're real risks.

Mitigation: Deploy RA Guard and ND Inspection on switches. On hosts, consider SEND (Secure Neighbor Discovery), though adoption is limited.

Learn more about defending against these attacks in our detailed NDP Security guide, which covers RA Guard configuration and deployment strategies.

Router Advertisement Attacks#

A rogue RA can convince hosts to:

  • Use the attacker as their default gateway
  • Accept a malicious DNS server
  • Use a specific prefix (potentially for traffic interception)

This is particularly dangerous because most hosts accept RAs by default.

Mitigation:

  • RA Guard on switch ports (block RAs from non-router ports)
  • On Linux hosts: net.ipv6.conf.all.accept_ra = 0 for servers with static config
  • Monitor for unexpected RAs with tools like ramond or NDPMon

Extension Header Exploitation#

IPv6 extension headers sit between the main header and payload. Legitimate uses include fragmentation, routing options, and IPsec.

Attackers can use them to:

  • Evade firewalls that don't inspect the full header chain
  • Fragment attacks to bypass inspection or reassembly vulnerabilities
  • Create ambiguous packets that different devices interpret differently

Mitigation: Use firewalls that fully parse extension header chains. Drop packets with unusual or deprecated extension headers (like Type 0 Routing Headers, obsoleted by RFC 5095).

Reconnaissance Techniques#

Attackers don't scan /64s randomly. They find IPv6 targets through:

  • DNS zone transfers or guessing (www, mail, ns1, etc.)
  • Certificate Transparency logs (all HTTPS certs are public)
  • Harvesting from traffic (passive monitoring)
  • Predictable addressing (::1, ::100, EUI-64 based on MAC)

Mitigation: Use privacy extensions for client addresses. Avoid predictable server addresses. Don't publish internal infrastructure in public DNS if not needed.


Firewall Configuration for IPv6#

Essential ICMPv6 Types to Allow#

Block these and your network breaks:

TypeNameRequired For
1Destination UnreachablePath MTU Discovery, error handling
2Packet Too BigPath MTU Discovery (critical)
3Time ExceededTraceroute, loop detection
128/129Echo Request/ReplyPing (optional but useful)
133Router SolicitationHost finding routers
134Router AdvertisementRouter announcing itself
135Neighbor SolicitationAddress resolution
136Neighbor AdvertisementAddress resolution response

Types 133-136 are only needed on the local link—don't forward them across routers.

Stateful Firewall Rules#

A minimal ruleset for a host using iptables:

# Allow established connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 
# Allow ICMPv6 (be more specific in production)
-A INPUT -p ipv6-icmp -j ACCEPT
 
# Allow link-local only for NDP (more secure)
-A INPUT -s fe80::/10 -p ipv6-icmp --icmpv6-type 133:136 -j ACCEPT
 
# Allow specific services
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
 
# Drop everything else
-A INPUT -j DROP

This configuration allows established connections, essential ICMPv6 messages, and specific services (SSH and HTTPS in this example).

For nftables (modern replacement for iptables), the equivalent:

table inet filter {
  chain input {
    type filter hook input priority 0; policy drop;
 
    ct state established,related accept
    ip6 nexthdr icmpv6 accept
    tcp dport { 22, 443 } accept
  }
}

Don't Forget Egress Filtering#

Outbound rules matter too. They can:

  • Prevent data exfiltration over unexpected protocols
  • Block command-and-control traffic
  • Limit damage from compromised hosts

At minimum, log unexpected outbound connections.


IPsec in IPv6#

IPsec was originally mandatory for IPv6 implementations (RFC 2460). This was later relaxed (RFC 6434) because universal deployment never happened.

Still, IPv6 makes IPsec cleaner:

  • No NAT traversal complications
  • Extension headers designed with IPsec in mind
  • ESP and AH work as intended

If you need encryption between specific hosts or sites, IPsec on IPv6 is straightforward—more so than on IPv4 with NAT.

First Hop Security Features#

Modern switches offer protections against local attacks:

RA Guard: Blocks Router Advertisements from unauthorized ports. Essential on all access switches.

DHCPv6 Guard: Limits DHCPv6 server responses to authorized ports.

ND Inspection: Builds a binding table of MAC-to-IPv6 mappings and validates NDP traffic.

Source Guard: Drops packets with spoofed source addresses based on the binding table.

These features are available on enterprise switches from Cisco, Juniper, Arista, and others. Configure them—they're disabled by default.


Common Mistakes#

Enabling IPv6 without configuring the firewall. If your firewall rules only cover IPv4, you're wide open on IPv6. This is the #1 real-world vulnerability.

Blocking all ICMPv6. This breaks Path MTU Discovery and causes mysterious connectivity failures, especially for large packets and through tunnels.

Blocking all ICMPv6 is the most common IPv6 firewall mistake. Unlike IPv4, ICMPv6 is essential for basic network operations including address resolution, router discovery, and MTU discovery. See our IPv6 Firewall guide for proper configuration.

Ignoring IPv6 on "IPv4-only" networks. Most operating systems enable IPv6 by default. Without proper infrastructure, they may use link-local or tunnel to random endpoints.

Assuming NAT64 provides security. Translation technologies don't add security. They just translate. You still need firewall rules.

Using the same firewall rules for IPv4 and IPv6. Some rules translate directly; others (like ICMP handling) need specific attention.

Security Checklist#

Before going live with IPv6:

  • Firewall rules explicitly cover IPv6 traffic
  • Essential ICMPv6 types are allowed
  • RA Guard enabled on access switches
  • DHCPv6 Guard configured if using DHCPv6
  • IDS/IPS signatures updated for IPv6
  • Logging captures IPv6 source addresses
  • DNS records reviewed (don't publish unnecessary AAAA records)
  • Privacy extensions enabled on clients
  • Monitoring in place for rogue RAs

Summary#

IPv6 security isn't harder than IPv4—it's different. The fundamentals remain: stateful firewalls, proper access control, monitoring, and keeping systems patched.

The biggest risk isn't technical complexity. It's the transition period where IPv6 exists but isn't properly managed. Treat IPv6 as a first-class citizen in your security architecture, not an afterthought.

Test Your Setup

Use our IPv6 Validator to verify addresses and our diagnostic tools to check connectivity.