While configuring a static route, you can specify either the output interface or the next hop address
depending on the specific occasion. For a NULL0 interface, if the output interface has already been
configured, there is no need to configure the next hop address
In fact, all the route entries must have a next hop address. When forwarding a packet, a router first
searches the routing table for the route to the destination address of the packet. The system can find
the corresponding link layer address and forward the packet only after the next hop address is
specified. The next hop address can not be a local interface IP address; otherwise, the route
configuration will not take effect.
•
Other attributes:
You can configure different preferences for different static routes so that route management policies
can be applied more flexibly.
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...
1.
Enter system view
2.
Configure a static
route
3.
Configure the
default preference
for static routes
When configuring 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.
If you do not specify the preference when configuring 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, the
•
route is the default route.
Use the command...
system-view
ip route-static dest-address { mask | mask-
length } { next-hop-address | interface-type
interface-number [ next-hop-address ] } [
preference preference-value ] [ description
description-text ]
ip route-static default-preference
default-preference-value
15
Remarks
—
Required
By default, preference for static
routes is 60 and no description
information is configured.
Optional
60 by default