The ip route-static vpn-instance command configures an IPv4 static route for a VPN instance.
The undo ip route-static vpn-instance command deletes an IPv4 static route from a VPN instance.
By default, no IPv4 static routes are configured for a VPN instance.
ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } vpn-instance vpn-destination-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 ]
undo ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } vpn-instance vpn-destination-name nexthop-address [ inherit-cost ]
Parameter | Description | Value |
---|---|---|
vpn-source-name |
Specifies the name of a source VPN instance. Each VPN instance has its own routing table. The configured static route is added to the routing table of the specified VPN instance. |
The value is a string of 1 to 31 case-sensitive characters, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string. |
destination-address |
Specifies the destination IP address of a static route. |
The value is in dotted decimal notation. |
mask |
Specifies the subnet mask. |
The value is in dotted decimal notation. |
mask-length |
Specifies the mask length. |
The value is an integer ranging from 0 to 32. |
vpn-instance vpn-destination-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, spaces not supported. In addition, the VPN instance name must not be _public_. When double quotation marks are used around the string, spaces are allowed in the string. |
nexthop-address |
Specifies the next hop address of a static route. If the outbound interface is a broadcast interface, the next hop address must be specified. |
- |
recursive-lookup |
Recursive route lookup policy. |
- |
host-route |
Recurses the static route to a 32-bit host route. |
- |
preference preference |
Specifies a priority for the static route. |
The value is an integer ranging from 1 to 255. The default value is 60. The smaller the value, the higher the priority. |
tag tag |
Specifies the tag value of a static route. By configuring different tag values, you can classify static routes to implement different routing policies. For example, routing protocols can import routes with specified tag values through routing policies. |
The value is an integer ranging from 1 to 4294967295. By default, it is 0. |
bfd |
Associates a dynamic BFD session with the static route to fast detect faults. |
- |
enable |
Associates a dynamic BFD session with the static route to fast detect faults. |
- |
track |
Specify a track object. |
- |
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, spaces not supported. |
nqa admin-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 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 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. |
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 EFM OAM extension for static routes. 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 EFM OAM extension for static routes. 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. |
In a scenario in which an L2VPN accesses an L3VPN, the direct-route track pw-state command can be configured to control the cost of a direct route to reduce downstream traffic loss during the traffic switchback after the primary PW recovers. 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, some downstream traffic may be lost during the traffic switchback after the primary PW recovers. To solve this problem, associate static routes with the PW status. If you do not specify outbound interfaces when configuring static routes, the static routes will recurse to direct routes. In this situation, specify inherit-cost so that the static routes can inherit the costs of recursive 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. If you have specified an outbound interface for a static route, you can no longer specify inherit-cost for the static route. |
permanent |
Configures permanent advertisement of the static route. If service traffic needs to be forwarded along a specified path, regardless of the link status. You can specify permanent to configure permanent advertisement of static routes. |
- |
no-advertise |
Prevents static routes 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. |
- |
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:
|
- |
description text |
Specifies the description of the static route. You can specify description to configure a description for static routes. This is convenient for the administrator to check and maintain static routes. 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 description is a string of 1 to 150 characters, spaces supported. |
Usage Scenario
In a simple IPv4 VPN, the ip route-static vpn-instance command can be used to configure static routes for this VPN.
If the destination address and mask of a static route are all 0s, the static route is a default route.Prerequisites
A VPN instance has been configured using the ip vpn-instance command.
BFD has been enabled so that static routes can be associated with the BFD session. An NQA test instance has been created so that static routes can be associated with the NQA test instance.Follow-up Procedure
If a configured static route needs to be sent to the peer PE, import the static route into BGP running between the PEs.
Precautions
If a fault occurs on the network or the topology changes, static routes cannot automatically change. Therefore, exercise caution when configuring static routes.
During the configuration of a static route for a VPN instance, can belong to a VPN instance or a public network. When the next hop address of the static route is a public network address, you need to specify public following nexthop-address. If the outbound interface is a broadcast interface, you need to specify the next hop address. If the undo ip route-static vpn-instance command is run, all static route configurations in the specified VPN instance are deleted. Therefore, exercise caution when running the command. After the static route configuration is saved and the device is restarted in CFG mode, the configuration sequence in the configuration file may be different from that before the restart.<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 vpn-instance vpn2 [*HUAWEI-vpn-instance-vpn2] ipv4-family [*HUAWEI-vpn-instance-vpn2-af-ipv4] quit [*HUAWEI-vpn-instance-vpn2] quit [*HUAWEI] ip route-static vpn-instance vpn1 10.1.1.1 32 vpn-instance vpn2 172.16.1.2