Use
undo ip route-static
to delete a unicast static route.
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 will be used for forwarding a packet if no route is available for
the packet in the routing table.
•
Implement different routing policies by tuning route preference. For example, to enable multiple
routes to the same destination address to share load, assign the same preference to the routes;
to enable them to back up one another, assign different preferences to them.
•
Specify the output interface or the next hop address of the static route as needed.
{
If the output interface supports network address-to-link layer address resolution or is a
point-to-point interface, you may specify only the interface or the next hop address.
{
If the output interface is a Null 0 interface, no next hop address is required.
{
If you specify a broadcast interface (such as an Ethernet interface or a VLAN interface) as
the output interface for a static route, you must specify the corresponding next hop of the
interface at the same time.
{
To implement BFD with the
control-packet
mode, the remote end must create a BFD
session; otherwise the BFD function cannot work. To implement BFD with the
echo-packet
mode, the BFD function can work without the remote end needing to create any BFD
session.
{
To configure a static route and enable BFD control packet mode for it, specify an output
interface and a direct next hop—BFD establishes a direct session, or specify an indirect
next hop and a specific BFD packet source address—BFD establishes an indirect
session—for the static route.
•
The next hop address cannot be the IP address of a local interface (such as an Ethernet
interface and VLAN interface). Otherwise, the static route does not take effect.
•
Enabling BFD for a flapping route could worsen the situation. Therefore, use it with caution. For
more information about BFD, see
High Availability Configuration Guide
.
•
If the track module uses NQA to detect the reachability of the private network static route's next
hop, the VPN instance number of the static route's next hop must be identical to that configured
in the NQA test group.
•
If a static route needs route recursion, the associated track entry must monitor the next hop of
the recursive route instead of that of the static route. Otherwise, a valid route may be mistakenly
considered invalid.
•
Do not specify the
permanent
keyword together with the
bfd
or
track
keyword.
Related commands:
display ip routing-table
and
ip route-static default-preference
.
Examples
# Configure a static route, whose destination address is 1.1.1.1/24, next hop address is 2.2.2.2, tag
value is 45, and description information is
for internet & intranet
.
<Sysname> system-view
[Sysname] ip route-static 1.1.1.1 24 2.2.2.2 tag 45 description for internet & intranet
# Configure a static route for a VPN instance named
vpn1
: the destination address is 1.1.1.1/16 and
the next hop address is 1.1.1.2, which is the address of this VPN instance.
<Sysname> system-view
[Sysname] ip route-static vpn-instance vpn1 1.1.1.1 16 vpn-instance vpn1 1.1.1.2
# Configure a static route: the destination address is 1.1.1.1/24, the output interface is
Vlan-interface11, and the next hop address is 2.2.2.2, and enable BFD with the echo packet mode.
<Sysname> system-view
[Sysname] ip route-static 1.1.1.1 24 Vlan-interface 11 2.2.2.2 bfd echo-packet
26