Configuring a static route

Before you configure a static route, complete the following tasks:

You can associate Track with a static route to monitor the reachability of the next hops. For more information about Track, see High Availability Configuration Guide.

To configure a static route:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. (Optional.) Create a static route group and enter its view.

ip route-static-group group-name

By default, no static route group is configured.

3. (Optional.) Add a static route prefix to the static route group.

prefix dest-address { mask-length | mask }

By default, no static route prefix is added to the static route group.

4. (Optional.) Return to system view.

quit

N/A

5. Configure a static route.

  • Method 1:
    ip route-static
    { dest-address { mask-length | mask } | group group-name } { interface-type interface-number [ next-hop-address ] | next-hop-address [ recursive-lookup host-route ] [ track track-entry-number ] | vpn-instance d-vpn-instance-name next-hop-address [ recursive-lookup host-route ] [ track track-entry-number ] } [ permanent ] [ preference preference ] [ tag tag-value ] [ description text ]

  • Method 2:ip route-static vpn-instance s-vpn-instance-name { dest-address { mask-length | mask } | group group-name } { interface-type interface-number [ next-hop-address ] | next-hop-address [ recursive-lookup host-route ] [ public ] [ track track-entry-number ] | vpn-instance d-vpn-instance-name next-hop-address [ recursive-lookup host-route ] [ track track-entry-number ] } [ permanent ] [ preference preference ] [ tag tag-value ] [ description text ]

By default, no static route is configured.

6. (Optional.) Enable periodic sending of ARP requests to the next hops of static routes.

ip route-static arp-request interval interval

By default, the device does not send ARP requests to the next hops of static routes.

7. (Optional.) Configure the default preference for static routes.

ip route-static default-preference default-preference

The default setting is 60.

8. (Optional.) Delete all static routes, including the default route.

delete [ vpn-instance vpn-instance-name ] static-routes all

To delete one static route, use the undo ip route-static command.