First-hop security
Demonstrate rogue-RA, ND-spoofing and rogue-DHCPv6 attacks on a LAN. Deploy RA-Guard, DHCPv6-Shield and source-address validation to block them. Mitigate neighbour-cache exhaustion.
Take the quiz · pass mark 70% · 9 questions
Explanation
The link is where ND and SLAAC trust every node (L5.01). First-hop security moves that trust into the switch, which is the one device every host must go through. The controls are layer-2 features on the access switch (or a Linux bridge, or a MikroTik RouterOS switch), not host or router configuration.
The attacks
- Rogue RA (RFC 6104): any host can send Router Advertisements. A malicious one redirects traffic (L5.01); a buggy one (a laptop sharing its connection, a mis-set VM host) breaks the LAN by advertising a useless prefix or lifetime. This is the most common first-hop problem, attack or accident.
- ND spoofing: an attacker answers Neighbor Solicitations for someone else's address with a forged Neighbor Advertisement, or sends unsolicited NAs, to man-in-the-middle or deny service. This is the IPv6 version of ARP spoofing.
- Rogue DHCPv6: a fake DHCPv6 server hands out its own address as DNS (or, with stateful DHCPv6, addresses), so clients send queries or traffic to the attacker.
- Neighbour-cache exhaustion (RFC 6583): because a /64 has 2^64 addresses, an attacker can send traffic to huge numbers of unused addresses on a subnet. The router tries to resolve each one, filling its neighbour-discovery queue and cache, and legitimate hosts can no longer be resolved. This is a denial of service against the router, not a single host.
The defences
RA-Guard (RFC 6105, hardened by RFC 7113). The switch permits RAs only on ports where a real router is expected and drops them on all host ports. The original RA-Guard could be evaded by hiding the RA behind extension headers or fragments; RFC 7113 requires the switch to parse the whole header chain and to drop fragmented RAs, closing that hole. Deploy RA-Guard-aware switches, and combine it with dropping fragmented ND (RFC 6980, L5.04).
DHCPv6-Shield (RFC 7610). The switch drops DHCPv6 server messages (source UDP port 547, the server/relay messages: Advertise, Reply, Reconfigure) arriving on host ports, so only authorised ports can run a DHCPv6 server. Like RA-Guard, it must see through extension headers.
Source Address Validation (SAVI, RFC 7039). SAVI binds an IP source address to the port (and MAC) that legitimately uses it, by watching DAD, DHCPv6 or ND, and drops packets whose source does not match. Variants:
- FCFS SAVI (RFC 6620): first-come, first-served binding for SLAAC and statically assigned addresses.
- DHCP SAVI (RFC 7513): binding driven by DHCPv6 snooping.
SAVI is the LAN-level counterpart to BCP 38 ingress filtering (L4) and stops ND and address spoofing between ports. The threat scope is RFC 6959.
Neighbour-cache exhaustion mitigations (RFC 6583):
- Size subnets so the used space is small, and filter or null-route the unused part of the /64 with an ACL or a discard route, so the router never tries to resolve it.
- Rate-limit the ND resolution queue on the router (most platforms do this by default; it can be tuned).
- Prioritise resolution for addresses already in the cache over new ones, and police new resolutions.
- For server segments, consider a longer prefix (e.g. /120) where SLAAC is not needed, or route a /64 to a discard interface and have hosts announce their /128s (an advanced technique).
Where each control runs
| Control | Blocks | Runs on |
|---|---|---|
| RA-Guard | Rogue/buggy RAs | Access switch, host ports |
| DHCPv6-Shield | Rogue DHCPv6 servers | Access switch, host ports |
| SAVI (FCFS/DHCP) | Source-address and ND spoofing | Access switch |
| ND-queue rate limit, unused-space filter | Neighbour-cache exhaustion | First-hop router |
Not every switch supports all of these; where the hardware does not, a Linux bridge with ebtables/nftables rules, a MikroTik RouterOS bridge filter, or at minimum monitoring (L5.08) is the fallback. Vendor feature names and syntax vary, so verify support and commands on your kit.
ictNetworks scenario
ictNetworks enables RA-Guard and DHCPv6-Shield on every access port of its managed switches, with the uplink to the real router as the only RA- and DHCPv6-server-trusted port. On the hosting LANs it adds SAVI so one compromised VPS cannot spoof another's address, and it filters the unused part of each server /64 and relies on the routers' default ND rate limiting against cache exhaustion. The rogue-RA monitor from L5.08 is the backstop.
Drawing diagram…
Worked examples
Example 1: Which port trusts what
On an access switch, port 1 is the uplink to the router; ports 2–48 are host ports. RA-Guard trusts port 1 for RAs and drops RAs on 2–48. DHCPv6-Shield allows DHCPv6 server messages only from the authorised DHCPv6 server's port (the uplink or a dedicated server port) and drops them on host ports.
Example 2: The RFC 7113 evasion
An attacker sends a rogue RA split so the ICMPv6 RA sits in the second fragment, or hidden behind a Destination Options header. A naive RA-Guard that only checks the first header lets it through. RFC 7113 requires the switch to drop fragmented RAs and to parse the full chain, so both evasions fail.
Example 3: Containing cache exhaustion
A server /64 2001:db8:3000:10::/64 has 40 hosts in ::1 to ::40. Filtering everything above 2001:db8:3000:10::40 toward the subnet (for example a discard route for the /64 with a more specific route only for the used lower part, or an ACL) means an attacker spraying 2001:db8:3000:10:dead::/random addresses never makes the router resolve them.
Lab
Goal: Run each first-hop attack, then block it and confirm the block.
You need: a Linux bridge lab (or a MikroTik RouterOS switch) with a router port, two victim ports and an attacker port; Scapy or THC-IPv6 on the attacker; a DHCPv6 server (e.g. dnsmasq or ISC Kea) on the router port; ndppd/radvd on the router.
- Rogue RA: send a rogue RA from the attacker (L5.01 script) and show the victims take it. Enable RA-Guard (switch feature, or on a Linux bridge drop ICMPv6 type 134 ingress on host ports with
nftablesin thebridgefamily) on all host ports but the router port, and show the rogue RA dropped while the real RA still arrives. Then send a fragmented rogue RA and show whether your RA-Guard (RFC 7113) still blocks it. - ND spoofing: from the attacker, answer NS for a victim's address with a forged NA (or use
parasite6). Show the other victim's cache poisoned. Enable SAVI/FCFS (or, in the Linux lab, a bridge rule binding source address to port) and show the spoofed NA dropped. - Rogue DHCPv6: run a second DHCPv6 server on the attacker handing out a rogue DNS server. Show a victim using it. Enable DHCPv6-Shield (drop UDP src port 547 on host ports) and show the rogue replies dropped while the real server works.
- Neighbour-cache exhaustion: from the attacker, flood the router with traffic to random addresses in the victim /64 (
ndpexhaust6or a Scapy loop). Show the router's ND cache/queue filling and a legitimate host failing to resolve. Apply an unused-space filter (ACL or discard route) and/or an ND rate limit and show legitimate resolution restored. - For each attack, record the before/after state and the exact control that stopped it.
What to submit: attack scripts, captures and switch/bridge configurations for each step, the cache-exhaustion measurements, and a table of attack → control → result.
Summary
- The first hop is defended at the switch, because every host traverses it.
- RA-Guard (RFC 6105/7113) blocks rogue and buggy RAs; it must drop fragmented RAs to resist evasion.
- DHCPv6-Shield (RFC 7610) blocks rogue DHCPv6 servers (UDP source port 547) on host ports.
- SAVI (RFC 7039, FCFS 6620, DHCP 7513) binds source addresses to ports, stopping ND and address spoofing.
- Neighbour-cache exhaustion (RFC 6583) is mitigated by filtering unused space, rate-limiting ND and sizing subnets.
- Verify feature support and syntax per switch; fall back to Linux bridge filtering or monitoring.
- Next lesson (L5.04): extension headers and fragmentation attacks.
Quiz imported · 9 questions · pass mark 70%. Lab questions are not auto-marked.