
5
Configuring a static route
Configuration prerequisites
Before configuring a static route, complete the following tasks:
•
Configure the physical parameters for related interfaces
•
Configure the link-layer attributes for related interfaces
•
Configure the IP addresses for related interfaces
Configuration procedure
Follow these steps to configure a static route:
To do…
Use the command…
Remarks
Enter system view
system-view
—
Configure a static route
ip
route-static
dest-address
{
mask
|
mask-length
}
{
next-hop-address
[
track
track-entry-number
] |
interface-type
interface-number
[
next-hop-address
] }
[
preference
preference-value
] [
permanent
] [
description
description-text
]
Required
By default,
preference
for static routes is 60,
and no description
information is
configured.
Do not specify the
permanent
and
track
keywords
simultaneously.
If the outgoing
interface is down, the
permanent static route
is still active.
Configure the default
preference for static
routes
ip route-static default-preference
default-preference-value
Optional
60 by default
NOTE:
•
When you configure a static route, the static route does not take effect if you specify the next hop address
first and then configure it as the IP address of a local interface, such as VLAN interface.
•
If you do not specify the preference when you configure a static route, the default preference will be
used. Reconfiguring the default preference applies only to newly created static routes.
•
If the destination IP address and mask are both configured as 0.0.0.0 with the
ip route-static
command,
then the route is the default route.
•
For detailed information about track, see
High Availability Configuration Guide.