Monitoring, logging and incident response
Log and correlate IPv6 addresses using canonical text form (RFC 5952) and aggregation by /64. Detect rogue RAs and ND anomalies. Export and analyse IPv6 flows with IPFIX (RFC 7011).
Take the quiz · pass mark 70% · 9 questions
Explanation
You cannot defend what you cannot see. The first four lessons add controls; this one makes IPv6 visible in logs, flows and alerts, and ties it into incident response (RFC 9099, operational security). The recurring theme is that IPv6 addresses need deliberate handling that IPv4 did not.
Canonical address form (RFC 5952)
The same IPv6 address can be written many ways: 2001:DB8:0:0:0:0:0:1, 2001:db8::1, 2001:0db8:0000::0001. If your logs, SIEM and block-lists store these as plain strings, the same address looks like several different ones, so correlation, deduplication and matching all fail. RFC 5952 defines the canonical text representation:
- lowercase hex
- no leading zeros in a group (
db8, not0db8) - the longest run of all-zero groups compressed to
::once (and::not used for a single zero group) - for a tie in run length, compress the first run
Normalise every IPv6 address to RFC 5952 form on ingest, before it is stored, indexed or matched. This is the single most important logging rule for IPv6. Do the same in block-lists and threat-intel feeds.
Aggregation by /64 (and the prefix structure)
A single host legitimately uses many IPv6 addresses: a stable address, one or more temporary addresses (RFC 8981) that rotate, and link-local. Counting unique addresses therefore over-counts hosts and misses that twenty "different" addresses are one laptop. The fixes:
- Aggregate client activity by /64 (the subnet), and where a host has a known stable address, correlate its temporary addresses to it (same /64, same DUID/MAC in DHCPv6 or ND logs, same device in NAC).
- Use your own prefix plan to attribute an address to a customer, site or VLAN by prefix (e.g. which /48 or /56), which is often more useful than the exact address.
- Log the DUID and MAC alongside addresses where available, so temporary addresses can be tied back.
What to log
- First-hop events: RA sources seen (to detect rogue RAs), DHCPv6-Shield and RA-Guard drops, SAVI violations, new ND cache entries.
- Firewall: denied inbound, ULA leaks, spoofing drops (L5.05), extension-header drops (L5.04).
- DHCPv6 and DNS: leases (DUID ↔ address ↔ MAC), AAAA queries.
- Flows: see IPFIX below.
Detecting rogue RAs and ND anomalies
- Rogue RA: alert when a Router Advertisement is seen from any source that is not a known router. Tools:
ndpmon,rafixd/ramond, Suricata/Zeek rules, or a simple script sniffing ICMPv6 type 134 and comparing the source to an allow-list. This is the backstop behind RA-Guard (L5.03), and catches the accidental-laptop case too. - ND anomalies: many NS for unused addresses (neighbour-cache exhaustion, L5.03), an address suddenly answered by a new MAC (ND spoofing), DAD defends (duplicate or attack), and MAC/address bindings that change.
- New-prefix alert: a host gaining an address in an unexpected prefix (rogue RA fallout).
IPv6 flows with IPFIX (RFC 7011)
IPFIX (RFC 7011, information model RFC 7012) exports flow records. For IPv6, make sure the exporter and collector use the IPv6 information elements:
sourceIPv6Address(27),destinationIPv6Address(28)sourceIPv6PrefixLength(29),destinationIPv6PrefixLength(30)flowLabelIPv6(31)nextHeaderIPv6,ipv6ExtensionHeaders, andicmpTypeCodeIPv6(139) for ICMPv6
Many legacy NetFlow v5 setups are IPv4-only and silently drop IPv6 — a classic blind spot. Use IPFIX (or NetFlow v9/IPFIX) with the IPv6 elements. The IPFIX protocol itself runs over SCTP, TCP or UDP, commonly on port 4739. Collectors such as pmacct, nfdump/nfcapd, or Elastic/ntopng then aggregate by prefix, flow label and ICMPv6 type.
Incident response for IPv6
Fold IPv6 into the existing process, and remember:
- Scope by prefix: a compromised host may use several addresses; pivot on the /64 and the DUID/MAC, not one address.
- Containment on the link: disable the switch port, or use SAVI/RA-Guard, rather than only an address block that the host rotates past.
- Preserve both families: dual-stack hosts attack and exfiltrate over whichever works; collect IPv4 and IPv6 evidence.
- Canonicalise before searching: normalise indicators to RFC 5952 before grepping logs or matching threat intel.
ictNetworks scenario
ictNetworks' SOC normalises every IPv6 address to RFC 5952 at log ingest, aggregates customer traffic by /56 and /48, and exports IPFIX with the IPv6 elements from its edge and PoP routers to a pmacct collector. A Zeek sensor on each managed LAN raises a rogue-RA alert when an RA appears from a non-router source (the backstop for the RA-Guard from L5.03), and an ND-anomaly alert on NS floods and changed bindings. The L5.01 accidental-laptop incident is the drill: the alert fires, the SOC maps the RA source MAC to a switch port, disables it, and confirms RA-Guard was missing on that port.
Drawing diagram…
Worked examples
Example 1: Canonicalising for correlation
The log lines 2001:DB8:0:0:0:0:0:25, 2001:db8::25 and 2001:0db8:0000:0000:0000:0000:0000:0025 are the same address. In RFC 5952 form it is 2001:db8::25. Normalising on ingest makes all three match one indicator instead of three.
Example 2: Compressing correctly
2001:db8:0:0:1:0:0:1 has two equal-length zero runs (positions 3–4 and 6–7). RFC 5952 compresses the first one: 2001:db8::1:0:0:1. Writing 2001:db8:0:0:1::1 would be wrong (it leaves a longer-or-equal earlier run uncompressed).
Example 3: Counting hosts by /64
A /64 shows 60 distinct source addresses in an hour, but DHCPv6/ND logs tie them to 12 DUIDs (stable + rotating temporary addresses). The real host count is 12, not 60; aggregating by DUID within the /64 gives the true figure.
Lab
Goal: Build flow export and a rogue-RA alert, then respond to a staged incident.
You need: a lab with a router exporting IPFIX (e.g. pmacctd/nfacctd, or softflowd), a collector (pmacct or nfdump), a monitoring host running tshark/Zeek or ndpmon, hosts generating IPv6 traffic (including temporary addresses), and the L5.01 attacker for the staged incident.
- Canonicalisation: collect a few log lines and threat-intel entries with the same address in different forms. Write (or use) a normaliser that outputs RFC 5952 form, and show the three forms collapsing to one. Include a correct compression of a two-zero-run address.
- Flow export: configure IPFIX export with the IPv6 information elements and verify the collector records
sourceIPv6Address,flowLabelIPv6andicmpTypeCodeIPv6. Show a report aggregated by /64 and by ICMPv6 type. - Host counting: from the flow and DHCPv6/ND data, aggregate one /64's addresses to DUIDs and show the temporary addresses folding into their stable hosts.
- Rogue-RA alert: run the detector (allow-list the real router). From the attacker, send a rogue RA (L5.01) and show the alert fire with the source MAC/address. Add an ND-anomaly rule and trigger it with an NS flood or a spoofed NA.
- Staged incident: run the full L5.01 rogue-RA takeover. Using only your monitoring, detect it, scope it (which hosts, which prefix, which switch port), contain it (disable the port / confirm RA-Guard), and write a short incident report (timeline, indicators in RFC 5952 form, scope, containment, root cause, fix).
What to submit: the normaliser and its output, the IPFIX config and aggregated reports, the host-count working, the alert output, and the incident report.
Summary
- Normalise every IPv6 address to RFC 5952 form on ingest, or correlation and block-lists break.
- Aggregate client activity by /64 and tie temporary addresses to stable ones via DUID/MAC; count hosts, not addresses.
- Log first-hop events, firewall drops, DHCPv6/DNS and flows; alert on rogue RAs (backstop to RA-Guard) and ND anomalies.
- Export IPFIX with the IPv6 information elements (27, 28, 31, 139, …); legacy NetFlow v5 misses IPv6.
- In incident response, scope by prefix and DUID, contain at the port, and collect both address families.
- Level 5 is complete. Level 6 covers transition and coexistence.
Quiz imported · 9 questions · pass mark 70%. Lab questions are not auto-marked.