Configuring static IPv6 routes

This feature enables you to create static routes (including null routes with or without ICMP notification to the sender) by adding such routes directly to the route table in the routing switch.

This section describes how to add static and null routes to the IPv6 route table.

Syntax:

ipv6 route <dest–ipv6–addr>|<prefix–length> <next-hop–gateway–addr | vlan <vid> | blackhole | reject > [distance <1–255>]

no ipv6 route <dest–ipv6–addr>|<prefix–length> <next-hop–gateway–addr | vlan <vid> | blackhole | reject > [distance <1–255>]

<dest–ipv6–addr>|<prefix–length> : Network prefix for the destination on IPv6 address.

<next-hop–gateway–addr|vlan <vid> : The gateway for reaching the destination.

The next-hop address option (link-local or global unicast) is not required to be directly reachable on a local subnet. (If it is not directly reachable, the route is added to the routing table when a path to this address is learned.)

If the next-hop address is link-local, it must include both the address and the applicable VLAN VID.

For example: FE80::127%vlan10,where VLAN 10 is the interface where FE80::127 exists.

blackhole : Specifies a null route where IP traffic for the specified destination is discarded and no ICMP error notification is returned to the sender.

reject : Specifies a null route where IP traffic for the specified destination is discarded and an ICMP error notification is returned to the sender.

distance : Specifies the administrative distance to associate with a static route. Default: 1; Range: 1–255

The no form of the command deletes the specified static or null route from the routing table.

The no form of the command deletes the specified route from the routing table for the specified destination next-hop pair.

The following example shows how to configure two static routes for traffic delivery and identifies two other null routes for which traffic should be discarded instead of forwarded:

Switch(config)# ipv6 route 2001:db8:0:1::/64 fe80::10.1

Configures static route to a specific destination network. Notice that the next-hop gateway can be either a link-local or a global unicast address.

Switch(config)# ipv6 route 2001:db8:0:2::/64 reject

Configures a null route to drop traffic for the 2001:db8:0:2::/64 network and return an ICMP notice to the sender.

Switch(config)# ipv6 route 2001:db8:0:5::/64 blackhole

Configures a null route to drop traffic for the 2001:db8:0:2::/64 network without ICMP notice to the sender.

Switch(config)# ipv6 route 2001:db8::/48 vlan 66 distance 120

Configures a static route for traffic to destinations in the 2001:db8:0::/48 network. Sets the administrative distance higher than the default distance for any dynamic routes discovered for the same destination, which gives precedence in the routing table to dynamic routes.