ip route-static recursive-lookup tunnel

Function

The ip route-static recursive-lookup tunnel command allows static routes to recurse to tunnels.

The undo ip route-static recursive-lookup tunnel command restores the default configuration.

By default, static routes cannot recurse to tunnels.

Format

ip route-static recursive-lookup tunnel [ [ ip-prefix ip-prefix-name ] [ tunnel-policy policy-name ] ]

undo ip route-static recursive-lookup tunnel

Parameters

Parameter Description Value
ip-prefix ip-prefix-name

Specifies the name of an IP prefix list.

The name is a string of 1 to 169 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.

tunnel-policy policy-name

Specifies the name of a tunnel policy.

The value is a string of 1 to 39 case-sensitive characters, spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.

Views

System view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
route-base write

Usage Guidelines

Usage Scenario

By default, static routes can recurse to outbound interfaces and next hops, but not to tunnels. To allow static routes to preferentially recurse to tunnels, run the ip route-static recursive-lookup tunnel command. If no tunnels are available after the command is run, static routes recurse to outbound interfaces and next hops.

  • If ip-prefix ip-prefix-name is specified in the command, only the static routes that match the specified IP prefix list recurse to tunnels.
  • If tunnel-policy policy-name is specified in the command, static routes recurse to the tunnels that match the specified tunnel policy.
  • If neither ip-prefix ip-prefix-name nor tunnel-policy policy-name is specified, all static routes preferentially recurse to LSPs.

Precautions

If the route recursive-lookup tunnel command is run more than once, the latest configuration overrides the previous one.

The ip route-static recursive-lookup tunnel and route recursive-lookup tunnel commands are mutually exclusive.

A static route preferentially recurses to an IP route. If a static route recurses to a BGP route, the static route no longer recurses to a tunnel. If a static route recurses to a direct route, the static route no longer recurses to a tunnel. If a static route recurses to a non-BGP and non-direct route, the static route finally recurses to a tunnel based on the tunnel policy. If the static route recurses to a network segment, not to a host route, the network segment address is used to subscribe to a tunnel. Therefore, a non-BGP and non-direct route to the next hop of a static route must exist so that the static route recurses to a tunnel (public network tunnel). If a BGP LSP tunnel exists in the tunnel iteration result, the BGP LSP tunnel is discarded. If other types of tunnels are included in the iteration result, select other types of tunnels. Otherwise, select the IP iteration result.

Example

# Allow static routes to recurse to tunnels.
<HUAWEI> system-view
[~HUAWEI] ip ip-prefix px1 permit 10.0.192.0 8 greater-equal 17 less-equal 18
[*HUAWEI] tunnel-policy tp1
[*HUAWEI-tunnel-policy-tp1] tunnel select-seq cr-lsp lsp load-balance-number 2
[*HUAWEI-tunnel-policy-tp1] quit
[*HUAWEI] ip route-static recursive-lookup tunnel ip-prefix px1 tunnel-policy tp1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >