ipv6 route
IPv6 static routes work the same way. Turn on ipv6 unicast-routing first, then:
| Route | Command |
|---|---|
| Next hop (global) | ipv6 route 2001:db8:3::/64 2001:db8:12::2 |
| Next hop (link-local) | ipv6 route 2001:db8:3::/64 g0/1 fe80::2 |
| Default route | ipv6 route ::/0 2001:db8:12::2 |
| Floating (AD 5) | ipv6 route 2001:db8:3::/64 2001:db8:13::2 5 |
A link-local address (fe80::) is the same on every link, so IOS needs the exit interface with it. Routing protocols use link-local next hops too, so you'll see them a lot.
In NetLab
▶ R1 R1>enable R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ipv6 route ::/0 g0/1 fe80::2 R1(config)#end *Mar 1 00:00:04.000: %SYS-5-CONFIG_I: Configured from console by console ▶ R3 R3>enable R3#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R3(config)#ipv6 route ::/0 g0/0 fe80::2 R3(config)#end *Mar 1 00:00:08.000: %SYS-5-CONFIG_I: Configured from console by console ▶ R2 R2>enable R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#ipv6 route 2001:db8:1::/64 2001:db8:12::1 R2(config)#ipv6 route 2001:db8:3::/64 2001:db8:23::2 R2(config)#end *Mar 1 00:00:13.000: %SYS-5-CONFIG_I: Configured from console by console R2#show ipv6 route static IPv6 Routing Table - default - 7 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, R - RIP, H - NHRP, I1 - ISIS L1 I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP EX - EIGRP external, ND - ND Default, NDp - ND Prefix, DCE - Destination NDr - Redirect, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1 OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eid a - Application S 2001:DB8:1::/64 [1/0] via 2001:DB8:12::1 S 2001:DB8:3::/64 [1/0] via 2001:DB8:23::2 ▶ R1 R1#ping 2001:db8:3::1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:DB8:3::1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Common mistake:
ipv6 route 2001:db8:3::/64 fe80::2without the interface is rejected: "Interface has to be specified for a link-local nexthop".