ip route-static topology

Function

The ip route-static topology command configures an IPv4 unicast static route for a topology.

The undo ip route-static topology command deletes an IPv4 unicast static route configured for a topology.

By default, the system does not configure IPv4 unicast static routes in a topology instance.

Format

ip route-static topology topology-name ip-address { mask | mask-length } nexthop-address [ recursive-lookup host-route ] [ preference preference | tag tag ] * [ no-advertise | no-install ] [ description text ]

ip route-static topology topology-name ip-address { mask | mask-length } { interface-name | interface-type interface-number } [ nexthop-address | dhcp ] [ preference preference | tag tag ] * [ no-advertise | no-install ] [ description text ]

undo ip route-static [ topology topology-name ] ip-address { mask | mask-length } [ { interface-name | interface-type interface-number } [ { nexthop-address | dhcp } ] | { nexthop-address | dhcp } ]

Parameters

Parameter Description Value
topology-name

Specifies the name of the topology to which a static route belongs.

The value is a string of 1 to 31 case-sensitive characters without spaces. The value must start with a letter (a to z or A to Z, case sensitive) and can contain numbers, hyphens (-), or underlines (_). When double quotation marks are used around the string, spaces are allowed in the string.

ip-address

Specifies a destination IP address.

The value is in dotted decimal notation.

mask

Specifies a mask for an IP address.

The value 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.

The value is in dotted decimal notation.

recursive-lookup

Recursive route lookup policy.

-

host-route

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

-

preference preference

Specifies a priority for static routes.

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 a tag value for 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 based on routing policies.

The value is an integer ranging from 1 to 4294967295. The default value is 0.

no-advertise

Prevents static routes from being advertised.

-

no-install

Prevents the static route from being delivered to the FIB.

-

description text

Specifies a description for a static route.

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.

interface-type

Specifies the type of the outbound interface of the static route.

-

interface-number

Specifies the number of the outbound interface of the static route.

-

dhcp

Sets the IP address of a DHCP gateway as the next hop of the static route.

-

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 theDevice cannot run dynamic routing protocols to generate routes to the destination, configure static routes on the Device.

After recursive-lookup host-route is configured, static routes can recurse only to 32-bit host routes.

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.

You can configure description description-text to configure a description for static routes so that the administrator can check and maintain static routes easily. To check the configured description, run the display this or display current-configuration command in the system view.

Precautions

When configuring unicast static routes in a topology instance, note the following points:

  • The default priority of a static route is 60.
  • When deleting a route, you can specify preference, tag, or description. The parameters, however, are not displayed in the command line help.
  • When both the destination IP address and the mask are 0.0.0.0, the configured route is a default route. If no matching route is available in the routing table, the default route is used for packet forwarding.
  • Setting different priorities can implement different RM policies. For example, if the same priority is configured for multiple routes to the same destination, load balancing can be implemented. If different priorities are configured for multiple routes to the same destination, 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 P2P interfaces, excluding NBMA interfaces that support P2MP, such as the interfaces that use X.25 for encapsulation and dialling interfaces. At the link layer, both IP addresses and slave routes must be configured. Specifically, IP addresses must be mapped to link layer addresses using the dialer map ip, x.25 map ip, or frame-relay map ip command. In this case, when configuring static routes, you can specify only next hop addresses rather than outbound interfaces.
  • If the outbound interface is a non-P2P interface, a next hop address is required.
  • In some cases, for example, the link layer is encapsulated with PPP, you can also specify outbound interfaces even if the remote address is unknown. In this manner, you do not need to modify thedevice configuration if the remote address changes.

Example

# Configure a static route in the topology instance red with the next hop 11.11.11.1.
<HUAWEI> system-view
[~HUAWEI] ip topology red
[*HUAWEI] ip route-static topology red 1.2.3.4 32 11.11.11.1
# Delete an IPv4 static route and set the next hop address to 10.11.0.1.
<HUAWEI> system-view
[~HUAWEI] ip route-static 1.1.1.1 32 10.11.0.1
[~HUAWEI] undo ip route-static 1.1.1.1 32
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >