Configure Static Routes

Perform the steps in this task to:

  • Create static routes for data traffic in either the GRT or a specific VRF context for any platform.

  • Create static routes for a VRF associated with a Segmented Management Instance CLIP interface. Specify the name of the VRF context in Step 1.

  • Create static routes for management purposes on VSP 8600 Series:

    • Specify the mgmtRouter vrf in Step 1 to configure static routes for the OOB port.

    • Use Global Configuration mode in Step 1 to configure static routes in the GRT for the inband VLAN or loopback interface.

VSP 8600 Series uses the routing stack to create static routes for data traffic as well as management purposes. For all other platforms, static routes for the management OOB and management VLAN, if supported, must use the Segmented Management Instance. For more information, see Segmented Management Instance Configuration using the CLI. The management CLIP can use the Segmented Management Instance or routes in the associated VRF routing table manager (RTM).

Before you begin

  • Ensure no black hole static route exists. If a black hole route is enabled, you must first delete or disable it before you can add a regular static route to that destination.

    Note

    Note

    Only black hole routes that belong to the static type protocol are supported. An inter-VRF black hole route is not installed in the routing table of the destination VRF on the same switch.

About this task

When you configure a static route with a next-hop-vrf context, you can specify a next-hop IP address that is a locally owned VRRP IP address of the system itself. However, this is not a supported configuration. The best practice is to implement an alternative method of inter-vrf route sharing, such as route redistribution or ISIS accept polices.

For route scaling information and for information on the maximum number of static routes supported on your hardware platform, see VOSS Release Notes.

Note

Note

As a best practice, do not configure static routes on a DvR Leaf node unless the configuration is for reachability to a management network using a Brouter port.

You cannot configure the preference of static routes on a Leaf node.

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. Create an IP static route:

    ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> weight <1–65535>

  3. Enable an IP static route:

    ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> enable

  4. Use the following variable definitions table to configure other static route parameters as required.
  5. View existing IP static routes for the device, or for a specific network or subnet:

    show ip route static

Example

Create an IP static route, enable a static route, and view the existing IP static routes for the device, or for a specific network or subnet.

Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#ip route 192.0.2.2 255.255.0.0 198.51.100.24 weight 20 name ExtSer 10 preference 1
Switch:1(config)#ip route 192.0.2.2 255.255.0.0 198.51.100.24 enable
Switch:1(config)#show ip route static
=================================================================================================
                          IP Static Route - GlobalRouter
=================================================================================================

DEST       MASK          NEXT           NH-VRF      COST PREF LCLNHOP STATUS ENABLE NAME
-------------------------------------------------------------------------------------------------

192.0.2.2  255.255.255.0 198.51.100.24  GlobalRouter 20   1   TRUE    ACTIVE TRUE   ExtSer 10

Variable Definitions

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

Variable

Value

<A.B.C.D> <A.B.C.D> <A.B.C.D>

The first and second <A.B.C.D> specify the IP address and mask for the route destination. The third <A.B.C.D> specifies the IP address of the next-hop router (the next router at which packets must arrive on this route). When you create a black hole static route, configure this parameter to 255.255.255.255 as the IP address of the router through which the specified route is accessible.

disable

Disables a route to the router or VRF.

enable

Adds a static route to the router or VRF.

The no form of this command is no ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> enable.

The default form of this command is default ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> enable.

local-next-hop enable

Enables the local next hop for this static route. The default form of this command is default ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> local-next-hop enable.

The no form of this command is no ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> local-next-hop enable.

next-hop-vrf <WORD 1-16>

Specifies the next-hop VRF instance by name.

After you configure the next-hop-vrf parameter, the static route is created in the local VRF, and the next-hop route is resolved in the next-hop VRF instance (next-hop-vrf).

The default form of this command is default ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> next-hop-vrf <WORD 1-16>.

The no form of this command is no ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> next-hop-vrf <WORD 1-16>.

weight <1-65535>

Specifies the static route cost.

The default form of this command is default ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> weight.

Note:

Do not configure a static interface subnet route with a weight of 1.

name <1-64>

Specifies the name of the static route. You can name the route before or after it is created.

Only 32 characters display. The tilde (~) symbol indicates that the name is truncated.

preference <1-255>

Specifies the route preference.

The default form of this command is default ip route <A.B.C.D> <A.B.C.D> <A.B.C.D> preference.

Use the data in the following table to use the show ip route static command.

Variable

Value

<A.B.C.D>

Specifies the route by IP address.

-s { <A.B.C.D> <A.B.C.D> | default}

Specifies the route by IP address and subnet mask.

vrf WORD<1-16>

Specifies a VRF by name.

vrfids WORD<0-512>

Specifies a range of VRF IDs.

name <1-64>

Specifies the name of the static route. You can name the route before or after it is created.

Only 32 characters display. The tilde (~) symbol indicates that the name is truncated.