Skip to content

Lesson 5 of 9 · 27m

Firewalling IPv6: Same Intent, Different Mechanics

Build IPv6 firewall policy without cargo-culting IPv4 rules — ICMPv6 essentials, link-local behavior, extension headers, nftables examples, and rule parity.

The most dangerous sentence in IPv6 firewalling is "copy the IPv4 rules." The intent transfers; the mechanics do not. IPv6 relies on ICMPv6 for neighbor discovery and path MTU discovery, uses link-local addresses constantly, and routes extension headers through the packet before transport data. A naive clone either breaks the network or silently exposes more than intended.

Start with policy intent, then implement twice

A service policy should read the same regardless of address family: allow established outbound traffic, permit inbound service ports only where required, restrict management protocols, log denials at boundaries. Then implement it for IPv4 and IPv6 with family-specific details.

An nftables example using the inet family can share structure while still respecting differences:

table inet filter {
    chain input {
        type filter hook input priority 0; policy drop;
        ct state established,related accept
        iif "lo" accept
        icmpv6 type { echo-request, nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert, packet-too-big } accept
        tcp dport { 22, 443 } accept
        counter log prefix "input-drop " drop
    }
}

The important part is not that this exact ruleset fits your host — it probably does not. The important part is that ICMPv6 is treated as infrastructure, not optional noise.

Path MTU discovery is not optional

IPv6 routers do not fragment packets in transit. If a packet is too large, the router returns ICMPv6 Packet Too Big and the sender must adjust. Blocking those messages produces a classic failure: TCP connects, small requests work, large responses stall forever.

icmp6 type packet-too-big  == required for PMTUD

If users report "websites load halfway over the tunnel" or "TLS handshakes hang," test MTU before rewriting the application:

ping -6 -M do -s 1452 2001:db8:3f10:220::20
tracepath -6 2001:db8:3f10:220::20

Neighbor discovery uses link-local addresses and multicast. Your host firewall must allow the necessary neighbor discovery types on interfaces where IPv6 is enabled. At the same time, link-local traffic should never be routed between segments. If you see fe80:: addresses in remote logs, something is misconfigured, proxied, or mislabeled.

Extension headers deserve policy, not panic

IPv6 extension headers can include hop-by-hop options, routing headers, fragmentation headers, and destination options. Most end-host traffic does not need exotic chains of them. Security devices should parse what they support and fail closed according to policy, but indiscriminately dropping all extension headers can break legitimate fragmentation or specialized traffic.

For ordinary enterprise edges, a practical baseline is:

  • permit intended TCP/UDP/ICMPv6 flows and essential fragmentation,
  • drop invalid or abused header combinations and alert on parser failures.

Keep rule parity visible

Store IPv4 and IPv6 rules close together, generated from the same service inventory where possible. Drift is the enemy: someone opens 443/tcp for IPv4 during an incident, forgets IPv6, and the next deploy looks intermittent. Review both families in the same change.

Field notes

  • NAT absence is not openness. A global address behind policy drop is not reachable just because it is global.
  • ICMPv6 echo is optional; Packet Too Big and neighbor discovery are not.
  • Some cloud security groups handle IPv6 separately. Check both rule sets instead of assuming inheritance.
  • Test literals with brackets in URLs and explicit -6 flags. Many failures are testing mistakes, not firewall mistakes.

Was this lesson helpful?

Sign in to rate