- Table of Contents
-
- 05-Layer 3—IP Routing Command Reference
- 00-Preface
- 01-Basic IP routing commands
- 02-Static routing commands
- 03-RIP commands
- 04-OSPF commands
- 05-IS-IS commands
- 06-BGP commands
- 07-Policy-based routing commands
- 08-IPv6 static routing commands
- 09-RIPng commands
- 10-OSPFv3 commands
- 11-IPv6 policy-based routing commands
- 12-Routing policy commands
- 13-DCN commands
- Related Documents
-
Title | Size | Download |
---|---|---|
02-Static routing commands | 219.73 KB |
Contents
display route-static routing-table
ip route-static default-preference
ip route-static fast-reroute auto
ip route-static primary-path-detect bfd echo
Static routing commands
delete static-routes all
Use delete static-routes all to delete all static routes.
Syntax
delete [ vpn-instance vpn-instance-name ] static-routes all
Views
System view
Predefined user roles
network-admin
Parameters
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, the command deletes all static routes for the public network.
Usage guidelines
CAUTION: Deleting all static routes with caution. This operation might cause network connectivity failure and packet forwarding failure. |
When you use this command, the system will prompt you to confirm the operation before deleting all the static routes.
To delete one static route, use the undo ip route-static command. To delete all static routes, including the default route, use the delete static-routes all command.
Examples
# Delete all static routes.
<Sysname> system-view
[Sysname] delete static-routes all
This will erase all IPv4 static routes and their configurations, you must reconfigure all static routes.
Are you sure?[Y/N]:y
Related commands
ip route-static
display route-static nib
Use display route-static nib to display static route next hop information.
Syntax
display route-static nib [ nib-id ] [ verbose ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
nib-id: Specifies a NIB by its ID, a hexadecimal string of 1 to ffffffff. If you do not specify this argument, the command displays all static route next hop information.
verbose: Displays detailed static route next hop information. If you do not specify this keyword, the command displays brief static route next hop information.
Examples
# Displays brief static route next hop information.
<Sysname> display route-static nib
Total number of nexthop(s): 44
NibID: 0x11000000 Sequence: 0
Type: 0x21 Flushed: Yes
Age: 00h01m50s
UserKey0: 0x111 VrfNthp: 0
UserKey1: 0x0 Nexthop: 0.0.0.0
IFIndex: 0x111 LocalAddr: 0.0.0.0
NewUK0: 0x0 NewUK1: 0x0
NewUK2: 0x0 NewUK3: 0x0
NewUK4: 0x0 NewUK5: 0x0
NewUK6: 0x0 NewUK7: 0x0
TopoNthp: 0 ExtType: 0x0
FIRType: Normal Threshold: 0
NibID: 0x11000001 Sequence: 1
Type: 0x41 Flushed: Yes
Age: 00h01m50s
UserKey0: 0x0 VrfNthp: 5
UserKey1: 0x0 Nexthop: 2.2.2.2
IFIndex: 0x0 LocalAddr: 0.0.0.0
NewUK0: 0x0 NewUK1: 0x0
NewUK2: 0x0 NewUK3: 0x0
NewUK4: 0x0 NewUK5: 0x0
NewUK6: 0x0 NewUK7: 0x0
TopoNthp: 0 ExtType: 0x0
FIRType: Normal Threshold: 0
Table 1 Command output
Field |
Description |
NibID |
ID of the NIB. |
Sequence |
Sequence number of the NIB. |
Type |
Type of the NIB. |
Flushed |
Indicates whether the route with the NIB has been flushed to the FIB. |
Age |
Elapsed time since the next hop information was last updated. |
UserKey0 |
Reserved data 1. |
UserKey1 |
Reserved data 2. |
VrfNthp |
Index of the VPN instance that the next hop belongs to. This field displays 0 if the next hop is on the public network. |
Nexthop |
Next hop address. |
IFIndex |
Interface index |
LocalAddr |
Local interface address. |
NewUK0 |
New reserved data 1. |
NewUK1 |
New reserved data 2. |
NewUK2 |
New reserved data 3. |
NewUK3 |
New reserved data 4. |
NewUK4 |
New reserved data 5. |
NewUK5 |
New reserved data 6. |
NewUK6 |
New reserved data 7. |
NewUK7 |
New reserved data 8. |
TopoNthp |
This field is not supported in the current software version. Index of the topology that contains the next hop. This field displays 0 if the next hop is on the public network. |
ExtType |
NIB extension type. |
FIRType |
Type of the link for the next hop in FIR ECMP mode: · Normal. · Primary. · Secondary. |
Threshold |
Bandwidth usage level of primary links in FIR ECMP mode. |
# Displays detailed static route next hop information.
<Sysname> display route-static nib verbose
Total number of nexthop(s): 44
NibID: 0x11000000 Sequence: 0
Type: 0x21 Flushed: Yes
Age: 00h01m50s
UserKey0: 0x111 VrfNthp: 0
UserKey1: 0x0 Nexthop: 0.0.0.0
IFIndex: 0x111 LocalAddr: 0.0.0.0
NewUK0: 0x0 NewUK1: 0x0
NewUK2: 0x0 NewUK3: 0x0
NewUK4: 0x0 NewUK5: 0x0
NewUK6: 0x0 NewUK7: 0x0
TopoNthp: 0 ExtType: 0x0
FIRType: Normal Threshold: 0
RefCnt: 2 FlushRefCnt: 0
Flag: 0x2 Version: 1
ExtFlag: 0x0
1 nexthop(s):
PrefixIndex: 0 OrigNexthop: 0.0.0.0
RelyDepth: 0 RealNexthop: 0.0.0.0
Interface: NULL0 LocalAddr: 0.0.0.0
TunnelCnt: 0 Vrf: default-vrf
TunnelID: N/A Topology: base
Weight: 1000000 Flags: 0x0
RealFIRType: Normal RealThres: 0
NibID: 0x11000001 Sequence: 1
Type: 0x41 Flushed: Yes
Age: 00h01m50s
UserKey0: 0x0 VrfNthp: 5
UserKey1: 0x0 Nexthop: 2.2.2.2
IFIndex: 0x0 LocalAddr: 0.0.0.0
NewUK0: 0x0 NewUK1: 0x0
NewUK2: 0x0 NewUK3: 0x0
NewUK4: 0x0 NewUK5: 0x0
NewUK6: 0x0 NewUK7: 0x0
TopoNthp: 0 ExtType: 0x0
FIRType: Normal Threshold: 0
RefCnt: 1 FlushRefCnt: 0
Flag: 0x12 Version: 1
ExtFlag: 0x0
2 nexthop(s):
PrefixIndex: 0 OrigNexthop: 2.2.2.2
RelyDepth: 7 RealNexthop: 8.8.8.8
Interface: Vlan11 LocalAddr: 12.12.12.12
TunnelCnt: 0 Vrf: default-vrf
TunnelID: N/A Topology: base
Weight: 1000000 Flags: 0x0
RealFIRType: Normal RealThres: 0
PrefixIndex: 0 OrigNexthop: 2.2.2.2
RelyDepth: 9 RealNexthop: 0.0.0.0
Interface: NULL0 LocalAddr: 0.0.0.0
TunnelCnt: 0 Vrf: default-vrf
TunnelID: N/A Topology: base
Weight: 1000000 Flags: 0x0
RealFIRType: Normal RealThres: 0
...
Table 2 Command output
Field |
Description |
NibID |
ID of the NIB. |
Sequence |
Sequence number of the NIB. |
Type |
Type of the NIB. |
Flushed |
Indicates whether the route with the NIB has been flushed to the FIB. |
Age |
Elapsed time since the next hop information was last updated. |
UserKey0 |
Reserved data 1. |
VrfNthp |
Index of the VPN instance that the next hop belongs to. This field displays 0 if the next hop is on the public network. |
UserKey1 |
Reserved data 2. |
Nexthop |
Next hop address. |
IFIndex |
Interface index |
LocalAddr |
Local interface address. |
NewUK0 |
New reserved data 1. |
NewUK1 |
New reserved data 2. |
NewUK2 |
New reserved data 3. |
NewUK3 |
New reserved data 4. |
NewUK4 |
New reserved data 5. |
NewUK5 |
New reserved data 6. |
NewUK6 |
New reserved data 7. |
NewUK7 |
New reserved data 8. |
TopoNthp |
This field is not supported in the current software version. Index of the topology that contains the next hop. This field displays 0 if the next hop is on the public network. |
ExtType |
NIB extension type. |
FIRType |
Type of the link for the next hop in FIR ECMP mode: · Normal. · Primary. · Secondary. |
Threshold |
Bandwidth usage level of primary links in FIR ECMP mode. |
RefCnt |
Reference count of the next hop. |
FlushRefCnt |
Reference count of the next hop that is flushed to the FIB. |
Flag |
Flag of the next hop. |
Version |
Version of the next hop. |
ExtFlag |
Extended flag of the next hop. |
x nexthop(s) |
Number of next hops. |
PrefixIndex |
Prefix index of the next hop for an ECMP route. |
OrigNexthop |
Original next hop. |
RelyDepth |
Recursion depth. |
RealNexthop |
Real next hop. |
Interface |
Output interface. |
localAddr |
Local interface address. |
TunnelCnt |
Number of tunnels after route recursion. |
Vrf |
VPN instance name. For the public network, this field displays default-vrf. |
TunnelID |
ID of the tunnel after route recursion. |
Topology |
This field is not supported in the current software version. Topology name. The topology name for the public network is base. |
Weight |
ECMP route weight. This field displays 0 for non-ECMP routes. |
Flags |
Flags of the next hop. |
RealFIRType |
Type of the link for the real next hop in FIR ECMP mode: · Normal. · Primary. · Secondary. The real next hop is the direct next hop found after route recursion. |
RealThres |
Bandwidth usage level of the primary link to which the real next hop is attached in FIR ECMP mode. |
display route-static routing-table
Use display route-static routing-table to display static routing table information.
Syntax
display route-static routing-table [ vpn-instance vpn-instance-name ] [ ip-address { mask-length | mask } ]
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify a VPN instance, the command displays static routing table information for the public network.
ip-address: Specifies the destination IP address in dotted decimal notation. If you do not specify this argument, the command displays all static routing table information.
mask-length: Specifies the mask length, an integer in the range of 0 to 32.
mask: Specifies the subnet mask in dotted decimal notation.
Examples
# Display static routing table information.
<Sysname> display route-static routing-table
Total number of routes: 24
Status: * - valid
*Destination: 0.0.0.0/0
NibID: 0x1100000a NextHop: 2.2.2.10
MainNibID: N/A BkNextHop: N/A
BkNibID: N/A Interface: Vlan-interface11
TableID: 0x2 BkInterface: Vlan-interface12
Flag: 0x82d01 BfdSrcIp: N/A
DbIndex: 0xd BfdIfIndex: 0x0
Type: Normal BfdVrfIndex: 0
TrackIndex: 0xffffffff Label: NULL
Preference: 60 vrfIndexDst: 0
BfdMode: N/A vrfIndexNH: 0
Permanent: 0 Tag: 0
FIRType: Normal Threshold: 0
MicroSegID: 0 RecurseMaskLen: N/A
FIRLicense: Unrestricted
Destination: 0.0.0.0/0
NibID: 0x1100000b NextHop: 2.2.2.11
MainNibID: N/A BkNextHop: N/A
BkNibID: N/A Interface: Vlan-interface13
TableID: 0x2 BkInterface: Vlan-interface14
Flag: 0x82d01 BfdSrcIp: N/A
DbIndex: 0xd BfdIfIndex: 0x0
Type: Normal BfdVrfIndex: 0
TrackIndex: 0xffffffff Label: NULL
Preference: 60 vrfIndexDst: 0
BfdMode: N/A vrfIndexNH: 0
Permanent: 0 Tag: 0
FIRType: Normal Threshold: 0
MicroSegID: 0 RecurseMaskLen: N/A
FIRLicense: Unrestricted
...
Table 3 Command output
Field |
Description |
destination |
Destination address/prefix. |
NibID |
ID of the NIB. |
MainNibID |
ID of the primary next hop for static route FRR. |
BkNibID |
ID of the backup next hop for static route FRR. |
NextHop |
Next hop address. |
BkNextHop |
Backup next hop address. |
Interface |
Output interface of the route. |
BkInterface |
Backup output interface. |
TableID |
ID of the table to which the route belongs. |
Flag |
Flag of the route. |
DbIndex |
Index of the database to which the route belongs. |
Type |
Route type: · Normal. · DHCP. · NAT. · IPSGT. |
BfdSrcIp |
Source IP address of the indirect BFD session. |
BfdIfIndex |
Index of the interface where BFD is enabled. |
BfdVrfIndex |
Index of the VPN instance where BFD is enabled. This field displays 0 if BFD is enabled for the public network. |
BfdMode |
BFD session mode: · N/A—No BFD session is configured. · Ctrl—Control packet mode · Echo—Echo packet mode. |
TrackIndex |
NQA Track index. |
vrfIndexDst |
Index of VPN instance that the destination belongs to. For the public network, this field displays 0. |
vrfIndexNH |
Index of the VPN instance that the next hop belongs to. For the public network, this field displays 0. |
Permanent |
Permanent static route flag. 1 indicates a permanent static route. |
FIRType |
Type of the link for the next hop in FIR ECMP mode: · Normal. · Primary. · Secondary. |
Threshold |
Bandwidth usage level of primary links in FIR ECMP mode. |
MicroSegID |
Microsegment ID in the route. |
RecurseMaskLen |
Exact mask length for route recursion. If the device uses the longest match principle for route recursion, this field displays N/A. |
FIRLicense |
License process status for the static route FIR mode: · Unrestricted—The static route FIR mode is not controlled by license. · Disconnected—The static route FIR mode is controlled by license, but the static route is not connected to the license process. Please check whether the license process is abnormal. · Active—The license for controlling the static route FIR mode is active. · Inactive—The license for controlling the static route FIR mode is inactive. For more information about licenses, see license management in Fundamentals Configuration Guide. |
ip route-static
Use ip route-static to configure a static route.
Use undo ip route-static to delete a static route.
|
NOTE: To use the primary and secondary parameters, you must first install a valid license. For more information about licenses, see license management in Fundamentals Configuration Guide. |
Syntax
ip route-static dest-address { mask-length | mask } interface-type interface-number [ next-hop-address [ nexthop-index index-string ] ] [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] [ permanent ] | bfd { control-packet | echo-packet } | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ primary threshold-level | secondary ] [ description text ]
ip route-static dest-address { mask-length | mask } interface-type interface-number next-hop-address [ nexthop-index index-string ] track-arp [ preference preference ] [ tag tag-value ] [ description text ]
ip route-static dest-address { mask-length | mask } next-hop-address [ nexthop-index index-string ] [ recursive-lookup host-route ] [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ description text ]
ip route-static dest-address { mask-length | mask } vpn-instance d-vpn-instance-name next-hop-address [ nexthop-index index-string ] [ recursive-lookup host-route ] [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ description text ]
ip route-static group group-name interface-type interface-number [ next-hop-address ] [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] [ permanent ] | bfd { control-packet | echo-packet } | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ primary threshold-level | secondary ] [ description text ]
ip route-static group group-name interface-type interface-number next-hop-address track-arp [ preference preference ] [ tag tag-value ] [ description text ]
ip route-static group group-name next-hop-address [ recursive-lookup host-route ] [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ description text ]
ip route-static group group-name vpn-instance d-vpn-instance-name next-hop-address [ recursive-lookup host-route ] [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ description text ]
undo ip route-static { dest-address { mask-length | mask } | group group-name } [ interface-type interface-number [ next-hop-address ] | next-hop-address | vpn-instance d-vpn-instance-name next-hop-address ] [ preference preference ]
ip route-static { dest-address { mask-length | mask } | group group-name } vpn-instance d-vpn-instance-name [ track track-entry-number ] [ preference preference ] [ tag tag-value ] [ description text ]
undo ip route-static { dest-address { mask-length | mask } | group group-name } [ vpn-instance d-vpn-instance-name ] [ preference preference ]
Default
No static route is configured.
Views
System view
Predefined user roles
network-admin
Parameters
dest-address: Specifies the destination IP address of the static route, in dotted decimal notation.
mask-length: Specifies the mask length, an integer in the range of 0 to 32.
mask: Specifies the subnet mask in dotted decimal notation.
group group-name: Specifies a static route group by its name, a case-sensitive string of 1 to 31 characters.
vpn-instance d-vpn-instance-name: Specifies a destination MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify the next-hop-address argument following this option, the device searches for the output interface in the specified destination VPN instance for packets matching the static route. If you specify the next-hop-address argument and this option, the device searches for the output interface in the specified destination VPN instance based on the specified next hop address for packets matching the static route.
interface-type interface-number: Specifies an output interface by its type and number. For more information, see Layer 3—IP Routing Configuration Guide.
next-hop-address: Specifies the IP address of the next hop, in dotted decimal notation. For more information, see Layer 3—IP Routing Configuration Guide.
nexthop-index index-string: Specifies the index of the next hop. The index-string argument represents the index, which is a case-insensitive string of 1 to 93 characters. If you do not specify an index for the next hop, the static route uses the output interface and the IP address of the next hop as the next hop index. Do not specify the same next hop index for routes to the same destination.
recursive-lookup host-route: Specifies only host routes for static route recursion.
backup-interface interface-type interface-number: Specifies a backup output interface by its type and number. If the backup output interface is an NBMA interface or broadcast interface and not a P2P interface, you must specify the backup next hop address.
backup-nexthop backup-nexthop-address: Specifies a backup next hop address.
bfd: Enables BFD to detect reachability of the static route's next hop. When the next hop is unreachable, the system immediately switches to the backup route.
control-packet: Specifies the BFD control packet mode.
bfd-source ip-address: Specifies the source IP address of BFD packets. As a best practice, specify the loopback interface address.
echo-packet: Specifies the BFD echo packet mode.
permanent: Specifies the route as a permanent static route. After you specify this keyword, the static route will always be active, even if the output interface is down.
track track-entry-number: Associates the static route with a track entry specified by its number in the range of 1 to 1024. For more information about Track, see High Availability Configuration Guide.
track-arp: Associates the static route with the ARP entry corresponding to the next hop of the static route. If you specify this keyword and the ARP entry corresponding to the next hop of the static route does not exist, the system will not activate the static route. If you do not specify this keyword, the activation status of the static route is irrelevant to the ARP entry. As a best practice when you use this keyword, use the ip route-static arp-request command to configure the device to periodically send ARP requests to the next hop of the static route to prevent the ARP entry from aging and causing the static route to become inactive.
preference preference: Specifies a preference for the static route, in the range of 1 to 255. The default is 60.
tag tag-value: Sets a tag value for marking the static route, in the range of 1 to 4294967295. The default is 0. Tags of routes are used for route control in routing policies. For more information about routing policies, see Layer 3—IP Routing Configuration Guide.
recursive-lookup: Enables support for next hop recursion loops for the IPv4 static route. If you do not specify this keyword, the device does not support next hop recursion loops for the IPv4 static route.
primary threshold-level: Specifies the static route as a primary link in FIR ECMP mode and sets the bandwidth usage level of the primary link. The value for the threshold argument can be 70, 75, 80, 85, 90, 95, or 100, in percentage. The primary link bandwidth usage threshold depends on the setting of this option and the upper and lower bandwidth usage thresholds for the primary link in FIR ECMP mode, as described in the usage guidelines. For more information about FIR ECMP mode, see basic IP routing in Layer 3—IP Routing Configuration Guide.
secondary: Specifies the static route as a secondary link in FIR ECMP mode.
description text: Configures a description of 1 to 60 characters for the static route. The description can include special characters, such as the space, except the question mark (?).
Usage guidelines
If the destination IP address and the mask are both 0.0.0.0 (or 0), the configured route is a default route. The default route is used for forwarding a packet matching no entry in the routing table.
Implement different routing policies to configure different route preferences. For example, to enable load sharing for multiple routes to the same destination, assign the same preference to the routes. To enable the routes to back up one another, assign different preferences to them.
Follow these guidelines when you specify the output interface or the next hop address of the static route:
· If the output interface is a Null 0 interface, no next hop address is required.
· If the output interface is a point-to-point interface, you can specify only the output interface. You do not need to change the configuration of the route even if the peer address is changed.
· NBMA or P2MP interfaces need IP address-to-link layer address mappings for successful packet delivery. As a best practice, specify the next hop address for the route at the same time if the output interface is an NBMA or P2MP interface.
· If the output interface is a broadcast interface, the device uses the next hop IP address to obtain the MAC address of the next hop. Therefore, you must specify both the output interface and next hop IP address, except for certain cases such as the VXLAN across VPNs networking.
Follow these guidelines when you configure a static route:
· Enabling BFD for a flapping route could worsen the route flapping situation. Therefore, use it with caution. For more information about BFD, see High Availability Configuration Guide.
· For static routing-Track-NQA collaboration, you must configure the same VPN instance ID for the next hop to be detected and the NQA operation.
· If a static route needs route recursion, the associated track entry must monitor the next hop of the related route instead of that of the recursive static route. Otherwise, a valid route might be mistakenly considered invalid.
· Do not specify the permanent keyword together with the bfd or track keyword.
To specify the recursive-lookup host-route keyword, you must enable ARP direct route advertisement to advertise 32-bit host routes on the output interface corresponding to the next hop. To enable ARP direct route advertisement, use the arp route-direct advertise command.
If you specify a static route group, all prefixes in the static route group will be assigned the next hop and output interface specified by using this command.
A recursion loop occurs when an IPv4 static route recurses to a related route whose destination address contains the destination address of the IPv4 static route. For example, a recursion loop occurs when the IPv4 static route destined for 10.1.0.0/24 recurses to a related route whose destination address is 10.1.0.0/16.
· If the recursive-lookup keyword is not specified, the recursion loop results in route recursion failure. The device further looks up for a related route.
· If the recursive-lookup keyword is specified, the device determines that the recursion succeeds if the output interface of the related route is an interface directly connected to the device.
If the output interface of an IPv4 static route is found through recursion loops, routing protocols on the device cannot advertise the IPv4 static route to other devices.
As a best practice, use the recursive-lookup keyword only in specific scenarios, for example, in a network with microsegment configuration. You can recurse an IPv4 static route to a larger network segment, and apply the associated traffic control policies to the traffic matching the IPv4 static route.
The recursive-lookup host-route and recursive-lookup keywords are mutually exclusive. You cannot specify both of the keywords.
If FIR ECMP mode is enabled and multiple static ECMP routes are available to reach the same destination, the static routes configured with the primary threshold option are primary links and the static routes configured with the secondary keyword are secondary links.
The upper threshold for the primary link bandwidth usage depends on the setting of the primary threshold-level option and upper and lower thresholds specified in the ecmp mode fir primary threshold command.
· The static route is a primary link if it is not configured with the primary threshold-level option or secondary keyword, but is configured with the ecmp mode fir primary threshold command. The upper threshold for the link bandwidth usage is specified by the upper-threshold argument in the ecmp mode fir primary threshold command in per ten thousand.
· The static route is a primary link if it is configured with the primary threshold-level option, but is not configured with the ecmp mode fir primary threshold command. The upper threshold for the link bandwidth usage is specified by the primary threshold-level option in percentage.
· If the static route is configured with the primary threshold-level option and the ecmp mode fir primary threshold command, the upper threshold for the primary link bandwidth usage is calculated as follows:
a. For the value range between the bandwidth usage upper threshold specified by the upper-threshold argument (upper) and lower threshold specified by the lower-threshold argument (lower) in the ecmp mode fir primary threshold command, the device evenly divides the value range to six subranges. The span for each subrange (range) is calculated with the formula: range = (upper - lower) ÷ 6.
b. The device supports seven threshold-level values, from level1 to level7 in ascending order. Each value represents a link bandwidth usage level.
c. Based on the range value, you can obtain the link bandwidth usage upper threshold of each level as follows:
- The upper threshold of level1 is lower.
- The upper threshold of level2 is lower + 1 × range
- …
- The upper threshold of level7 is lower + 6 × range = upper
d. You can obtain the upper threshold for a single primary link bandwidth usage from the previous process.
e. The effective link bandwidth usage upper threshold on the device takes the smallest value among all primary link bandwidth usage thresholds.
When you configure static ECMP routes to reach the same destination, follow these restrictions and guidelines:
· If you do not specify the secondary keyword or the primary threshold-level option for a static route, the static route is used as a primary link. The link bandwidth usage level is the maximum value 100 for the threshold-level argument.
· If multiple primary links are configured with different link bandwidth usage levels by using the threshold-level argument, the effective level is the minimum value among the configured levels.
· If the static ECMP routes are all primary links or all secondary links, the device treats all the links as common links. Packets are distributed among the links for load sharing.
When the device forwards service traffic that matches multiple static ECMP routes to reach the same destination, it selects links as follows:
· The device distributes all service traffic to primary links when the bandwidth usages of all primary links do not exceed the effective upper threshold.
· The device distributes new service traffic to secondary links for load sharing when the bandwidth usage of any primary link exceeds the effective upper threshold.
· The device switches traffic from secondary links to primary links when the bandwidth usages of all primary links drop below the effective upper threshold.
Examples
# Configure a static route, whose destination address is 1.1.1.1/24, next hop address is 2.2.2.2, tag value is 45, and description information is for internet.
<Sysname> system-view
[Sysname] ip route-static 1.1.1.1 24 2.2.2.2 tag 45 description for internet
Related commands
display ip routing-table protocol
ip route-static-group
prefix
ip route-static arp-request
Use ip route-static arp-request to enable periodic sending of ARP requests to the next hops of static routes.
Use undo ip route-static arp-request to disable periodic sending of ARP requests to the next hops of static routes.
Syntax
ip route-static arp-request [ interval interval ]
undo ip route-static arp-request
Default
Periodic sending of ARP requests to the next hops of static routes is disabled.
Views
System view
Predefined user roles
network-admin
Parameters
interval: Specifies an ARP request sending interval in the range of 1 to 300 seconds. The default value is 5.
Usage guidelines
As a best practice, use this command when the following types of static routes exist on the device:
· Static routes that recurse to host routes, which include the following static routes:
¡ Static routes with the recursive-lookup host-route keywords specified to recurse only to host routes.
¡ Static routes that recurse to host routes according to routing policies (configured by using the protocol nexthop recursive-lookup command).
If the next hop host of a static route cannot actively send gratuitous ARP messages, the device might not update the ARP entry for the host in time. As a result, the ARP entry ages out. The device cannot generate a host route for the host, or activate the static route whose next hop is the host because of host route recursion failure.
· Static routes with the track-arp keyword specified to associate their next hops with the ARP entries for these next hops. If the next hop of a static route cannot actively send gratuitous ARP messages, the device might not update the ARP entry for the next hop in time. As a result, the ARP entry ages out. The device cannot activate that static route.
For static routes that recurse to host routes, the ip route-static arp-request command enables the device to periodically send ARP requests to the next hops of the static routes that meet the following requirements:
· The static routes have no output interfaces specified.
· The static routes fail the next-hop recursion.
When the device receives an ARP response from the next hop host of a static route, it automatically performs the following operations:
1. Adds the host route to the routing table.
2. Activates the static route that recurses to the host route.
3. Stops sending ARP requests to the host.
For static routes with the track-arp keyword specified, the ip route-static arp-request command enables the device to periodically send ARP requests to the next hops of the static routes associated with next hop ARP entries. When the device receives an ARP response from the next hop of a static route, it automatically activates that static route and stops sending ARP requests to the next hop of that static route.
For more information about ARP, see Layer 3—IP Services Configuration Guide.
Examples
# Enable sending of ARP requests to the next hops of static routes and set the sending interval to 10 seconds.
<Sysname> system-view
[Sysname] ip route-static arp-request interval 10
Related commands
ip route-static
protocol nexthop recursive-lookup
ip route-static default-preference
Use ip route-static default-preference to configure a default preference for static routes.
Use undo ip route-static default-preference to restore the default.
Syntax
ip route-static default-preference default-preference
undo ip route-static default-preference
Default
The default preference of static routes is 60.
Views
System view
Predefined user roles
network-admin
Parameters
default-preference: Specifies a default preference for static routes, in the range of 1 to 255.
Usage guidelines
If no preference is specified for a static route, the default preference applies.
When the default preference is reconfigured, it applies only to newly added static routes.
Examples
# Set a default preference of 120 for static routes.
<Sysname> system-view
[Sysname] ip route-static default-preference 120
Related commands
display ip routing-table protocol
ip route-static fast-reroute auto
Use ip route-static fast-reroute auto to configure static route FRR to automatically select a backup next hop.
Use undo ip route-static fast-reroute auto to disable static route FRR from automatically selecting a backup next hop.
Syntax
ip route-static fast-reroute auto
undo ip route-static fast-reroute auto
Default
Static route FRR is disabled from automatically selecting a backup next hop.
Views
System view
Predefined user roles
network-admin
Examples
# Configure static route FRR to automatically select a backup next hop.
<Sysname> system-view
[Sysname] ip route-static fast-reroute auto
ip route-static primary-path-detect bfd echo
Use ip route-static primary-path-detect bfd echo to enable BFD echo packet mode for static route FRR.
Use undo ip route-static primary-path-detect bfd to disable BFD echo packet mode for static route FRR.
Syntax
ip route-static primary-path-detect bfd echo
undo ip route-static primary-path-detect bfd
Default
BFD echo packet mode for static route FRR is disabled.
Views
System view
Predefined user roles
network-admin
Usage guidelines
This command enables static route FRR to use BFD echo packet mode for fast failure detection on the primary link.
Examples
# Enable BFD echo packet mode for static route FRR.
<Sysname> system-view
[Sysname] ip route-static 1.1.1.1 32 vlan-interface 10 2.2.2.2 backup-interface vlan-interface 11 backup-nexthop 3.3.3.3
[Sysname] ip route-static primary-path-detect bfd echo
ip route-static vpn-instance
Use ip route-static vpn-instance to configure a static route in a VPN instance.
Use undo ip route-static vpn-instance to delete a static route from a VPN instance.
|
NOTE: To use the primary and secondary parameters, you must first install a valid license. For more information about licenses, see license management in Fundamentals Configuration Guide. |
Syntax
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } interface-type interface-number [ next-hop-address [ nexthop-index index-string ] ] [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] [ permanent ] | bfd { control-packet | echo-packet } | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ primary threshold-level | secondary ] [ description text ]
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } interface-type interface-number next-hop-address [ nexthop-index index-string ] track-arp [ preference preference ] [ tag tag-value ] [ description text ]
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } vpn-instance d-vpn-instance-name next-hop-address [ nexthop-index index-string ] [ recursive-lookup host-route ] [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ description text ]
ip route-static vpn-instance s-vpn-instance-name dest-address { mask-length | mask } next-hop-address [ nexthop-index index-string ] [ recursive-lookup host-route ] [ public ] [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ description text ]
ip route-static vpn-instance s-vpn-instance-name group group-name interface-type interface-number [ next-hop-address ] [ bfd { control-packet | echo-packet } | backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] [ permanent ] ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ primary threshold-level | secondary ] [ description text ]
ip route-static vpn-instance s-vpn-instance-name group group-name interface-type interface-number next-hop-address track-arp [ preference preference ] [ tag tag-value ] [ description text ]
ip route-static vpn-instance s-vpn-instance-name group group-name next-hop-address [ recursive-lookup host-route ] [ public ] [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ description text ]
ip route-static vpn-instance s-vpn-instance-name group group-name vpn-instance d-vpn-instance-name next-hop-address [ recursive-lookup host-route ] [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] [ preference preference ] [ tag tag-value ] [ recursive-lookup ] [ description text ]
undo ip route-static vpn-instance s-vpn-instance-name { dest-address { mask-length | mask } | group group-name } [ interface-type interface-number [ next-hop-address ] | next-hop-address [ public ] | vpn-instance d-vpn-instance-name next-hop-address ] [ preference preference ]
ip route-static vpn-instance s-vpn-instance-name { dest-address { mask-length | mask } | group group-name } { public | vpn-instance d-vpn-instance-name } [ track track-entry-number ] [ preference preference ] [ tag tag-value ] [ description text ]
undo ip route-static vpn-instance s-vpn-instance-name { dest-address { mask-length | mask } | group group-name } [ public | vpn-instance d-vpn-instance-name ] [ preference preference ]
Default
No static route is configured in a VPN instance.
Views
System view
Predefined user roles
network-admin
Parameters
s-vpn-instance-name: Specifies a source MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. Each VPN instance has its own routing table, and the configured static route is installed in the routing tables of the specified VPN instances.
dest-address: Specifies the destination IP address of the static route, in dotted decimal notation.
mask-length: Specifies the mask length, an integer in the range of 0 to 32.
mask: Specifies the subnet mask in dotted decimal notation.
group group-name: Specifies a static route group by its name, a case-sensitive string of 1 to 31 characters.
vpn-instance d-vpn-instance-name: Specifies a destination MPLS L3VPN instance by its name, a case-sensitive string of 1 to 31 characters. If you do not specify the next-hop-address argument following this option, the device searches for the output interface in the specified destination VPN instance for packets matching the static route. If you specify the next-hop-address argument and this option, the device searches for the output interface in the specified destination VPN instance based on the specified next hop address for packets matching the static route. If you specify a destination VPN instance without specifying a next hop address, the destination VPN instance cannot be the same as the source VPN instance.
interface-type interface-number: Specifies an output interface by its type and number. For more information, see Layer 3—IP Routing Configuration Guide.
next-hop-address: Specifies the IP address of the next hop, in dotted decimal notation. For more information, see Layer 3—IP Routing Configuration Guide.
nexthop-index index-string: Specifies the index of the next hop. The index-string argument represents the index, which is a case-insensitive string of 1 to 93 characters. If you do not specify an index for the next hop, the static route uses the output interface and the IP address of the next hop as the next hop index. Do not specify the same next hop index for routes to the same destination.
recursive-lookup host-route: Specifies only host routes for static route recursion.
backup-interface interface-type interface-number: Specifies a backup output interface by its type and number. If the backup output interface is an NBMA interface or broadcast interface and not a P2P interface, you must specify the backup next hop address.
backup-nexthop backup-nexthop-address: Specifies a backup next hop address.
bfd: Enables BFD to detect reachability of the static route's next hop. When the next hop is unreachable, the system immediately switches to the backup route.
control-packet: Specifies the BFD control packet mode.
bfd-source ip-address: Specifies the source IP address of BFD packets. As a best practice, specify the loopback interface address.
echo-packet: Specifies the BFD echo packet mode.
permanent: Specifies the route as a permanent static route. After you specify this keyword, the static route will always be active, even if the output interface is down.
track track-entry-number: Associates the static route with a track entry specified by its number in the range of 1 to 1024. For more information about Track, see High Availability Configuration Guide.
public: Specifies the public network. If you specify this keyword following the next-hop-address argument, the next hop is on the public network. The device searches for the output interface in the public network based on the next hop address for packets matching the static route. If you specify the next-hop-address argument without specifying the public keyword, the device searches for the output interface in the source VPN instance based on the next hop address for packets matching the static route. If you specify the public keyword without specifying the next-hop-address argument, the device searches for the output interface in the public network for packets matching the static route.
track-arp: Associates the static route with the ARP entry corresponding to the next hop of the static route. If you specify this keyword and the ARP entry corresponding to the next hop of the static route does not exist, the system will not activate the static route. If you do not specify this keyword, the activation status of the static route is irrelevant to the ARP entry. As a best practice when you use this keyword, use the ip route-static arp-request command to configure the device to periodically send ARP requests to the next hop of the static route to prevent the ARP entry from aging and causing the static route to become inactive.
preference preference: Specifies a preference for the static route, in the range of 1 to 255. The default is 60.
tag tag-value: Sets a tag value for marking the static route, in the range of 1 to 4294967295. The default is 0. Tags of routes are used for route control in routing policies. For more information about routing policies, see Layer 3—IP Routing Configuration Guide.
recursive-lookup: Enables support for next hop recursion loops for the IPv4 static route. If you do not specify this keyword, the device does not support next hop recursion loops for the IPv4 static route.
primary threshold-level: Specifies the static route as a primary link in FIR ECMP mode and sets the bandwidth usage level of the primary link. The value for the threshold argument can be 70, 75, 80, 85, 90, 95, or 100, in percentage. The primary link bandwidth usage threshold depends on the setting of this option and the upper and lower bandwidth usage thresholds for the primary link in FIR ECMP mode, as described in the usage guidelines. For more information about FIR ECMP mode, see basic IP routing in Layer 3—IP Routing Configuration Guide.
secondary: Specifies the static route as a secondary link in FIR ECMP mode.
description text: Configures a description of 1 to 60 characters for the static route. The description can include special characters, such as the space, except the question mark (?).
Usage guidelines
If the destination IP address and the mask are both 0.0.0.0 (or 0), the configured route is a default route. The default route is used for forwarding a packet matching no entry in the routing table.
Implement different routing policies to configure different route preferences. For example, to enable load sharing for multiple routes to the same destination, assign the same preference to the routes. To enable the routes to back up one another, assign different preferences to them.
Follow these guidelines when you specify the output interface or the next hop address of the static route:
· If the output interface is a Null 0 interface, no next hop address is required.
· If the output interface is a point-to-point interface, you can specify only the output interface. You do not need to change the configuration of the route even if the peer address is changed.
· NBMA or P2MP interfaces need IP address-to-link layer address mappings for successful packet delivery. As a best practice, specify the next hop address for the route at the same time if the output interface is an NBMA or P2MP interface.
· If the output interface is a broadcast interface (for example, an Ethernet interface or VLAN interface), the device uses the next hop IP address to obtain the MAC address of the next hop. Therefore, you must specify both the output interface and next hop IP address.
Follow these guidelines when you configure a static route:
· Enabling BFD for a flapping route could worsen the route flapping situation. Therefore, use it with caution. For more information about BFD, see High Availability Configuration Guide.
· For static routing-Track-NQA collaboration, you must configure the same VPN instance ID for the next hop to be detected and the NQA operation.
· If a static route needs route recursion, the associated track entry must monitor the next hop of the related route instead of that of the recursive static route. Otherwise, a valid route might be mistakenly considered invalid.
· Do not specify the permanent keyword together with the bfd or track keyword.
If you specify a static route group, all prefixes in the static route group will be assigned the next hop and output interface specified by using this command.
A recursion loop occurs when an IPv4 static route recurses to a related route whose destination address contains the destination address of the IPv4 static route. For example, a recursion loop occurs when the IPv4 static route destined for 10.1.0.0/24 recurses to a related route whose destination address is 10.1.0.0/16.
· If the recursive-lookup keyword is not specified, the recursion loop results in route recursion failure. The device further looks up for a related route.
· If the recursive-lookup keyword is specified, the device determines that the recursion succeeds if the output interface of the related route is an interface directly connected to the device.
If the output interface of an IPv4 static route is found through recursion loops, routing protocols on the device cannot advertise the IPv4 static route to other devices.
As a best practice, use the recursive-lookup keyword only in specific scenarios, for example, in a network with microsegment configuration. You can recurse an IPv4 static route to a larger network segment, and apply the associated traffic control policies to the traffic matching the IPv4 static route.
The recursive-lookup host-route and recursive-lookup keywords are mutually exclusive. You cannot specify both of the keywords.
If FIR ECMP mode is enabled and multiple static ECMP routes are available to reach the same destination, the static routes configured with the primary threshold option are primary links and the static routes configured with the secondary keyword are secondary links.
The upper threshold for the primary link bandwidth usage depends on the setting of the primary threshold-level option and upper and lower thresholds specified in the ecmp mode fir primary threshold command.
· The static route is a primary link if it is not configured with the primary threshold-level option or secondary keyword, but is configured with the ecmp mode fir primary threshold command. The upper threshold for the link bandwidth usage is specified by the upper-threshold argument in the ecmp mode fir primary threshold command in per ten thousand.
· The static route is a primary link if it is configured with the primary threshold-level option, but is not configured with the ecmp mode fir primary threshold command. The upper threshold for the link bandwidth usage is specified by the primary threshold-level option in percentage.
· If the static route is configured with the primary threshold-level option and the ecmp mode fir primary threshold command, the upper threshold for the primary link bandwidth usage is calculated as follows:
a. For the value range between the bandwidth usage upper threshold specified by the upper-threshold argument (upper) and lower threshold specified by the lower-threshold argument (lower) in the ecmp mode fir primary threshold command, the device evenly divides the value range to six subranges. The span for each subrange (range) is calculated with the formula: range = (upper - lower) ÷ 6.
b. The device supports seven threshold-level values, from level1 to level7 in ascending order. Each value represents a link bandwidth usage level.
c. Based on the range value, you can obtain the link bandwidth usage upper threshold of each level as follows:
- The upper threshold of level1 is lower.
- The upper threshold of level2 is lower + 1 × range
- …
- The upper threshold of level7 is lower + 6 × range = upper
d. You can obtain the upper threshold for a single primary link bandwidth usage from the previous process.
e. The effective link bandwidth usage upper threshold on the device takes the smallest value among all primary link bandwidth usage thresholds.
When you configure static ECMP routes to reach the same destination, follow these restrictions and guidelines:
· If you do not specify the secondary keyword or the primary threshold-level option for a static route, the static route is used as a primary link. The link bandwidth usage level is the maximum value 100 for the threshold-level argument.
· If multiple primary links are configured with different link bandwidth usage levels by using the threshold-level argument, the effective level is the minimum value among the configured levels.
· If the static ECMP routes are all primary links or all secondary links, the device treats all the links as common links. Packets are distributed among the links for load sharing.
When the device forwards service traffic that matches multiple static ECMP routes to reach the same destination, it selects links as follows:
· The device distributes all service traffic to primary links when the bandwidth usages of all primary links do not exceed the effective upper threshold.
· The device distributes new service traffic to secondary links for load sharing when the bandwidth usage of any primary link exceeds the effective upper threshold.
· The device switches traffic from secondary links to primary links when the bandwidth usages of all primary links drop below the effective upper threshold.
Examples
# Configure a static route in VPN instance vpn1, whose destination address is 1.1.1.1/24, next hop address is 2.2.2.2 in VPN instance vpn2, tag value is 45, and description information is for internet.
<Sysname> system-view
[Sysname] ip route-static vpn-instance vpn1 1.1.1.1 24 vpn-instance vpn2 2.2.2.2 tag 45 description for internet
Related commands
display ip routing-table protocol
ip route-static-group
prefix
ip route-static-group
Use ip route-static-group to create a static route group and enter its view, or enter the view of an existing static route group.
Use undo ip route-static-group to delete a static route group.
Syntax
ip route-static-group group-name
undo ip route-static-group group-name
Default
No static route groups exist.
Views
System view
Predefined user roles
network-admin
Parameters
group-name: Specifies the static route group name, a case-sensitive string of 1 to 31 characters.
Examples
# Create static route group test and enter its view.
<Sysname> system-view
[Sysname] ip route-static-group test
[Sysname-route-static-group-test]
Related commands
ip route-static
prefix
prefix
Use prefix to add a static route prefix to a static route group.
Use undo prefix to delete a static route prefix from a static route group.
Syntax
prefix dest-address { mask-length | mask }
undo prefix dest-address { mask-length | mask }
Default
No static route prefix is added to a static route group.
Views
Static route group view
Predefined user roles
network-admin
Parameters
dest-address: Specifies the destination IP address of the static route, in dotted decimal notation.
mask-length: Specifies the mask length, an integer in the range of 0 to 32.
mask: Specifies the subnet mask in dotted decimal notation.
Usage guidelines
Execute this command repeatedly to add multiple static route prefixes to a static route group.
After you add static route prefixes to a static route group, you can specify that group in the ip route-static group command to configure static routes with the prefixes. To configure more static routes, you only need to add new static route prefixes to the group.
Examples
# Add static route prefix 1.1.1.1/32 to static route group test.
<Sysname> system-view
[Sysname] ip route-static-group test
[Sysname-route-static-group-test] prefix 1.1.1.1 32
Related commands
ip route-static
ip route-static-group