ip route-static vpn-instance (System view)

Function

The ip route-static vpn-instance command configures an IPv4 static route for a VPN instance.

By default, no IPv4 static routes are configured for a VPN instance.

Format

ip route-static ip-address { mask | mask-length } vpn-instance vpn-instance-name nexthop-address [ recursive-lookup host-route ] [ preference preference | tag tag ] * [ bfd enable | track { bfd-session cfg-name | nqa admin-name test-name | efm-state { interface-name | interface-type interface-number } } | inherit-cost | permanent ] [ no-advertise | no-install ] [ inter-protocol-ecmp ] [ description text ]

Parameters

Parameter Description Value
ip-address

Specifies a destination IP address.

The value is in dotted decimal notation.

mask

Specifies a subnet mask.

The value is in dotted decimal notation.

mask-length

Specifies a mask length. The 32-bit mask requires consecutive 1s. Therefore, the mask in dotted decimal notation can be replaced by the mask length.

The value is an integer that ranges from 0 to 32.

vpn-instance vpn-instance-name

Specifies the name of the destination VPN instance. If the name of the destination VPN instance is specified, the device searches the routing table of the destination VPN instance for the static route's outbound interface based on the configured next hop address.

The value is a string of 1 to 31 case-sensitive characters, which do not contain spaces. The VPN instance name cannot be _public_. The character string can contain spaces if it is enclosed with double quotation marks (").

nexthop-address

Specifies the next-hop IP address.

The value is in dotted decimal notation.

recursive-lookup

Recurses the static route to a 32-bit host route.

-

host-route

Recurses the static route to a host route.

-

preference preference

Priority of a static route.

The value is an integer that ranges from 1 to 255. The default value is 60. A smaller value indicates a higher priority.

tag tag

Specifies a tag value for the static route. The tag can be used by a routing policy. For example, the tag can be used during route import.

The value is an integer ranging from 1 to 4294967295. The default value is <b>0</b>.

bfd

Binds a dynamic BFD session to static routes to quickly detect faults.

-

enable

Binds a dynamic BFD session to static routes to quickly detect faults.

-

track

Specifies the object to be traced.

-

bfd-session cfg-name

Associates a static BFD session with the static route to fast detect faults.

The undo ip route-static [ track bfd-session ] all command with track bfd-session cfg-name specified dissociates the static route from the current BFD session only without deleting the static route.

The value is a string of 1 to 64 case-sensitive characters. It cannot contain spaces.

nqa admin-name

Associates a static route with an NQA test instance to fast detect faults. The system determines whether to activate a static route based on the link test result of NQA. This helps control static route advertisement and correctly forward the traffic from the remote end.

Currently, only ICMP and TCP NQA test instances can be bound to static routes to implement fast fault detection.

The value is a string of 1 to 32 case-sensitive characters.

test-name

Associates the static route with an NQA test instance to fast detect faults so that the system determines whether to activate the static route based on the NQA link detection result to control route advertisement and guide remote traffic.

Currently, only ICMP NQA test instances can be bound to static routes to implement fast fault detection.

The value is a string of 1 to 32 case-sensitive characters.

efm-state interface-type

Specifies the interface whose EFM OAM status needs to be detected.

After track efm-state is configured, the system responds to the interface Up/Down event that is triggered by the change of EFM OAM extension status, and determines whether to activate static routes. In this manner, route advertisement can be controlled, and the traffic from the remote end can be correctly forwarded. Currently, this parameter can be used only on IPv4 networks, because IPv6 networks do not provide corresponding association functions.

The interfaces to be detected through track efm-state must be Ethernet interfaces or GE interfaces.

-

interface-number

Specifies the interface whose EFM OAM status needs to be detected.

After track efm-state is configured, the system responds to the interface Up/Down event that is triggered by the change of EFM OAM extension status, and determines whether to activate static routes. In this manner, route advertisement can be controlled, and the traffic from the remote end can be correctly forwarded. Currently, this parameter can be used only on IPv4 networks, because IPv6 networks do not provide corresponding association functions.

The interfaces to be detected through track efm-state must be Ethernet interfaces or GE interfaces.

-

inherit-cost

Enables the static route to inherit the cost of recursive routes.

If you have specified an outbound interface for a static route, you can no longer specify inherit-cost for the static route.

In an L2VPN accessing L3VPN scenario, the direct-route track pw-state command is used to control the cost of a direct route. This prevents traffic loss caused by a primary/secondary PW switchover after the primary PW recovers.

In fact, the CSG is connected to a number of base stations. These base stations usually use logical IP addresses to communicate with AGGs. As a result, packets cannot be forwarded over direct routes between base stations and AGGs. In addition, AGGs do not have routes to the logical IP addresses of stations. In this situation, static routes must be configured on AGGs. As network administrators usually configure consecutive logical IP addresses for base stations based on IP address planning, you need to configure static routes to specific base stations on AGGs. If the static routes are not associated with the PW status, after the primary PW recovers, traffic is temporarily lost during the primary/secondary link switchover.

To solve this problem, associate static routes with the PW status. If you do not specify the outbound interfaces when configuring static routes, the static routes will recurse to direct routes. In this situation, specify inherit-cost so that the static routs can inherit the costs of direct routes. Because the costs of direct routes are determined by the PW status, this configuration can associate static routes with the PW status, which reduces traffic loss during the traffic switchback.

permanent

Configures permanent advertisement of the static route.

-

no-advertise

Prevents the static route from being advertised.

In network maintenance scenarios, static routes are required to verify services. If you do not want these static routes to be imported by other protocols, specify no-advertise to prevent these static routes from being advertised.

no-advertise takes effect only when it is configured for all the active static routes with the same destination address and mask.

-

no-install

Prevents the static route from being delivered to the FIB. If multiple static routes with the same prefix and mask length are configured using the command repeatedly, all the static routes can be delivered to the FIB as long as no-install is not specified in the command when configuring one of the static routes.

The no-install and no-advertise parameters are mutually exclusive.

-

inter-protocol-ecmp

Enables inter-protocol load balancing among static routes and the routes of dynamic routing protocols.

If a static route is the optimal or suboptimal route and the optimal and suboptimal routes share the same priority, the static route and the routes of dynamic routing protocols can participate in inter-protocol load balancing. If inter-protocol load balancing among static routes and the routes of dynamic routing protocols is enabled for any static route in the routing table, the other static routes in the routing table that have the same prefix as that of this static route can also participate in inter-protocol load balancing with the routes of dynamic routing protocols.

Intra-protocol and inter-process load balancing and inter-protocol load balancing are mutually exclusive. If you configure them both, the former takes effect.

Inter-protocol load balancing does not take effect in the following cases:

  • Among routes imported using the import-rib command and other routes.
  • Among black-hole routes and non-black-hole routes.
  • Among Vlink routes and non-Vlink routes.

-

description text

Specifies the description of the static route.

To check the configured description, run the display this or display current-configuration command in the system view.

The description parameter cannot be followed by other parameters, such as bfd and preference. Otherwise, the configuration will be used only as the description. For example, if ip route-static 1.1.1.1 255.255.255.255 NULL0 description aa preference 10 is run, aa preference 10 is used as the description.

The value is a string of 1 to 150 characters, spaces supported.

Views

System view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
route-base write

Usage Guidelines

Usage Scenario

On a simple network, static routes alone can ensure that the network runs properly. If the Device cannot run dynamic routing protocols to generate routes to the destination, configure static routes on the Device.

Prerequisites

BFD must have been enabled when you bind a static route to a BFD session.

An NQA test instance must have been created when you bind it to a static route.

EFM must have been enabled when you associate EFM OAM with a static route.

The function that allows static routes to recurse to ARP Vlink direct routes must have been enabled globally using the ip route recursive-lookup arp vlink-direct-route protocol static command when you enable a device to recurse a static route only to an ARP Vlink route.

Precautions

When configuring a unicast static route, pay attention to the following points:

  • Only public network routes can recurse to tunnels;
  • When a route is deleted, the preference, tag, and description attributes can be specified, but these attributes are not displayed in the command help;
  • If both the destination IP address and the mask are 0.0.0.0, the configured route is the default route. If the routing table fails to be checked, the default route is used to forward packets;
  • Different priorities can be configured to implement different route management policies. For example, if multiple routes with the same priority are configured for the same destination, load balancing can be implemented among these routes. If different priorities are specified, route backup is implemented;
  • When configuring a static route, you can specify the outbound interface interface-type interface-number, next-hop address nexthop-address, or both the outbound interface and next-hop address as required. Actually, the next hop address must be specified for all routing entries. Before sending a packet, the router searches the routing table for the route that matches the destination address of the packet according to the longest match principle. The link layer can find the corresponding link layer address and forward packets only after the next hop address is specified. When specifying an outbound interface, pay attention to the following points:
  • For a point-to-point interface, specifying the outbound interface indicates that the next hop address is specified. In this case, the address of the peer interface connected to the interface is the next hop address of the route.
  • NBMA interfaces support point-to-multipoint networks. In this case, you need to configure IP routes and map IP addresses to link-layer addresses. In this case, the next-hop IP address must be configured.
  • When configuring a static route, you are not advised to specify a broadcast interface (such as an Ethernet interface) as the outbound interface. This is because the Ethernet interface is a broadcast interface. As a result, multiple next hops exist and the next hop cannot be determined uniquely. In actual applications, if a broadcast interface (such as an Ethernet interface) must be specified as the outbound interface, you must also specify the next hop address of the outbound interface.
  • A black-hole route is generated in the following situations:
  • Configure a static route and specify NULL0 as the outbound interface. The route is a black-hole route.
  • If a static route is iterated to a black-hole route, the static route is also a black-hole route.
  • If the next hop of the static route and the IP address of the outbound interface are not on the same network segment, traffic may fail to be forwarded.
  • An interface has been configured as the outbound interface of a static route. If the IP address of the outbound interface needs to be changed and the new IP address is not on the same network segment as the next-hop IP address of the static route, traffic may fail to be forwarded.
  • The undo ip route-static all command deletes all static routes and configurations on the public network. Therefore, exercise caution when running this command.
  • If both a static route with a specified next-hop IP address or outbound interface and a static route with a specified VPN instance but no outbound interface or next-hop address specified (that is, the Next-Table function is configured) are configured for the same destination address, the last configured static route takes effect, the previous static route is overwritten.
  • After the static route configuration is saved and the device is restarted in CFG mode, the configuration file sequence may be different from that before the restart.
  • The undo ip route-static command is used to delete an IPv4 unicast static route.

Example

# Configure an IPv4 static route and set the next hop address to 10.11.0.1.
<HUAWEI> system-view
[~HUAWEI] ip vpn-instance vpn1
[*HUAWEI-vpn-instance-vpn1] ipv4-family
[*HUAWEI-vpn-instance-vpn1-af-ipv4] quit
[*HUAWEI-vpn-instance-vpn1] quit
[*HUAWEI] ip route-static 1.2.3.4 32 vpn-instance vpn1 10.11.0.1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >