< Home

ip route-static

Function

The ip route-static command configures an IPv4 unicast static route.

The undo ip route-static command deletes an IPv4 unicast static route.

By default, the system does not configure IPv4 unicast static routes.

Format

ip route-static ip-address { mask | mask-length } { nexthop-address | interface-type interface-number [ nexthop-address ] } [ preference preference | tag tag ] * [ track { bfd-session cfg-name | ip-link link-name | nqa admin-name test-name } | permanent ] [ description text ]

ip route-static ip-address { mask | mask-length } interface-type interface-number [ nexthop-address ] [ preference preference | tag tag ] * ldp-sync [ description text ]

ip route-static ip-address { mask | mask-length } vpn-instance vpn-instance-name nexthop-address [ preference preference | tag tag ] * [ track { bfd-session cfg-name | ip-link link-name | nqa admin-name test-name } | permanent ] [ description text ]

ip route-static ip-address { mask | mask-length } vpn-instance vsys-name [ preference preference | tag tag ] * [ track ip-link ip-link-name ] [ description text ]

ip route-static ip-address { mask | mask-length } vpn-instance vpn-instance-name nexthop-address [ recursive-lookup host-route ] [ preference preference | tag tag ] * [ inherit-cost | permanent ] [ description text ]

ip route-static ip-address { mask | mask-length } nexthop-address [ recursive-lookup host-route ] [ preference preference | tag tag ] * [ inherit-cost | permanent ] [ description text ]

undo ip route-static ip-address { mask | mask-length } [interface-type interface-number ] [ nexthop-address ] [ preference preference | tag tag ] * [ track { bfd-session | ip-link } | permanent ]

undo ip route-static [ track bfd-session ] all

undo ip route-static ip-address { mask | mask-length } interface-type interface-number [ nexthop-address ] [ preference preference | tag tag ] * ldp-sync

undo ip route-static ip-address { mask | mask-length } nexthop-address [ preference preference | tag tag ] * [ inherit-cost ]

undo ip route-static ip-address { mask | mask-length } vpn-instance vsys-name [ preference preference | tag tag ] * [ track ip-link ]

undo ip route-static track ip-link { all | ip-link-name ip-link-name }

Parameters

Parameter Description Value
ip-address Specifies the destination IP address. It is in dotted decimal notation.
mask Specifies the IP address mask. It is in dotted decimal notation.
mask-length Specifies the mask length. A 32-bit mask is represented by consecutive 1s, and the mask in dotted decimal notation can be replaced by the mask length. The value is an integer ranging from 0 to 32.
nexthop-address Specifies the next hop IP address of a route. It is in dotted decimal notation.
interface-type interface-number Specifies the type and number of the interface that forwards packets. -
preference preference Specifies the preference of a static route. The value is an integer ranging from 1 to 255. By default, it is 60. The smaller the value is, the higher the preference is.
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, other protocols can import static routes with specified tag values through routing policies. The value is an integer ranging from 1 to 4294967295. By default, it is 0.
track bfd-session cfg-name Specifies the BFD session bound to a static route. The value must be the name of an existing BFD session.
track ip-link link-name Specifies the IP link bound to a static route. The value must be the name of an existing IP link.
track nqa admin-name test-name Specifies the administrator name and test name of the NQA test instance admin-name and test-name are the administrator name and the test instance name of an existing NQA test instance respectively.
permanent

Configures permanent advertisement of static routes.

-
ldp-sync
Enables synchronization between LDP and static routes.
NOTE:
Only the USG6510E/6510E-POE/6530E do not support this parameter.
-
description text Specifies the description of a static route. It is a string of 1 to 80 characters that can contain spaces.
vpn-instance vpn-instance-name

Specifies the name of a VPN instance. If the VPN instance name is specified, a static route searches the routing table of the VPN instance for an outbound interface according to nexthop-address.

The value must be the name of an existing VPN instance.

vsys-name

Specifies the name of a vsys instance.

The value must be the name of an existing VPN instance.

recursive-lookup host-route

Specifies static routes to iterate to host routes.

-
inherit-cost

Specifies static routes to inherit the cost of iterated routes.

-
all

Deletes all IPv4 unicast static routes.

-
ip-link-name link-name

Unbind the static route from the current IP link.

link-name must be the name of an existing IP link.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a network with a simple topology, configuring static routes allows the network to work properly. If the FW cannot run dynamic routing protocols to generate routes to the destination, you can configure static routes on the FW.

  • You can configure track bfd-session cfg-name to configure BFD for static routes to bind BFD sessions to static routes. BFD sessions can detect the link status, which provides the detection mechanism for static routes.

    The undo command with track bfd-session specified can only unbind the static route from the current BFD session and cannot delete the static route.

  • After the track nqa admin-name test-name command is run, the system determines whether to activate a static route according to the NQA test result. This helps control the advertisement of static routes and guide traffic to an available path. This command can be used only on devices on IPv4 networks.

    After associating a static route with an NQA test instance, you cannot bind the static route to a BFD session.

  • If service traffic needs to be forwarded along a specified path, you can detect links by pinging the destination addresses of static routes. In this manner, you can monitor services at a very low cost. By configuring permanent, you can configure permanent advertisement of static routes. In this manner, links can be detected through a ping operation.

  • On an MPLS network with primary and backup links, Label Switching Routers (LSRs) establish Label Switching Paths (LSPs) based on static routes. When the LDP session of the primary link becomes faulty (the fault is not caused by a link failure) or the primary link recovers, configuring synchronization between LDP and static routes minimizes traffic loss during traffic switchover and switchback. After ldp-sync is configured, synchronization between LDP and static routes is enabled, and static routes respond to changes of the LDP session status. This synchronizes LDP and static routes LDP.

    Only the static route with a specified outbound interface can be configured with synchronization between LDP and static routes.

  • You can configure description text to add the description of static routes so that the administrator can check and maintain static routes easily. You can run the display this or display current-configuration command in the system view to view the description.

Precautions

When configuring unicast static routes, note the following points:

  • When both the destination IP address and the mask are 0.0.0.0, the configured route is a default route.

  • Setting different preferences can implement different Route Management (RM) policies. For example, if multiple routes to the same destination are configured with the same preference, load balancing can be implemented. If multiple routes to the same destination are configured with different preferences, route backup can be implemented.

  • When configuring static routes, you can specify outbound interfaces or next hop addresses as required. You can specify outbound interfaces or next hop addresses for the interfaces that support resolution from network addresses to link layer addresses or Point-to-Point (P2P) interfaces.

  • If the outbound interface is a non-Point-to-Point (non-P2P) interface, you need to specify the next hop address.

  • In some cases, for example, the link layer is encapsulated with Point-to-Point Protocol (PPP), you can also specify outbound interfaces when configuring the FW even if the remote address is not known. In this manner, it is unnecessary to modify the FW configuration when the remote address changes.

Example

# Configure an IPv4 static route with the next hop of 192.168.0.1.

<sysname> system-view
[sysname] ip route-static 172.16.1.1 32 192.168.0.1

# Configure an IPv4 default route with the next hop of 172.16.0.1.

<sysname> system-view
[sysname] ip route-static 0.0.0.0 0.0.0.0 172.16.0.1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >