The ip route-static command configures a unicast static route.
The undo ip route-static command deletes a unicast static route.
By default, no unicast static route is configured.
ip route-static ip-address { mask | mask-length } { nexthop-address | interface-type interface-number [ nexthop-address ] | vpn-instance vpn-instance-name nexthop-address } [ preference preference | tag tag ] * [ track { route-monitor-group route-monitor-group-name | bfd-session cfg-name | efm-state interface-type interface-number | nqa admin-name test-name } | permanent ] [ description text ]
ip route-static ip-address { mask | mask-length } vpn-instance vpn-instance-name [ preference preference | tag tag ] * [ description text ] (supported only by the S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S)
undo ip route-static ip-address { mask | mask-length } [ nexthop-address | interface-type interface-number [ nexthop-address ] ] [ preference preference | tag tag ] * [ track { bfd-session | efm-state } | permanent ]
undo ip route-static [ track bfd-session ] all
undo ip route-static ip-address { mask | mask-length } vpn-instance vpn-instance-name (supported only by the S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-HI, S6730-H, S6730S-H, S6730-S, and S6730S-S)
Parameter | Description | Value |
---|---|---|
ip-address |
Specifies a destination IP address. |
The value is in dotted decimal notation. |
mask |
Specifies a subnet mask. |
The value is in dotted decimal notation. |
mask-length |
Specifies the mask length. The 1s in each 32-bit mask must be consecutive. Therefore, a mask in dotted decimal notation can be presented by a mask length. |
The value is an integer in the range from 0 to 32. |
nexthop-address |
Specifies the next-hop address. |
The value is in dotted decimal notation. |
interface-type interface-number |
Specifies the type and number of an interface that forwards packets. |
- |
vpn-instance vpn-instance-name |
Specifies the name of a VPN instance. If a VPN instance name is specified, the device searches the routing table of the VPN instance for a static route according to nexthop-address. If the nexthop-address parameter is not specified, the device searches a specified VPN instance forwarding table if the device fails to find a forwarding path in the public network forwarding table. |
The value is a string of 1 to 31 case-sensitive characters with spaces. The string can contain spaces if it is enclosed with double quotation marks ("). |
preference preference |
Specifies the preference of a static route. A smaller value indicates a higher preference. |
The value is an integer that ranges from 1 to 255. The default value is 60. |
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 static routes with specified tag values through routing policies. |
The value is an integer that ranges from 1 to 4294967295. The default value is 0. |
track route-monitor-group route-monitor-group-name |
Binds a static route to a route monitoring group for fast fault detection. |
The value is a string of 1 to 31 case-sensitive characters. |
track bfd-session cfg-name |
Binds a static BFD session to a static route for fast fault detection. |
cfg-name is a string of 1 to 15 characters without spaces. The string can contain spaces if it is enclosed with double quotation marks ("). |
track efm-state interface-type interface-number |
Detects the EFM OAM state of a specified interface. |
- |
track nqa admin-name test-name |
Specifies the administrator name of an NQA test instance bound to a static route, and the name of the test instance. |
The values of admin-name and test-name are both a string of 1 to 32 case-sensitive characters without spaces. |
permanent |
Configures permanent advertisement of static routes. |
- |
description text |
Configures a description for a static route. |
The value is a string of 1 to 80 characters that can contain spaces. |
all |
Deletes all IPv4 unicast static routes. |
- |
Only the S5720-EI, S5720-HI, S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730-HI, S5730S-EI, S5730-SI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6720S-SI, S6720-SI, S6730-H, S6730S-H, S6730-S, and S6730S-S support the track bfd-session cfg-name parameter.
Usage Scenario
On a simple network, you can configure static routes to ensure network connectivity. If a switch cannot use dynamic routing protocols for network connectivity, static routes can be configured on the switch.
Precautions