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.
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 } ]
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. |
- |
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:
<HUAWEI> system-view [~HUAWEI] ip topology red [*HUAWEI] ip route-static topology red 1.2.3.4 32 11.11.11.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