IPv6 traffic filters

A dual-stack segment needs a filter for each family. In IPv4, ARP is not carried in IP, so an access list never sees it. IPv6 neighbor discovery is ICMPv6, inside IPv6, so a deny at the end of an IPv6 access list can match it. Some platforms permit neighbor discovery implicitly before that deny; rather than rely on it, permit nd-ns and nd-na first.

In Daveth Pro (Network)11 min video · lab: Security

By , founder of Daveth · Updated

Opening frame of the video walkthrough of IPv6 traffic filters

Watch this lesson

11 min · Video walkthrough

In Daveth Pro (Network)

The full 11 min walkthrough is in Daveth Pro (Network). See what the plan opens

Upcoming practical lab

Lab C13: Security

What the lab covers

What this page answers

Can an IPv6 ACL block neighbor discovery?

Yes. Neighbor discovery is carried in IPv6 as ICMPv6, so a deny can match it, unlike ARP in IPv4. Permit nd-ns and nd-na before any deny ipv6 any any line. Read it in “Why the end of the list matters here”

How do you filter IPv6 traffic on a dual-stack segment?

With a separate IPv6 access list beside the IPv4 one, applied with ipv6 traffic-filter, since each family needs its own filter. Read it in “One filter, one kiosk”

One filter, one kiosk

A public library puts self-service kiosks on their own segment behind SW-1. The kiosks should reach the catalogue server, CAT-SRV, over HTTPS, and nothing else on the staff side. The segment runs IPv4 and IPv6, so it needs a filter for each.

Plain words first. An access list, or ACL, is an ordered list of permit and deny lines the switch checks packets against. Neighbor discovery is how an IPv6 device finds the hardware address of a neighbor on its own link: IPv6's replacement for ARP.

The filtering model itself, first match and order, is 4.2.b.ii's. By this course's reading, it carries over unchanged: an IPv6 list matches on the same things an IPv4 list does (source, destination, and source and destination ports) so there is nothing new in the matching to learn here. What is new is what an IPv6 list sees.

Computed from the state: the addresses in this walk. No command prints it in this form.

host      IPv6                IPv4
SW-1      2001:DB8:50:1::1    10.50.1.1
KIOSK-1   2001:DB8:50:1::21   10.50.1.21
CAT-SRV   2001:DB8:50:2::10   10.50.2.10
STAFF-PC  2001:DB8:50:2::30   10.50.2.30

Configuration: PUBLIC-V6 created, then attached inbound on the kiosk interface, which was already routed and addressed. The list name and addresses are this course's own.

SW-1# configure terminal
SW-1(config)# ipv6 access-list PUBLIC-V6
SW-1(config-ipv6-acl)# permit tcp any host 2001:DB8:50:2::10 eq 443 sequence 10
SW-1(config-ipv6-acl)# end
SW-1# configure terminal
SW-1(config)# interface GigabitEthernet1/0/1
SW-1(config-if)# ipv6 traffic-filter PUBLIC-V6 in
SW-1(config-if)# end

The second block is the one that matters: a list does nothing until an interface is told to use it, in one direction, by name.

Look at PUBLIC-V6: one entry, permit HTTPS to CAT-SRV. KIOSK-1 also sends neighbor discovery messages into Gi1/0/1, to find SW-1's hardware address and to answer SW-1's questions.

Every IPv6 access list ends in a deny that nobody types. Reach the bottom without matching an entry and the packet is dropped. That is the same rule IPv4 has, and on its own it is unremarkable.

What makes it remarkable here is the traffic it now covers. Neighbor discovery runs on ICMPv6. ICMPv6 is IPv6. So an IPv6 access list stands in front of the mechanism the link uses to find hardware addresses at all, and nothing written in PUBLIC-V6 matches it.

Computed from the state: what PUBLIC-V6 decides for each packet. No command prints it in this form.

family packet                           decided by       result
IPv6   HTTPS to the catalogue           sequence 10      permitted
IPv6   SSH to a staff PC                end of list      denied
IPv6   neighbor solicitation for SW-1   end of list      not dependable - write it in
IPv6   neighbor advertisement to SW-1   end of list      not dependable - write it in
neighbor discovery written into PUBLIC-V6: no

Read the neighbor discovery rows: decided at the end of the list.

Why the end of the list matters here

Does that deny at the end really reach neighbor discovery, or does something implicit protect it?

Start from the IPv4 habit, because that is what misleads. ARP is not carried in IP. An IPv4 access list filters IP packets, so ARP goes past it without ever being examined: you have never had to permit ARP and you never will.

Neighbor discovery has no such exemption. It is carried in IPv6, as ICMPv6, so an IPv6 access list is entitled to match it, and the deny at the end of the list is an entry that matches everything left.

Which is worth stating against the reflex it runs into, because ICMPv6 is not all ping. In IPv4 people learn that ICMP can be blocked and the network keeps working. In IPv6 the same protocol number also carries the messages that let hosts find each other and find the router at all, so a blanket decision about ICMPv6 is a decision about whether the link functions.

Some platforms permit neighbor discovery implicitly before that deny. Some do not. By this course's reading, that is not a fact to look up and rely on: it is invisible in the configuration, it varies, and the cost of assuming wrongly is a segment that stops working for reasons no line in your list explains. The reading marks those rows as platform-dependent rather than dropped, which is the honest answer, and the useful answer is the same either way.

By this course's reading, that is also why a filter that stops neighbor discovery can stop permitted traffic too. When CAT-SRV replies to KIOSK-1's permitted HTTPS, SW-1 has to resolve KIOSK-1 before it can deliver the reply, and KIOSK-1's answer comes back into Gi1/0/1 as a neighbor advertisement, through PUBLIC-V6. Worse, a switch that is actively trying to resolve a neighbour it cannot resolve will drop further packets heading for that same neighbour, so one missing permit turns into silence on traffic you did permit.

Worked here: an edge list with discovery written in at the top. Written for this page, not taken from anywhere.

ipv6 access-list PUBLIC-EDGE
 permit icmp any any nd-ns sequence 5
 permit icmp any any nd-na sequence 6
 permit icmp any any router-solicitation sequence 7
 permit icmp any any router-advertisement sequence 8
 permit udp any eq 546 any eq 547 sequence 9
 permit tcp any host 2001:DB8:50:2::10 eq 443 sequence 10
 deny ipv6 any any sequence 100

Look at the order: everything the link needs in order to function sits ahead of the work the list was written for. Neighbor solicitation and advertisement; router solicitation and advertisement, so the host can find a default gateway at all; DHCPv6, if it is used. Then the permit that was the point of the list. Then the deny, written out here so that it is visible, which the platform would have applied anyway.

And notice that nothing about the rule changed just because the addresses got longer. First match still decides, the end of the list is still a deny, and a permit written below something that already matched is still never reached. The only thing that moved is which traffic you now have to remember to permit.

Configuration, the two neighbor discovery permits added to PUBLIC-V6, the only lines typed. The list name and addresses are this course's own.

SW-1# configure terminal
SW-1(config)# ipv6 access-list PUBLIC-V6
SW-1(config-ipv6-acl)# permit icmp any any nd-ns sequence 5
SW-1(config-ipv6-acl)# permit icmp any any nd-na sequence 6
SW-1(config-ipv6-acl)# end

Computed from the state: what PUBLIC-V6 decides now. No command prints it in this form.

family packet                           decided by       result
IPv6   HTTPS to the catalogue           sequence 10      permitted
IPv6   SSH to a staff PC                end of list      denied
IPv6   neighbor solicitation for SW-1   sequence 5       permitted
IPv6   neighbor advertisement to SW-1   sequence 6       permitted
neighbor discovery written into PUBLIC-V6: yes

Read the neighbor discovery rows again: permitted, by sequence 5 and 6. The platform question no longer matters, because the list itself answers it.