- Table of Contents
-
- 04-Layer 3 Command Reference
- 00-Preface
- 01-Basic IP Routing Commands
- 02-Static Routing Commands
- 03-IPv6 Static Routing Commands
- 04-IP Addressing Commands
- 05-IPv6 Basics Commands
- 06-DHCP Commands
- 07-DHCPv6 Commands
- 08-DNS Commands
- 09-IPv6 DNS Commands
- 10-IP Performance Optimization Commands
- 11-ARP Commands
- 12-IP Forwarding Basics Commands
- 13-NAT Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
02-Static Routing Commands | 52.60 KB |
ip route-static
Use ip route-static to configure a unicast static route.
Use undo ip route-static to delete a unicast static route.
Syntax
ip route-static dest-address { mask | mask-length } next-hop-address [ preference preference-value ]
undo ip route-static dest-address { mask | mask-length } next-hop-address [ preference preference-value ]
Default
No unicast static route is configured.
Views
System view
Default command level
2: System level
Parameters
dest-address: Specifies a destination IP address of the static route, in dotted decimal notation.
mask: Specifies mask of the IP address, in dotted decimal notation.
mask-length: Specifies mask length, in the range of 0 to 32.
next-hop-address: Specifies IP address of the next hop, in dotted decimal notation.
preference preference-value : Specifies a preference for the static route, in the range of 1 to 255. The default is 60. If no preference is specified, the default preference is used. When the default preference is re-configured, it applies to only newly added static routes.
Usage guidelines
When you configure a unicast static route, follow these 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 packets that match no specific entry in the routing table.
· Implement different routing policies to tune route preferences. To enable them to back up one another, assign different preferences to them.
· The next hop address of a static route cannot be the IP address of a local interface. Otherwise, the static does not take effect.
Examples
# Configure a static route, whose destination address is 1.1.1.1/24 and next hop address is 2.2.2.2.
<Sysname> system-view
[Sysname] ip route-static 1.1.1.1 24 2.2.2.2
Related commands
display ip routing-table