thc-ipv6 on Kali: Test IPv6 RA Guard on a Cisco Switch

atk6-fake_router6 added a rogue IPv6 default with pref high and a 2001:db8:99 address. After ipv6 nd raguard device-role host on the access VLAN, the victim kept only the real gateway and zero rogue RAs reached the port.

thc-ipv6 rogue RA and RA Guard lab topology on a Cisco access switch

One rogue Router Advertisement can install a new IPv6 default route on every host that hears it, and the host will trust it over the real gateway. The fastest way to prove your switch stops that is to send a rogue RA yourself with thc-ipv6 and watch what the host does. In my home lab, atk6-fake_router6 added a second IPv6 default route with pref high and a bogus 2001:db8:99::/64 prefix on the victim in a few seconds. After I attached an IPv6 RA Guard policy with device-role host to the access VLAN, the same attack left the victim with only the legitimate gateway and zero rogue RAs reaching the port.

This post is that measured before and after on a Cisco IOS XE Layer 2 switch. The weight is on the switch configuration and how to read the result, not on the attack tool: the rogue RA is one command, used only to confirm the control holds. Run every step inside an isolated lab segment.

thc-ipv6 rogue RA and RA Guard lab topology on a Cisco access switch
Kali sends a rogue RA through SW1 toward the victim. RA Guard host-role on VLAN 10 blocks it; the gateway uplink keeps a router-role policy so legitimate RAs still flow.

Lab setup

The topology is one switch, one Linux victim, the real IPv6 gateway, and a Kali host that plays the rogue router.

  • SW1 — Cisco IOS XE 17.18.2 Layer 2 switch with IPv6 RA Guard
  • Kali — Kali Rolling, thc-ipv6 3.8 (atk6-fake_router6), on eth1
  • Victim — Linux host accepting RAs on eth1
  • GW — the legitimate router advertising 2001:db8:10::/64, pref medium

Port roles: SW1 Et0/1 faces Kali, Et0/2 faces the victim, Et0/3 faces the gateway. All three are access ports in VLAN 10. Addresses use documentation ranges only (2001:db8::/32). Everything here was built in my home lab and torn down afterward, with the configs kept.

Step 1: Install thc-ipv6 on Kali

On Kali the tools ship under the atk6- prefix:

sudo apt install thc-ipv6
atk6-fake_router6 2>&1 | head -2

That confirms the binary is present. atk6-fake_router6 <interface> <prefix> is the one command this test needs. Everything else is Cisco.

Step 2: Baseline the victim

Before any rogue RA, the victim should have exactly one default route, learned from the real gateway, plus one global address from 2001:db8:10::/64.

victim@victim:~$ ip -6 route show default
victim@victim:~$ ip -6 addr show dev eth1 scope global | grep inet6
victim@victim:~$ rdisc6 -1 eth1
Victim IPv6 default route and address before the rogue RA
Victim IPv6 default route and address before the rogue RA

One default via the gateway's link-local, pref medium, lifetime 1800 seconds, MTU 1500, and one 2001:db8:10:: address. rdisc6 -1 sends a single Router Solicitation and prints the RA it gets back, which is a clean way to see the gateway's advertised preference and prefix. This is the state RA Guard has to preserve.

Step 3: Send a rogue RA with RA Guard off

With no RA Guard policy attached yet, start the rogue router from Kali:

sudo atk6-fake_router6 eth1 2001:db8:99::/64

fake_router6 sends Router Advertisements every few seconds with pref high by default. Within seconds the victim installs a second default route and autoconfigures an address in the rogue prefix.

victim@victim:~$ ip -6 route show default
victim@victim:~$ ip -6 addr show dev eth1 scope global | grep inet6
Victim picks up a second IPv6 default with pref high and a rogue prefix
Victim picks up a second IPv6 default with pref high and a rogue prefix

Two defaults now. The rogue one points at Kali's link-local, carries pref high, MTU 9500, hop limit 255, and a 4363-second lifetime. The victim also autoconfigured a 2001:db8:99:0:... address, so new IPv6 flows can leave through the attacker. That is the failure this lab is built to catch.

Why the rogue RA wins

A capture on the victim shows why the rogue beats the gateway:

tcpdump decode of the rogue RA next to the legitimate RA
tcpdump decode of the rogue RA next to the legitimate RA

Read the two RAs side by side. The rogue RA (from Kali's link-local fe80::a8c1:abff:fe16:c340) sets the router preference field to high; the gateway's RA (from fe80::a8bb:ccff:fe00:110) is medium. RFC 4191 says a host picks the higher-preference default router when several exist, so pref high outranks the gateway until something drops it. Two other fields in the decode are useful tells: the rogue advertises MTU 9500 and a 2001:db8:99::/64 prefix with the on-link and autoconfig flags set, while the real gateway advertises MTU 1500 and 2001:db8:10::/64. The preference field is exactly what RA Guard inspects, which is why a device-role host port can reject the RA before the host ever evaluates it.

Step 4: Configure RA Guard on the switch

RA Guard filters Router Advertisements per port or per VLAN based on a device role. A host role drops RAs; a router role lets them through. The clean pattern is to apply a host policy to the whole user VLAN and a router policy only to the uplink that carries the real gateway.

configure terminal
 ipv6 nd raguard policy HOST-PORTS
  device-role host
 exit
 ipv6 nd raguard policy ROUTER-PORT
  device-role router
 exit
 vlan configuration 10
  ipv6 nd raguard attach-policy HOST-PORTS
 exit
 interface Ethernet0/3
  ipv6 nd raguard attach-policy ROUTER-PORT
 end

Attaching the host policy to vlan configuration 10 covers every access port in the VLAN at once, so you do not have to remember each new host port. The port-level ROUTER-PORT policy on Et0/3 overrides the VLAN policy for that one interface, so the gateway's RAs are still accepted.

SW1# show ipv6 nd raguard policy HOST-PORTS
SW1# show ipv6 nd raguard policy ROUTER-PORT
RA Guard host policy on the VLAN and router policy on the uplink
RA Guard host policy on the VLAN and router policy on the uplink

The output confirms the host policy is applied to vlan 10 and the router policy to Et0/3. The Target column is where you verify the scope: a host policy accidentally applied to the gateway port would block legitimate RAs and black-hole IPv6 for the whole VLAN.

Step 5: Re-run the attack with RA Guard on

First check the real gateway still reaches the victim through the router-role port. Flush the victim's IPv6 state and let it re-solicit:

victim@victim:~$ sudo ip -6 route flush default
victim@victim:~$ sudo ip -6 addr flush dev eth1 scope global
victim@victim:~$ rdisc6 -1 eth1

The victim gets back exactly one default, from the gateway, pref medium. Good. Now run the same fake_router6 for 20 seconds, capturing on the victim's port, and watch:

RA Guard on: only the legitimate default remains and zero rogue RAs reached the host
RA Guard on: only the legitimate default remains and zero rogue RAs reached the host

After the attack window the victim still has one default, still pref medium, still via the gateway. No 2001:db8:99:: address appeared. A capture on the victim's port during those 20 seconds recorded zero Router Advertisements from Kali's link-local, which means the switch dropped the rogue RAs before they ever reached the host. That is the RA Guard pass, and the host route table is the decisive proof.

Reading first-hop security: RA Guard vs the rest

RA Guard is one feature in IPv6 First-Hop Security. It is easy to assume it covers more than it does.

FeatureWhat it filtersWhere it helps
RA GuardRogue Router AdvertisementsStops fake default routers and prefixes on host ports
DHCPv6 GuardRogue DHCPv6 server repliesStops fake stateful addressing and DNS
IPv6 ND Inspection / snoopingNeighbor Discovery bindingsBuilds an IP-to-MAC-to-port table, feeds other guards
IPv6 Source GuardSpoofed source addressesDrops traffic from addresses not in the binding table

The short version: RA Guard filters RAs, DHCPv6 Guard filters DHCPv6, and they do not substitute for each other. On a production access layer you usually want RA Guard, DHCPv6 Guard, and ND inspection together.

What breaks

RA Guard is a filter on a Layer 2 port, and the ways it bites are mostly about scope and timing.

  • A host policy on the gateway port is an IPv6 outage. device-role host drops every RA, including the legitimate one. If you attach the host policy to the uplink by mistake, the whole VLAN loses its IPv6 default route. Keep the router role on the one interface that legitimately carries RAs.
  • Existing host state is not cleaned up. RA Guard stops new RAs arriving; it does not delete a default route or address the host already learned. If the rogue route is still there after you enable the guard, that is leftover state. Flush routes and addresses, re-solicit, then judge.
  • It does not touch DHCPv6 or link-local. An attacker blocked from sending RAs can still try a rogue DHCPv6 server, and hosts still talk link-local for Neighbor Discovery. RA Guard is one layer, not the whole stack.
  • Counter support is not guaranteed. Behavior is the proof; drop counters are a nice-to-have that some images do not expose (see the gotcha below).

RA Guard verification cheat sheet

CommandRuns onWhat to check
rdisc6 -1 eth1hostWhich router, preference, prefix the host sees right now
ip -6 route show defaulthostOne default via the real gateway, pref medium
ip -6 addr show dev eth1 scope globalhostNo address from the rogue prefix
show ipv6 nd raguard policy <name>switchHost policy on the VLAN, router policy on the uplink only
show ipv6 nd raguard countersswitchDrops, where the image supports it
tcpdump -nn 'icmp6 and ip6[40]==134'hostZero rogue RAs reaching the port under attack

Gotchas

Counters are not available on every image. On this IOS XE L2 image, show ipv6 nd raguard counters and show ipv6 snooping counters both return % Invalid input detected.

RA Guard counters are not supported on this image
RA Guard counters are not supported on this image

Do not treat a missing counter command as a broken policy. The behavioral proof, the host's route table before and after, is what matters. On Catalyst platforms that do expose first-hop security counters, check them as a second signal.

The host must actually accept RAs to test. A Linux host that is also forwarding sets accept_ra=0 by default and ignores RAs entirely. For this test the victim needs net.ipv6.conf.eth1.accept_ra set to 1, or 2 if it forwards, or the baseline never picks up the gateway in the first place.

The host keeps old state. RA Guard stops new RAs; it does not remove a default route the host already learned. Flush routes and addresses, then re-solicit, before you judge the result.

Prefix argument matters. Running fake_router6 with a prefix gives the clear autoconfig evidence this lab needs. Use a documentation prefix such as 2001:db8:99::/64.

Lab only. Rogue RAs on a production VLAN are an outage. Keep this on an isolated segment and tear it down afterward.

FAQ

Does RA Guard replace DHCPv6 Guard?

No. RA Guard filters Router Advertisements; DHCPv6 Guard filters DHCPv6 server replies. An attacker who cannot send RAs may still try a rogue DHCPv6 server. Deploy both on host ports.

Why did the rogue RA win over the real gateway?

Router Advertisements carry a preference of low, medium, or high. Per RFC 4191 a host prefers the higher preference when several defaults exist. fake_router6 sends high by default, so its default route outranked the gateway's medium until RA Guard dropped it.

Should I attach the policy to the VLAN or to each port?

VLAN-level (vlan configuration) is less error-prone because every access port in the VLAN inherits it, including ports you add later. Use a port-level router policy only on the interfaces that legitimately carry RAs.

What if the victim still has the rogue route after RA Guard is on?

That is leftover state, not a guard failure. Flush the host's default routes and global addresses, re-solicit with rdisc6 -1, then re-check. RA Guard only stops new RAs arriving.

Does RA Guard stop the rogue host from reaching the network at all?

No. It filters Router Advertisements only. The rogue host can still send ordinary traffic; it just cannot advertise itself as a router to the VLAN. Pair RA Guard with port security and ND inspection if you also need to constrain what a host may source.

Is a virtual Layer 2 switch enough to validate this?

For the behavioral proof, the host route table before and after, yes. For drop counters and production-faithful first-hop security, validate on the Catalyst platform you actually run, since counter support varies by image.

Key takeaways

  • atk6-fake_router6 <if> <prefix> installs a high-preference default route and a rogue prefix on hosts when RA Guard is off; the router preference field is why it wins.
  • An ipv6 nd raguard policy with device-role host, attached to the user VLAN, drops those RAs; a device-role router policy on the uplink keeps the real gateway working.
  • The decisive proof is the host's ip -6 route show default before and after, backed by a capture showing zero rogue RAs reached the port, not the switch config alone.
  • Counter support varies by image, so rely on host behavior and pair RA Guard with DHCPv6 Guard and ND inspection in production.

One line of scope: this validates RA Guard against a rogue RA; it does not cover DHCPv6 Guard or ND inspection, which deserve their own tests.

More in this series: Yersinia on Kali to test DTP trunk negotiation on the same access switch, arpwatch to catch other Layer 2 spoofing on the wire, and How to Use Wireshark to read the RA captures.

Read next