Back to blog

English  ·  Ελληνικά

IPv6 in Depth  ·  Part 3 · November 2026

IPv6 in Depth
The Firewall, Done Right

“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.

IPv6 Firewall RFC 4890 ICMPv6 RA Guard RouterOS Cisco IOS

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.

Before this

01

RFC 4890 as a Table

Two columns matter: traffic to the router (input) and traffic through it (forward). They don't get the same answer.

ICMPv6 typeThrough the router (forward)To the router (input)
1 Dest. UnreachableMust pass (all codes)Must accept
2 Packet Too BigMust pass, or PMTUD black-holes large packetsMust accept
3 Time ExceededCode 0 must pass; code 1 shouldMust accept
4 Parameter ProblemCodes 1–2 must pass; code 0 shouldMust accept
128/129 EchoListed 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 MLDLink-local, never forwardedMust accept (multicast and snooping depend on it)
133–136 NDPLink-local, never forwardedMust accept (hop limit 255 only)
137 RedirectNever forwardedAccept, or turn redirects off
138 Router RenumberingDropDrop: it reconfigures routers
139/140 Node Info, experimental, unassignedDropDrop

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

The Complete RouterOS Ruleset

Everything an SMB edge needs, in the order it's evaluated. Interfaces named by list, so renumbering can't break it.

Interface lists and bogons
/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"
INPUT — protecting the router itself
/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"
FORWARD — everything crossing the router
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"
⚠ Gotcha — Parity Means LAN-to-LAN Too

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

The IOS Version — Zone-Based

ZBF inspects v4 and v6 with the same policy. The traps are the self zone and the ACLs people bolt on beside it.

IOS / IOS-XE — inside-to-outside inspected, outside-to-inside denied
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 sessions
⚠ Gotcha — The Self Zone Is Open Until You Close It, Then It's Closed to NDP Too

Traffic 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

First-Hop Protection

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:

Catalyst IOS-XE — RA guard and DHCPv6 guard on host ports
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
PlatformWhat you haveWhat to do
Cisco CatalystRA guard, DHCPv6 guard, ND inspection, source guardRA + DHCPv6 guard on every host port at minimum.
MikroTik RouterOSNo RA guard featurePut RA guard on the access switch if it supports it; use client isolation on Wi-Fi; detect rogue RAs (below).
Wi-Fi APsClient isolationIsolation stops host-to-host frames, including a rogue RA, on the same SSID.
Detection anywhere — alert when more than one router answers
# 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

Prove Parity Your own network

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.

Scan your own hosts in both families, then compare
$ 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
Prove PMTUD works (Packet Too Big gets through)
$ 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

  1. RFC 4890 answers the ICMPv6 question per type and per direction. Errors 1–4 must pass; NDP and MLD must reach the router; router renumbering (138) must not.
  2. Established/related already covers most errors. The explicit type accepts are for flows conntrack lost.
  3. Write v6 policy by interface list, not address. Delegated prefixes change.
  4. Parity includes inter-VLAN rules. Otherwise segmentation only exists on v4.
  5. ZBF self-zone policies must pass ICMPv6 and DHCPv6, or you lose NDP and your prefix the moment you protect management.
  6. Rogue RAs are a switch problem. Use RA guard and DHCPv6 guard where available, isolation on Wi-Fi, and detection everywhere else.
  7. Test from the outside in both families and diff. Check PMTUD with tracepath.

Not sure your v6 firewall matches your v4 one?

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 →