Recursive Static Route

The Recursive Static Route feature enables you to install a recursive static route into the Routing Information Base (RIB) even if the next-hop address of the static route or the destination network itself is already available in the RIB as part of a previously learned route. This module explains recursive static routes and how to configure the Recursive Static Route feature.

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/​go/​cfn. An account on Cisco.com is not required.

Restrictions for Recursive Static Route

When recursive static routes are enabled using route maps, only one route map can be entered per virtual routing and forwarding (VRF) instance or topology. If a second route map is entered, the new map will overwrite the previous one.

Information About Recursive Static Route

Recursive Static Routes

A recursive static route is a route whose next hop and the destination network are covered by another learned route in the Routing Information Base (RIB). Such static routes cannot be installed in the RIB because they are considered redundant routes. The Recursive Static Route feature allows you to install recursive static routes in the RIB, thereby allowing the redistribution of such specific routes within the network. When the learned route covering the next hop or the destination network is withdrawn from the RIB, the recursive static route also gets withdrawn from the RIB.

Given below is a detailed explanation of how recursive static routes work.

Figure 1. How Recursive Static Routes Work



The figure above shows three customers connected to three private virtual routing and forwarding (VRF) instances on a provider edge (PE) device. All three of them have private addressing in their networks.

Let us assume that the network on these VRFs is 10.0.0.0/8. The PE communicates these routes as is to the customer edge (CE) device, along with the VRF information of each customer. For security purposes and to avoid overlapping routes, the CE advertises only /32 routes to the service delivery network (SDN) edge device (which has only a service VRF) rather than advertising the whole 10.0.0.0/8 network for each customer. Static routes can be used to configure /32 routes for specific hosts. However, static routes that are recursive in nature cannot be configured for specific hosts. By default, recursive static routes are eliminated from the Routing Information Base (RIB) because these routes or the next hops to these routes may already be covered by another learned route in the RIB. The Recursive Static Route feature enables a recursive static route to be part of the RIB even if the next-hop address of the static route or the destination network of the static route is already available in the RIB as part of a previously learned route. Additionally, if the learned route that covers the next-hop gateway is withdrawn from the RIB, the recursive static route is also deleted from the RIB.

How to Install Recursive Static Route

Installing Recursive Static Routes in a VRF

Perform these steps to install recursive static routes in a specific virtual routing and forwarding (VRF) instance. You can configure the recursive-static-route functionality on any number of VRFs. Installing recursive static routes in specific VRFs allows you to retain the default RIB behavior (of removing recursive static routes) for the rest of the network.

SUMMARY STEPS

    1.    enable

    2.    configure terminal

    3.    vrf definition vrf-name

    4.    rd route-distinguisher

    5.    address-family {ipv4 | ipv6}

    6.    exit

    7.    exit

    8.    ip route [vrf vrf-name] prefix mask ip-address

    9.    ip route static install-routes-recurse-via-nexthop [vrf vrf-name]

    10.    end

    11.    show running-config | include install

    12.    show ip route vrf vrf-name


DETAILED STEPS
     Command or ActionPurpose
    Step 1 enable


    Example:
    Device> enable
     

    Enables privileged EXEC mode.

    • Enter your password if prompted.

     
    Step 2configure terminal


    Example:
    Device# configure terminal
     

    Enters global configuration mode.

     
    Step 3vrf definition vrf-name


    Example:
    Device(config)# vrf definition vrf1
     

    Creates a virtual routing and forwarding (VRF) routing table instance and enters VRF configuration mode.

     
    Step 4rd route-distinguisher


    Example:
    Device(config-vrf)# rd 100:1
     

    Specifies a route distinguisher for a VRF instance.

     
    Step 5address-family {ipv4 | ipv6}


    Example:
    Device(config-vrf)# address-family ipv4
     

    Enters VRF address family configuration mode to specify an IPv4 or IPv6 address family for a VRF.

     
    Step 6exit


    Example:
    Device(config-vrf-af)# exit
     

    Exits VRF address family configuration mode.

     
    Step 7exit


    Example:
    Device(config-vrf)# exit
     

    Exits VRF configuration mode.

     
    Step 8ip route [vrf vrf-name] prefix mask ip-address


    Example:
    Device(config)# ip route vrf vrf1 10.0.2.0 255.255.255.0 10.0.1.1
     

    Configures a static route for a specific VRF instance.

     
    Step 9ip route static install-routes-recurse-via-nexthop [vrf vrf-name]


    Example:
    Device(config)# ip route static install-routes-recurse-via-nexthop vrf vrf1
     

    Enables recursive static routes to be installed in the RIB of a specific VRF instance.

     
    Step 10end


    Example:
    Device(config)# end
     

    Exits global configuration mode and returns to privileged EXEC mode.

     
    Step 11show running-config | include install


    Example:
    Device# show running-config | inc install
     

    Displays all recursive static route configurations.

     
    Step 12show ip route vrf vrf-name


    Example:
    Device# show ip route vrf vrf1
     

    Displays the IP routing table associated with a specific VRF.

     

    Installing Recursive Static Routes Using a Route Map

    Perform this task to install recursive static routes in a virtual routing and forwarding (VRF) instance defined by a route map. You can perform this task if you want to install recursive static routes for only a certain range of networks. If the route-map keyword is used without the vrf keyword, recursive static routes defined by the route map will be applicable for the global VRF or topology.

    SUMMARY STEPS

      1.    enable

      2.    configure terminal

      3.    vrf definition vrf-name

      4.    rd route-distinguisher

      5.    address-family {ipv4 | ipv6}

      6.    exit

      7.    exit

      8.    ip route [vrf vrf-name] prefix mask ip-address

      9.    access-list access-list-number permit source [source-wildcard]

      10.    route-map map-tag

      11.    match ip address access-list-number

      12.    exit

      13.    ip route static install-routes-recurse-via-nexthop [vrf vrf-name] [route-map map-name]

      14.    end

      15.    show running-config | include install

      16.    show ip route vrf vrf-name


    DETAILED STEPS
       Command or ActionPurpose
      Step 1 enable


      Example:
      Device> enable
       

      Enables privileged EXEC mode.

      • Enter your password if prompted.

       
      Step 2configure terminal


      Example:
      Device# configure terminal
       

      Enters global configuration mode.

       
      Step 3vrf definition vrf-name


      Example:
      Device(config)# vrf definition vrf1
       

      Creates a virtual routing and forwarding (VRF) routing table instance and enters VRF configuration mode.

       
      Step 4rd route-distinguisher


      Example:
      Device(config-vrf)# rd 100:1
       

      Specifies a route distinguisher for a VRF instance.

       
      Step 5address-family {ipv4 | ipv6}


      Example:
      Device(config-vrf)# address-family ipv4
       

      Enters VRF address family configuration mode to specify an IPv4 or an IPv6 address-family type for a VRF.

       
      Step 6exit


      Example:
      Device(config-vrf-af)# exit
       

      Exits VRF address family configuration mode.

       
      Step 7exit


      Example:
      Device(config-vrf)# exit
       

      Exits VRF configuration mode.

       
      Step 8ip route [vrf vrf-name] prefix mask ip-address


      Example:
      Device(config)# ip route vrf vrf1 10.0.2.0 255.255.255.0 10.0.1.1
      
       

      Configures a static route for a specific VRF instance.

       
      Step 9access-list access-list-number permit source [source-wildcard]


      Example:
      Device(config)# access-list 10 permit 10.0.2.0 255.255.255.0
       

      Defines a standard access list permitting addresses that need to be translated.

       
      Step 10route-map map-tag


      Example:
      Device(config)# route-map map1
       

      Defines a route map to control route redistribution and enters route-map configuration mode.

       
      Step 11match ip address access-list-number


      Example:
      Device(config-route-map)# match ip address 10
       

      Matches routes that have a destination network address that is permitted by a standard or extended access list.

       
      Step 12exit


      Example:
      Device(config-route-map)# exit
       

      Exits route-map configuration mode.

       
      Step 13ip route static install-routes-recurse-via-nexthop [vrf vrf-name] [route-map map-name]


      Example:
      Device(config)# ip route static install-routes-recurse-via-nexthop vrf vrf1 route-map map1
       

      Enables installation of recursive static routes defined by a route map into the RIB of a specific VRF.

       
      Step 14end


      Example:
      Device(config)# end
       

      Exits global configuration mode and returns to privileged EXEC mode.

       
      Step 15show running-config | include install


      Example:
      Device# show running-config | inc install
       

      Displays all recursive static route configurations.

       
      Step 16show ip route vrf vrf-name


      Example:
      Device# show ip route vrf vrf1
       

      Displays the IP routing table associated with a specific VRF.

       

      Configuration Examples for Recursive Static Route

      Example: Installing Recursive Static Routes in a VRF

      The following example shows how to install recursive static routes into a specific virtual routing and forwarding instance. By using the vrf keyword, you can ensure that recursive static routes are installed in the Routing Information Base (RIB) of only the specified VRF. The rest of the network retains the default behavior of not installing recursive static routes in the RIB. This example is based on the assumption that a 10.0.0.0/8 route is already installed dynamically or statically in the RIB of vrf1.

      Device> enable
      Device# configure terminal
      Device(config)# vrf definition vrf1
      Device(config-vrf)# rd 1:100
      Device(config-vrf)# address-family ipv4
      Device(config-vrf-af)# exit
      Device(config-vrf)# exit
      Device(config)# ip route vrf vrf1 10.0.2.0 255.255.255.0 10.0.1.1
      Device(config)# ip route static install-routes-recurse-via-nexthop vrf vrf1
      Device(config)# end

      Example: Installing Recursive Static Routes using a Route Map

      You can use the route-map keyword to install recursive static routes defined by the route map into the Routing Information Base (RIB). You can also specify a route map for a specific virtual routing and forwarding (VRF) instance to ensure that the route map is applied to only the specified VRF. In the example given below, a route map is specified for a specific VRF. This example is based on the assumption that a 10.0.0.0/8 route is already installed statically or dynamically in the RIB of vrf1.

      Device> enable
      Device# configure terminal
      Device(config)# vrf definition vrf1
      Device(config-vrf)# rd 100:2
      Device(config-vrf)# address-family ipv4
      Device(config-vrf-af)# exit
      Device(config-vrf)# exit
      Device(config)# access-list 10 permit 10.0.2.0 255.255.255.0
      Device(config)# route-map map1
      Device(config-route-map)# match ip address 10
      Device(config-route-map)# exit
      Device(config)# ip route static install-routes-recurse-via-nexthop vrf vrf1 route-map map1
      Device(config)# ip route vrf vrf1 10.0.2.0 255.255.255.0 10.0.1.1
      Device(config)# ip route vrf vrf1 10.0.3.0 255.255.255.0 10.0.1.1
      Device(config)# end

      In the example above, route 10.0.2.0 255.255.255.0 10.0.1.1 will be installed in the RIB, but the route 10.0.3.0 255. 255.255.0 10.0.1.1 will not be installed in the RIB because this route does not match the network defined in the route map.

      Additional References for Recursive Static Route

      Related Documents

      Related Topic

      Document Title

      Cisco IOS commands

      Cisco IOS Master Command List, All Releases

      IP routing protocol-independent commands

      Cisco IOS IP Routing: Protocol-Independent Command Reference

      Technical Assistance

      Description

      Link

      The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password.

      http:/​/​www.cisco.com/​cisco/​web/​support/​index.html

      Feature Information for Recursive Static Route

      The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

      Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/​go/​cfn. An account on Cisco.com is not required.

      Table 1 Feature Information for Recursive Static Routes

      Feature Name

      Releases

      Feature Information

      Recursive Static Route

      15.3(2)S

      15.3(3)M

      15.2(1)SY

      The Recursive Static Route feature enables you to install a recursive static route into the Routing Information Base (RIB) even if the next-hop address of the static route or the destination network itself is already available in the RIB as part of a previously learned route.

      The following command was introduced: ip route static install-routes-recurse-via-nexthop.