English · Ελληνικά
“Allow ICMPv6” is the right reflex and the wrong level of detail. RFC 4890 sorts every ICMPv6 type into must-pass, should-pass, local-only and safe-to-drop, and it treats traffic to the router differently from traffic through it. Here it is as complete rulesets you can paste, plus first-hop protection and a way to prove v4 and v6 expose the same thing.
An IPv6 edge firewall does the same job as a v4 one: allow what the inside started, deny what the outside starts, protect the router itself. Two things change. First, nothing is hidden behind NAT, so the firewall is the only control between the internet and every host. Second, the protocol depends on ICMPv6 for things IPv4 did in other ways: address resolution, router discovery, and path MTU. Drop the wrong ICMPv6 type and v6 breaks. Allow the wrong one and you open something you didn't mean to.
The cure for both is RFC 4890. It is short, specific, and almost nobody reads it. This post turns it into rules.
01
Two columns matter: traffic to the router (input) and traffic through it (forward). They don't get the same answer.
| ICMPv6 type | Through the router (forward) | To the router (input) |
|---|---|---|
| 1 Dest. Unreachable | Must pass (all codes) | Must accept |
| 2 Packet Too Big | Must pass, or PMTUD black-holes large packets | Must accept |
| 3 Time Exceeded | Code 0 must pass; code 1 should | Must accept |
| 4 Parameter Problem | Codes 1–2 must pass; code 0 should | Must accept |
| 128/129 Echo | Listed as must-not-drop (connectivity checks, Teredo). Inbound echo-request to hosts stays a policy choice, so rate-limit it. | Accept, rate-limited |
| 130–132, 143 MLD | Link-local, never forwarded | Must accept (multicast and snooping depend on it) |
| 133–136 NDP | Link-local, never forwarded | Must accept (hop limit 255 only) |
| 137 Redirect | Never forwarded | Accept, or turn redirects off |
| 138 Router Renumbering | Drop | Drop: it reconfigures routers |
| 139/140 Node Info, experimental, unassigned | Drop | Drop |
Two practical notes. On a stateful firewall, errors that belong to a tracked flow (a Packet Too Big for your outbound TCP session) are classified as related and pass through the established/related rule anyway. The explicit accepts for types 1–4 cover the cases conntrack misses: asymmetric paths, a flow that outlived its conntrack entry, a reboot. And “never forwarded” for NDP is enforced by the protocol itself (link-local scope, hop limit 255), so in the forward chain you don't need rules for them at all.
02
Everything an SMB edge needs, in the order it's evaluated. Interfaces named by list, so renumbering can't break it.
/interface list add name=WAN /interface list add name=LAN /interface list add name=MGMT /interface list member add list=WAN interface=pppoe-out1 /interface list member add list=LAN interface=vlan10 /interface list member add list=LAN interface=vlan40 /interface list member add list=MGMT interface=vlan99 /ipv6 firewall address-list add list=bad_ipv6 address=::/128 comment="unspecified" add list=bad_ipv6 address=::1/128 comment="loopback" add list=bad_ipv6 address=fec0::/10 comment="site-local, deprecated" add list=bad_ipv6 address=::ffff:0.0.0.0/96 comment="IPv4-mapped" add list=bad_ipv6 address=::/96 comment="IPv4-compatible, deprecated" add list=bad_ipv6 address=100::/64 comment="discard-only" add list=bad_ipv6 address=2001:db8::/32 comment="documentation" add list=bad_ipv6 address=2001:10::/28 comment="ORCHID" add list=bad_ipv6 address=3ffe::/16 comment="6bone"
/ipv6 firewall filter
add chain=input action=accept connection-state=established,related,untracked
add chain=input action=drop connection-state=invalid
add chain=input action=drop protocol=icmpv6 icmp-options=138:0-255 \
comment="RFC 4890: router renumbering"
add chain=input action=accept protocol=icmpv6 \
comment="NDP, MLD, errors, echo"
add chain=input action=accept protocol=udp dst-port=546 src-address=fe80::/10 \
in-interface-list=WAN comment="DHCPv6-PD replies (Part 2)"
add chain=input action=accept protocol=udp dst-port=53 in-interface-list=LAN \
comment="router as DNS resolver for the LAN, if you use it"
add chain=input action=accept protocol=tcp dst-port=53 in-interface-list=LAN
add chain=input action=accept in-interface-list=MGMT
add chain=input action=drop log=yes log-prefix="v6-in-drop"add chain=forward action=accept connection-state=established,related,untracked
add chain=forward action=drop connection-state=invalid
add chain=forward action=drop src-address-list=bad_ipv6
add chain=forward action=drop dst-address-list=bad_ipv6
add chain=forward action=drop in-interface-list=WAN src-address=fc00::/7 \
comment="ULA never arrives from the internet"
# RFC 4890 must-pass errors (covers flows conntrack lost)
add chain=forward action=accept protocol=icmpv6 icmp-options=1:0-255
add chain=forward action=accept protocol=icmpv6 icmp-options=2:0-255
add chain=forward action=accept protocol=icmpv6 icmp-options=3:0-1
add chain=forward action=accept protocol=icmpv6 icmp-options=4:0-2
# echo: policy choice; rate-limit inbound so it can't be used to load hosts
add chain=forward action=accept protocol=icmpv6 icmp-options=128:0 \
limit=10,20:packet
# the actual policy
add chain=forward action=accept in-interface-list=LAN out-interface-list=WAN
add chain=forward action=drop log=yes log-prefix="v6-fwd-drop" \
comment="default deny: inbound from WAN, and LAN-to-LAN unless allowed above"Most v4 rulesets block inter-VLAN traffic (guest to staff, IoT to servers) in the forward chain. On v6 the same hosts now have a second set of addresses, and if the v6 forward chain ends with “LAN to anywhere: accept”, your segmentation exists only on IPv4. The ruleset above allows only LAN → WAN. Add explicit inter-VLAN accepts with in-interface/out-interface pairs, the same ones v4 has. Filter by interface rather than by address, because the addresses are delegated and will change (Part 2).
03
ZBF inspects v4 and v6 with the same policy. The traps are the self zone and the ACLs people bolt on beside it.
zone security INSIDE
zone security OUTSIDE
!
class-map type inspect match-any C-OUTBOUND
match protocol tcp
match protocol udp
match protocol icmp
!
policy-map type inspect P-IN-TO-OUT
class type inspect C-OUTBOUND
inspect
class class-default
drop log
!
zone-pair security ZP-IN-OUT source INSIDE destination OUTSIDE
service-policy type inspect P-IN-TO-OUT
!
interface GigabitEthernet0/1
zone-member security INSIDE
interface GigabitEthernet0/0
zone-member security OUTSIDE
!
! No OUTSIDE->INSIDE zone-pair = inbound is denied by default,
! while return traffic for inspected sessions (and their ICMPv6 errors) is allowed.
show policy-map type inspect zone-pair sessionsTraffic to the router itself belongs to the built-in self zone. With no zone-pair that involves self, the router's own traffic is allowed, so DHCPv6-PD, NDP and SSH all work. The moment you add an OUTSIDE → self zone-pair to protect management, everything that pair doesn't explicitly pass is dropped, including ICMPv6 and DHCPv6 from the ISP. Write that policy with the RFC 4890 input column above (ICMPv6, plus UDP 547→546 from fe80::/10) before anything else. As with any ZBF change, check v6 sessions on your release with the show command above. Don't assume a v4 test covers v6.
04
Hop limit 255 keeps off-link devices from speaking NDP. It does nothing about a device plugged into your own switch.
Any host on a LAN segment can send Router Advertisements or answer DHCPv6. Usually that host is just misconfigured: a laptop with Internet Sharing on, a test VM bridged to the wrong network, a consumer router plugged in backwards. Hosts take the extra RA at face value and gain a second default route. The result runs from “some users can't reach anything” to traffic quietly taking a path you didn't design. The fix belongs on the access switch, which knows which ports face hosts:
ipv6 nd raguard policy HOST-PORTS
device-role host
ipv6 dhcp guard policy DHCP-CLIENTS
device-role client
!
interface range GigabitEthernet1/0/1 - 46
ipv6 nd raguard attach-policy HOST-PORTS
ipv6 dhcp guard attach-policy DHCP-CLIENTS
! Uplinks to the router keep the default (no policy) or device-role router.
show ipv6 nd raguard policy HOST-PORTS| Platform | What you have | What to do |
|---|---|---|
| Cisco Catalyst | RA guard, DHCPv6 guard, ND inspection, source guard | RA + DHCPv6 guard on every host port at minimum. |
| MikroTik RouterOS | No RA guard feature | Put RA guard on the access switch if it supports it; use client isolation on Wi-Fi; detect rogue RAs (below). |
| Wi-Fi APs | Client isolation | Isolation stops host-to-host frames, including a rogue RA, on the same SSID. |
# run from a monitoring host on each VLAN (cron, every few minutes) rdisc6 -m eth0.10 | grep -c '^ from' # -m: wait for every router, not just the first # more than the routers you expect -> alert with the "from" address and its MAC
05
A firewall you haven't tested from the outside is a guess. Test both families from the same vantage point and diff them.
From a VPS you control, run the same scan against the IPv4 address and the IPv6 address of a few hosts you own: the router's WAN, a server, a workstation (use its stable address, not a temporary one). The results should match. Any port open on v6 and filtered on v4 is a missing v6 rule.
$ nmap -Pn -p- --open -oG v4.txt 198.51.100.20
$ nmap -6 -Pn -p- --open -oG v6.txt 2001:db8:abcd:1220::20
$ diff <(grep -o '[0-9]*/open' v4.txt) <(grep -o '[0-9]*/open' v6.txt)
# any line here is a v4/v6 policy mismatch$ tracepath -6 www.example.com 1?: [LOCALHOST] 0.012ms pmtu 1500 1: 2001:db8:abcd:1210::1 0.501ms 2: 2001:db8:ffff:1::1 6.884ms pmtu 1492 # PPPoE hop reports a lower MTU ... Resume: pmtu 1492 hops 9 back 9 # If large transfers stall but tracepath never reports a pmtu drop, something # between you and the far end is eating type 2. On your own edge, check rule order.
Takeaways
I audit edge and first-hop policy on MikroTik and Cisco networks, test it from the outside in both address families, and close the gaps so dual-stack doesn't mean twice the exposure.
Book a Discovery Call →