Creating IPv6 static routes

Use static routes to manually configure routes to destination IPv6 address prefixes.

About this task

Not all parameters are available in non-default VRFs.

Procedure

  1. Enter either Global Configuration mode or VRF Router Configuration mode for a specific VRF context:

    enable

    configure terminal

    Optional: router vrf WORD<1-16>

  2. Enable IPv6 static routes globally:

    ipv6 route static enable

    If you disable static routes globally, the system removes all enabled static routes from the RTM and does not add new static routes to the RTM.

  3. Configure a static route:

    ipv6 route WORD<0–46> [enable] [cost <1–65535>] [next-hop WORD<0–46>] [preference <1–255>] [tunnel <1–2000>] [port {slot/port[sub-port]}] [vlan <1-4059>]

  4. Optional: Disable all IPv6 static routes:

    no ipv6 route static enable

  5. Optional: Permanently delete the IPv6 static route configuration:

    clear ipv6 route static [vrf WORD<1–16> | vrfids WORD<0–512>]

Example

Enable IPv6 static routes globally:

Switch:1(config)#ipv6 route static enable

Create and enable a static route through a global nexthop:

Switch:1(config)#ipv6 route 4000::/64 cost 1 next-hop 3000::2 enable

Create and enable a static route through an outgoing interface (VLAN or brouter port):

Switch:1(config)# ipv6 route 4000::/64 cost 1 vlan 1900 enable

Create and enable a static route through a link local nexthop and an outgoing interface:

Switch:1(config)# ipv6 route 4000::/64 cost 1 next-hop fe80::1 vlan 1900 enable

In the preceding example, you must specify the outgoing interface so that the system can apply the correct context to the link-local address.

Variable definitions

Use the data in the following table to use the ipv6 route command.

Variable

Value

WORD <0–46>

Specifies the IPv6 destination address and prefix.

enable

Enables the static route. The default is enabled.

cost <1–65535>

Specifies the cost or distance ratio to reach the destination for this static route. The default is 1.

next-hop Word <0–46>

Specifies the IPv6 address of the next hop on this route. You do not need to specify the next hop if the devices directly connect to one another. Configure the next hop if the two nodes do not share the same network prefix but reside on the same link.

preference <1–255>

Specifies the routing preference of the destination IPv6 address. The default is 5.

{slot/port[/sub-port]}

Identifies a single slot and port. If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

tunnel <1–2000>

Specifies the tunnel ID.

vlan <1-4059>

Specifies the VLAN ID in the range of 1 to 4059. By default, VLAN IDs 1 to 4059 are configurable and the system reserves VLAN IDs 4060 to 4094 for internal use. On switches that support the vrf-scaling and spbm-config-mode boot configuration flags, if you enable these flags, the system also reserves VLAN IDs 3500 to 3998. VLAN ID 1 is the default VLAN and you cannot create or delete VLAN ID 1.