Title | Size | Downloads |
---|---|---|
H3C S5120-SI Series Ethernet Switches Command Reference-Release 1101-6W105-Static Routing Commands.pdf | 33.6 KB |
- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
17-Static Routing Commands | 33.6 KB |
Table of Contents
1 Static Routing Configuration Commands
Static Routing Configuration Commands
ip route-static default-preference
The term “router” in this document refers to a router in a generic sense or a Layer 3 switch.
Static Routing Configuration Commands
delete static-routes all
Syntax
delete static-routes all
View
System view
Default Level
2: System level
Parameters
None
Description
Use the delete static-routes all command to delete all static routes.
When you use this command to delete static routes, the system will prompt you to confirm the operation before deleting all the static routes.
Related commands: ip route-static and display ip routing-table in IP Routing Basics Commands.
Examples
# Delete all static routes on the router.
<Sysname> system-view
[Sysname] delete static-routes all
This will erase all ipv4 static routes and their configurations, you must reconf
igure all static routes
Are you sure?[Y/N]:Y
ip route-static
Syntax
ip route-static dest-address { mask | mask-length } { next-hop-address | interface-type interface-number next-hop-address } [ preference preference-value ] [ description description-text ]
undo ip route-static dest-address { mask | mask-length } [ next-hop-address | interface-type interface-number [ next-hop-address ] ] [ preference preference-value ]
View
System view
Default Level
2: System level
Parameters
dest-address: Destination IP address of the static route, in dotted decimal notation.
mask: Mast of the IP address, in dotted decimal notation.
mask-length: Mask length, in the range 0 to 32.
next-hop-address: IP address of the next hop, in dotted decimal notation.
preference preference-value : Specifies the preference of the static route, which is in the range of 1 to 255 and defaults to 60.
description description-text: Configures a description for the static route, which consists of 1 to 60 characters, including special characters like space, but excluding ?.
Description
Use the ip route-static command to configure a unicast static route.
Use the undo ip route-static command to delete a unicast static route.
When configuring a unicast static route, note that:
1) If the destination IP address and the mask are both 0.0.0.0, the configured route is a default route. If routing table searching fails, the router will use the default route for packet forwarding.
2) Different route management policies can be implemented for different route preference configurations. For example, specifying the same preference for different routes to the same destination address enables load sharing, while specifying different preferences for these routes enables route backup.
3) When configuring a static route, you can specify the output interface or the next hop address based on the actual requirement. Note that the next hop address must not be the IP address of the local interface; otherwise, the route configuration will not take effect. For interfaces that support network address to link layer address resolution or point-to-point interfaces, you can specify the output interface or next hop address. When specifying the output interface, note that:
l For a Null 0 interface, if the output interface has already been configured, there is no need to configure the next hop address.
l If you specify a broadcast interface (such as a VLAN interface) as the output interface, you must specify the corresponding next hop of the interface at the same time.
Related commands: ip route-static default-preference and display ip routing-table in IP Routing Basics Commands.
l The static route does not take effect if you specify its next hop address first and then configure the address as the IP address of a local interface, such as VLAN interface.
l To configure track monitoring for an existing static route, simply associate the static route with a track entry. For a non-existent static route, configure it and associate it with a track entry.
l If a static route needs route recursion, the associated track entry must monitor the nexthop of the recursive route instead of that of the static route; otherwise, a valid route may be mistakenly considered invalid.
Examples
# Configure a static route, whose destination address is 1.1.1.1/24, next hop address is 2.2.2.2, and description information is for internet & intranet.
<Sysname> system-view
[Sysname] ip route-static 1.1.1.1 24 2.2.2.2 description for internet & intranet
ip route-static default-preference
Syntax
ip route-static default-preference default-preference-value
undo ip route-static default-preference
View
System view
Default Level
2: System level
Parameters
default-preference-value: Default preference for static routes, which is in the range of 1 to 255.
Description
Use the ip route-static default-preference command to configure the default preference for static routes.
Use the undo ip route-static default-preference command to restore the default.
By default, the default preference of static routes is 60.
Note that:
l If no preference is specified when configuring a static route, the default preference is used.
l When the default preference is re-configured, it applies to newly added static routes only.
Related commands: ip route-static and display ip routing-table in IP Routing Basics Commands.
Examples
# Set the default preference of static routes to 120.
<Sysname> system-view