Static Route Configuration layer 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

Huawei AR Series Access Routers

CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

2 Static Route Configuration

About This Chapter

This chapter provides an overview of the functions, purposes, and use cases of
static routes, and explains how they can be configured.

2.1 Introduction to Static Routes


2.2 Principles
2.3 Applications
2.4 Configuration Task Summary
2.5 Configuration Notes
2.6 Default Configuration of Static Routes
2.7 Configuring IPv4 Static Routes
2.8 Configuring Static BFD for IPv4 Static Routes
2.9 Associating IPv4 Static Routes with NQA
2.10 Configuring IPv6 Static Routes
2.11 Configuration Examples
2.12 FAQ
This section provides the questions you may encounter during configuration and
their answers.

2.1 Introduction to Static Routes

Definition
A static route is a route that, in most cases, the network administrator manually
configures to allow network traffic to reach a target destination.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 18


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Purpose
Static routes are used in different ways on different types of network.
● On simple networks, static routes can be used alone, without the need for
dynamic routes.
● On complex networks, static routes can be used alongside dynamic routes to
improve network performance and ensure bandwidth is available for
important applications.
● Static routes associated with VPN instances are used to manage VPN routes.

2.2 Principles

2.2.1 Basics of Static Routes


A router forwards data packets based on routing entries in a routing table. These
routing entries can be manually configured or calculated using dynamic routing
protocols. A static route normally refers to a manually configured route.
Static routes use less bandwidth than dynamic routes and do not use CPU
resources for route calculation and update analysis. When a network fault occurs
or the topology changes, static routes cannot be automatically updated and must
be manually reconfigured to adapt to the network change. A static route has five
parameters: destination IP address, mask, outbound interface, next hop, and
preference.

Destination Address and Mask


The destination IPv4 address of a static route is expressed in dotted decimal
notation. The mask of the route can be expressed either in dotted decimal
notation or by the mask length. The mask length is the number of consecutive 1s
in the mask. For details about the destination IPv6 address and mask of a static
route, see "Basic IPv6 Configurations - Principles - IPv6 Addresses" in the
Configuration Guide - IP Service. Setting the destination and mask to all 0s
configures a default static route. For details about the default static route, see
2.3.2 Application of the Static Default Route.

Outbound Interface and Next-Hop IP Address


When configuring a static route, depending on the outbound interface type, you
need to specify either an outbound interface or a next-hop IP address.
● For point-to-point (P2P) interfaces, you only need to specify an outbound
interface. This automatically sets the IP address of the remote interface
connected to the outbound interface as the next-hop address.
● For non-broadcast multiple access (NBMA) interfaces such as Asynchronous
Transfer Mode (ATM) interfaces, specify a next-hop IP address. This type of
interfaces support point-to-multipoint (P2MP) networks and require
mappings between IP addresses and link-layer addresses to be configured
during the configuration of static routes. In this case, no outbound interface
needs to be specified.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 19


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

● For broadcast interfaces (such as Ethernet interfaces) and virtual template


(VT) interfaces, specify a next-hop IP address. Ethernet interfaces are
broadcast interfaces, and VT interfaces can be associated with several virtual
access (VA) interfaces. If an Ethernet interface or a VT interface is specified as
the outbound interface, there will be multiple next hops, and the system will
not be able to decide which next hop to use.

Static Route Preference


Different static routes can be configured with different preference values. A
smaller preference value indicates a higher priority. Specifying the same
preference value for static routes with the same destination implements load
balancing among these routes. Conversely, specifying different preference values
for static routes with the same destination implements route backup among the
routes. For details, see 2.3.1 Load Balancing and Route Backup.

2.2.2 BFD for Static Routes


Unlike dynamic routes, static routes do not have a dedicated fault detection
mechanism. If a link fault occurs on the network, the administrator needs to
rectify it. Bidirectional Forwarding Detection (BFD) for static routes can be used to
bind a static route to a BFD session so that the BFD session can detect the status
of the link associated with the static route.
● If the BFD session bound to a static route detects a link fault, BFD reports the
link fault to the Routing Management (RM) module. The RM module then
sets the route to inactive, and this route is no longer available in the routing
table.
● If the BFD session bound to a static route detects that the faulty link has been
re-established, BFD reports a message to the RM module. The RM module
then sets the route to active, and this route becomes available in the IP
routing table once again.
For more details about BFD, see "BFD Configuration - Principles" in Configuration
Guide - Reliability.

2.2.3 NQA for Static Routes


As mentioned previously, static routes do not have a dedicated fault detection
mechanism. If a fault occurs, the corresponding static route will not be
automatically deleted from the IP routing table. This can interrupt services for a
significant amount of time. The network administrator must delete the
corresponding static route to allow traffic to switch to an available path.
An effective method is required to detect faults in links related to static routes.
BFD for static routes is applicable only to the scenario where both communicating
devices support BFD. If either of the two communicating devices supports NQA,
NQA for static routes can be used to detect faults in links where Layer 2 devices
reside.
NQA for static routes refers to the association between a static route and an NQA
test instance. The system can use the NQA test instance to check the link status.
Then, according to the NQA test result, the system can determine an optimal
route in time to prevent communication interruption and ensure service quality.
NQA for static routes functions as follows:

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 20


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

● If NQA detects a fault in the link, the system sets the static route to inactive.
The route becomes unavailable and is deleted from the IP routing table.
● If NQA finds that the link recovers, the system sets the static route to active.
The route becomes available and is added to the IP routing table.
For details about NQA, see "NQA Configuration - Principles" in the Configuration
Guide - Network Management and Monitoring.

NOTE

When a static route is associated with an NQA test instance, only ICMP test instances are
used to test whether there are reachable routes between the source and destination.
Each static route can be associated with only one NQA test instance.

Applications
On the network shown in Figure 2-1, each access switch provides access services
for 10 users, and a total of 100 users are connected to the network. Because
dynamic routing protocols are unavailable for communication between RouterB
and users, static routes are configured on RouterB. For network stability, RouterC,
functioning as the backup for RouterB, is configured with static routes to the same
destination. RouterA, RouterB, and RouterC run a dynamic routing protocol to
learn routes from each other. RouterB and RouterC import static routes using a
dynamic routing protocol and have different costs for these static routes. After the
configuration is complete, RouterA can use the dynamic routing protocol to learn
routes destined for users from RouterB and RouterC. RouterA uses the link related
to the static route with a lower cost as the active link and the other link as the
standby link.
NQA for static routes is configured on RouterB. NQA tests are performed to check
the active link of RouterB → SwitchA → SwitchC (SwitchD). If the active link fails,
the corresponding static route is deleted from the routing table, and traffic diverts
to the standby link of RouterC → SwitchB → SwitchC (SwitchD). If both links work
properly, traffic travels along the active link.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 21


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Figure 2-1 Networking to apply NQA for static routes

IP Network

RouterA

RouterB RouterC
SwitchA SwitchB

......
SwitchC SwitchD

...... ......

Client1 Client10 Client91 Client100

2.2.4 Permanent Advertisement of Static Routes


Permanent advertisement of static routes provides a low-cost and simple link
detection mechanism and improves compatibility between Huawei devices and
non-Huawei devices. If service traffic needs to be forwarded along a specified
path, you can ping the destination addresses of static routes to detect the link
connectivity.

Link connectivity determines the stability and availability of a network. Therefore,


link detection plays an important role in network maintenance. BFD, as a link
detection mechanism, is inapplicable to certain scenarios. For example, a simpler
and more natural method is required for link detection between different ISPs.

After permanent advertisement of static routes is configured, the static routes that
cannot be advertised are still preferred and are added to the routing table in the
following cases:

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 22


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

● If an outbound interface configured with an IP address is specified for a static


route, the static route is always preferred and added to the routing table
regardless of whether the outbound interface is Up or Down.
● If no outbound interface is specified for a static route, the static route is
always preferred and added to the routing table regardless of whether the
static route can be iterated to an outbound interface.
In this way, you can enable IP packets to be always forwarded through this static
route. The permanent advertisement mechanism provides a way for you to
monitor services and detect link connectivity.

NOTICE

A device enabled with this feature always stores static routes in its IP routing
table, regardless of whether the static routes are reachable. If a path is
unreachable, the corresponding static route may become a blackhole route.

Applications
In Figure 2-2, BR1, BR2, and BR3 belong to ISP1, ISP2, and ISP3 respectively.
Between BR1 and BR2 are two links, Link A and Link B. ISP1, however, requires
that service traffic be forwarded to ISP2 over Link A without traveling through
ISP3.

Figure 2-2 Networking for applying permanent advertisement of static routes

ISP2

BR2
10.1.1.2/24
LinkA

BR1

ISP1
LinkB BR3

ISP3

The External Border Gateway Protocol (EBGP) peer relationship is established


between BR1 and BR2. For service monitoring, a static route destined for the BGP
peer (BR2) at 10.1.1.2/24 is configured on BR1, and permanent advertisement of
static routes is enabled. The interface that connects BR1 to BR2 is specified as the
outbound interface of the static route. Then, the network monitoring system
periodically pings 10.1.1.2 to determine the status of Link A.
If Link A works properly, ping packets are forwarded over Link A. If Link A
becomes faulty, although service traffic can reach BR2 over Link B, the static route

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 23


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

is still preferred because permanent advertisement of static routes is enabled.


Therefore, ping packets are still forwarded over Link A, but packet forwarding fails.
This scenario is also applicable to BGP packets. That is, a link fault causes the BGP
peer relationship to be interrupted. The monitoring system detects service faults
as returned in the ping result and prompts maintenance engineers to rectify the
faults before services are affected.

2.3 Applications

2.3.1 Load Balancing and Route Backup


Load Balancing Among Static Routes
To implement load balancing, specify the same preference for multiple routes to
the same destination.

Figure 2-3 Load Balancing Among Static Routes


RouteB

Preference=60
Preference=60
RouteA RouteC

RouteD

As shown in Figure 2-3, there are two static routes with the same preference from
RouterA to RouterC. The two routes are stored in the routing table and used to
forward data.

Route Backup
To implement route backup, specify different preferences for multiple routes to the
same destination.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 24


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Figure 2-4 Route backup


RouteB

Preference=60
Preference=100
RouteA RouteC

RouteD

As shown in Figure 2-4, there are two static routes with different preferences from
RouterA to RouterC. Static route B with next hop RouterB has a higher preference.
The link that static route B belongs to functions as the active link. Static route D
with next hop RouterD has a lower preference. The link that static route D belongs
to functions as the standby link.
● In normal situations, static route B is activated, and the active link forwards
data. Static route D is not shown in the routing table.
● If a fault occurs on the active link, static route B is deleted from the routing
table. Static route D is activated, and the standby link forwards data.
● When the active link restores, static route B is activated again, and the active
link forwards data. Static route D is deleted from the routing table and
functions as the backup route. Static route D is also called a floating static
route.

2.3.2 Application of the Static Default Route


When the destination IP address is set to all 0s, a default route is configured. The
default route can be automatically generated by a routing protocol or manually
configured. The default route manually configured simplifies network
configuration. If the destination address of a packet fails to match any entry in the
routing table, the router selects the default route to forward the packet.

Figure 2-5 Networking diagram of static routes

2 4
RouteB

1 5

RouteA RouteC

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 25


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

As shown in Figure 2-5, if no static default route is configured, you need to


configure static routes destined for networks 3, 4, and 5 on RouterA, configure
static routes destined for networks 1 and 5 on RouterB, and configure static routes
destined for networks 1, 2, and 3 on RouterC. In this way, RouterA, RouterB, and
RouterC can communicate with each other.
The next hop of the packets sent by RouterA to networks 3, 4, and 5 is RouterB.
Therefore, a default route configured on RouterA can replace the three static
routes destined for networks 3, 4, and 5 in the preceding example. Similarly, only a
default route from RouterC to RouterB can replace the three static routes destined
for networks 1, 2, and 3 in the preceding example.

2.4 Configuration Task Summary


Table 2-1 describes the static route configuration tasks.

Table 2-1 Static route configuration tasks


Scenario Description Task

Configuring static routes Static routes are ● 2.7 Configuring IPv4


manually configured by Static Routes
the administrator to ● 2.10 Configuring
ensure normal working IPv6 Static Routes
of simple networks and
bandwidth for important
network applications.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 26


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Scenario Description Task

Configuring other In actual networking, ● 2.8 Configuring


protocols for static static routes are Static BFD for IPv4
routes associated with other Static Routes
protocols to improve ● 2.9 Associating IPv4
network performance. Static Routes with
● BFD for static routes: NQA
Unlike dynamic
routing protocols,
static routes do not
have the detection
mechanism. If a fault
occurs on the
network, the
administrator needs
to handle it. BFD for
static routes enables a
BFD session to detect
the link status of the
static route and
performs fault
detection at
millisecond level.
● Network Quality
Analysis (NQA) for
static routes: In actual
networking, link
status must be
detected in real time
to ensure network
stability, and a link
switchover can be
performed according
to link status changes.
ARP and BFD are used
to detect link status.
In addition, IGP
convergence can also
be used. However, the
preceding solutions
are not applicable to
the following special
scenarios:
– If only one link
rather than links of
every user on the
network needs to
be detected, ARP
detection is not
applicable.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 27


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Scenario Description Task

– If any device on
the network does
not support BFD,
BFD detection
cannot be
implemented.
– If either end of the
link is a Layer 2
device, dynamic
routing protocols
cannot be
configured and
therefore IGP
convergence
cannot be
implemented.
NQA for static routes
only requires one end
of the interconnected
devices to support
NQA and can be used
even if there are
Layer 2 devices. The
preceding problems
are solved. When a
link is faulty, an NQA
test instance can
immediately detect
the link change and
delete the static route
associated with the
NQA test instance
from the IP routing
table, affecting traffic
forwarding.

2.5 Configuration Notes


Network Element Involved
None

License Support
Static Route is a basic feature of a router and is not under license control.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 28


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Feature Dependency and Limitation


None

2.6 Default Configuration of Static Routes


Table 2-2 describes the default configuration of static routes.

Table 2-2 Default configuration of static routes

Parameter Default Setting

Preference of static routes 60

2.7 Configuring IPv4 Static Routes

Pre-configuration Tasks
Before configuring IPv4 static routes, complete the following task:

● Configuring link layer parameters and IP addresses for interfaces to ensure


network-layer communication between neighbor nodes

Configuration Procedures
You can perform the following configuration tasks (excluding the task of Checking
the Configuration) in any sequence as required.

2.7.1 Creating IPv4 Static Routes

Context
When creating static routes, you can specify both the outbound interface and next
hop. Alternatively, you can specify only the outbound interface or next hop based
on the outbound interface type.
● Specify the outbound interface for P2P interfaces.
● Specify the next hop for non broadcast multiple access (NBMA) interfaces.
● Specify the next hop for broadcast interfaces (for example, Ethernet
interfaces) and virtual template interfaces.

If you specify the same preference for static routes to the same destination, you
can implement load balancing among these routes. If you specify different
preferences for static routes, you can implement route backup among the routes.

If the destination IP address and mask are set to all 0s, an IPv4 static default route
is configured. By default, no IPv4 static default route is configured.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 29


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Configure IPv4 static routes.
● Run:
ip route-static ip-address { mask | mask-length } { nexthop-address | interface-type interface-number
[ nexthop-address ] | vpn-instance vpn-instance-name nexthop-address } [ preference preference |
tag tag ] * [ description text ]

Or:
ip route-static ip-address { mask | mask-length } interface-type interface-number [ nexthop-address ]
[ preference preference | tag tag ] * ldp-sync [ description text ]

Or:
ip route-static destination-address { mask | mask-length } interface-type interface-number dhcp
[ preference preference | tag tag ] * [ track nqa admin-name test-name ] [ description text ]

An IPv4 static route is configured on the public network.


● run:
ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } { nexthop-
address [ public ] | interface-type interface-number [ nexthop-address ] | vpn-instance vpn-
destination-name nexthop-address } [ preference preference | tag tag ] * [ description text ]
Or:
ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } interface-
type interface-number [ nexthop-address ] [ preference preference | tag tag ] * ldp-sync
[ description text ]

Or:
ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length } interface-
type interface-number dhcp [ preference preference | tag tag ] * [ track nqa admin-name test-
name ] [ description text ]
An IPv4 static route is configured in a VPN instance.
● Run any of the following commands:
– ip route-static vpn-instance vpn-source-name destination-address
{ mask | mask-length } { nexthop-address [ public ] | interface-type
interface-number [ nexthop-address ] | vpn-instance vpn-destination-
name nexthop-address } [ preference preference | tag tag ] *
[ description text ]
– ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length }
interface-type interface-number [ nexthop-address ] [ preference preference | tag tag ] * ldp-
sync [ description text ]

– ip route-static vpn-instance vpn-source-name destination-address { mask | mask-length }


interface-type interface-number dhcp [ preference preference | tag tag ] * [ track nqa admin-
name test-name ] [ description text ]
An IPv4 static route is configured in a VPN instance.

----End

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 30


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

2.7.2 (Optional) Setting the Default Preference for IPv4 Static


Routes
Context
The default preference of IPv4 static routes affects route selection. When an IPv4
static route is configured, the default preference is used if no preference is
specified for the static route.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
ip route-static default-preference preference

The default preference of static routes is set.


By default, the preference of static routes is 60.

NOTE

After the default preference is reconfigured, the new default preference is valid only for
new IPv4 static routes.

----End

2.7.3 (Optional) Configuring Static Route Selection Based on


Iteration Depth
Context
Route iteration refers to the process of finding the directly-connected outbound
interface based on the next hop of a route. The iteration depth indicates the
number of times the system searches for routes. A smaller number of route
iterations indicates a smaller iteration depth.
When there are multiple static routes with the same prefix but different iteration
depths, the system selects the static route with the smallest iteration depth as the
active route and delivers it to the FIB table after static route selection based on
iteration depth is configured. The other static routes then become inactive. A
smaller iteration depth indicates a more stable route.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 31


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

ip route-static selection-rule relay-depth

Static route selection based on iteration depth is configured.


By default, static routes are not selected based on iteration depth.

----End

2.7.4 (Optional) Configuring Permanent Advertisement of


IPv4 Static Routes
Context
Link connectivity directly affects network stability and availability. Monitoring link
status is an important measure for network maintenance. If service traffic needs
to be forwarded along a specified path, you can monitor the status of the path
using a ping operation. In this manner, you can monitor services at a very low
cost.
With permanent advertisement of static routes, you can detect link connectivity by
pinging the destination addresses of static routes. After permanent advertisement
of static routes is configured, static routes always take effect regardless of the
outbound interface status. In this case, the system forwards ping packets along a
specified path only, which helps monitor the link status of the path.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
ip route-static ip-address { mask | mask-length } { nexthop-address | interface-type interface-number
[ nexthop-address ] | vpn-instance vpn-instance-name nexthop-address } permanent

Permanent advertisement of IPv4 static routes is configured.


By default, permanent advertisement of IPv4 static routes is not configured.

----End

2.7.5 (Optional) Preventing a Static Route from Being


Selected If the BFD Session Associated with It Is in the
AdminDown State

Context
By default, a static route can still be selected by the router even though the BFD
session associated with it is in the AdminDown state, but not by non-Huawei
devices. As a result, the router cannot interwork with non-Huawei devices.
To address this problem, run the ip route-static track bfd-session admindown
invalid command to configure the router not to select the static route if the BFD
session associated with it is in the AdminDown state.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 32


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
ip route-static track bfd-session session-name bfd-name admindown invalid

The router has been configured not to select the static route if the BFD session
associated with it is in the AdminDown state.
By default, a static route can still be selected by the router even though the BFD
session associated with it is in the AdminDown state.

----End

2.7.6 (Optional) Preventing Static Routes from Being Iterated


to a Black-Hole Route
Context
If a link failure occurs on a network with IGP (OSPF for example), static, and
black-hole routes, the static routes may be iterated to the black-hole route to
remain active. Therefore, the static routes are preferentially selected over the OSPF
routes because of a higher priority. Although active, the static routes are
unreachable because they have been iterated to the black-hole route. As a result,
services are interrupted. To address this problem, prevent the static routes from
being iterated to the black-hole route so that the OSPF routes can be
preferentially selected.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
ip route recursive-lookup blackhole protocol static disable

Static routes have been prevented from being iterated to the black-hole route.
By default, static routes can be iterated to a black-hole route.

----End

2.7.7 (Optional) Configuring IPv4 Static Route Filtering

Background
NOTE

Only V200R007C00 supports this configuration.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 33


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

If you want to advertise configured static routes to a network through routing


protocols, but do not want to use the routes for packet forwarding, use static
route filtering function to prohibit these routes from being used for packet
forwarding.
In Figure 2-6, RouterB connects to RouterA and RouterC. RouterA and RouterB
have interface IP addresses with 23-bit masks planned, but RouterC is newly
added to the network and does not support the routing table containing 23-bit
mask routes. As a result, RouterC cannot receive routes from RouterB, which may
lead to service failures. To prevent this situation, configure 24-bit mask routes on
RouterB and send these routes to RouterC, while allowing RouterB to use existing
23-bit mask routes for packet forwarding. To achieve this purpose, configure static
route filtering function on RouterB to filter 24-bit mask routes. Then RouterB can
still send these routes to RouterC but does not use these routes for service packet
forwarding.

Figure 2-6 Static route filtering networking

RouterA RouterB RouterC

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
acl

The advanced ACL creates an advanced ACL and enters the ACL view.
Step 3 Run:
rule

IPv4 static route filtering rules is configured.


Step 4 Run:
quit

Return to the system view.


Step 5 Run:
routing-table download filter acl acl-number

The static route filtering function is configured.


By default, the static route filtering function is not configured.
Step 6 Run:

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 34


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

ip route-static

Static routes to be filtered is configured.

----End

Checking the Configuration


Run the display current-configuration command to check the static route
filtering configuration.

2.7.8 Checking the Configuration


Procedure
● Run the display ip routing-table command to check brief information about
the IPv4 routing table.
● Run the display ip routing-table verbose command to check detailed
information about the IPv4 routing table.
----End

2.8 Configuring Static BFD for IPv4 Static Routes

Pre-configuration Tasks
Before configuring static BFD for IPv4 static routes, complete the following tasks:
● Configuring link layer parameters and IP addresses for interfaces to ensure
network-layer communication between neighbor nodes
● Configuring BFD sessions
For details, see "BFD Configuration" in the Huawei AR Series Access Routers -
Configuration Guide - Reliability.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
ip route-static ip-address { mask | mask-length } { nexthop-address | interface-type interface-number
[ nexthop-address ] } [ preference preference | tag tag ] * track bfd-session cfg-name [ description text ]

A public network static IPv4 route is bound to a BFD session.

NOTE

Before binding a static route to a BFD session, ensure that the BFD session and the static
route reside on the same link.

Step 3 Run:
bfd

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 35


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

The BFD view is displayed.

Step 4 Run:
bfd session nonexistent-config-check enable

The device is enabled to check whether an associated BFD session is deleted.

By default, a device is enabled to check whether an associated BFD session is


deleted.

To check whether an associated BFD session is deleted, run the bfd session
nonexistent-config-check enable command. After a static route is associated
with a static BFD session, deleting the static BFD session causes the association to
become invalid. After a device is enabled to check whether an associated BFD
session is deleted, the device checks whether the BFD session is associated when
deleting a BFD session.

----End

Checking the Configuration


Run the following commands to check the previous configuration.

● Run the display bfd session { all | discriminator discr-value } [ verbose ]


command to check information about the BFD session.
● Run the display current-configuration | include bfd command to check the
configuration of BFD for static routes.

2.9 Associating IPv4 Static Routes with NQA

Pre-configuration Tasks
Before associating IPv4 static routes with NQA, complete the following task:

● Configuring link layer parameters for interfaces to ensure that the link layer
protocol on the interfaces is Up

Procedure
Step 1 Configure an NQA ICMP test instance.
1. Run:
system-view

The system view is displayed.


2. Run:
nqa test-instance admin-name test-name

An NQA test instance is created, and the view of the test instance is displayed.
3. Run:
test-type icmp

The test type is set to ICMP.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 36


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

NOTE

When a static route is associated with an NQA test instance, only ICMP test instances
are used to test whether there are reachable routes between the source and
destination.
4. Run:
destination-address ipv4 ip-address

The destination address is set.

In an NQA test instance, you can specify an NQA server by running the
destination-address command to configure a destination address for the
NQA test instance.
5. (Optional) Run:
frequency interval

The interval for automatically performing an NQA test is set.

By default, no interval is set, that is, only one test is performed.


6. (Optional) Run:
probe-count number

The number of probes to be sent each time is set for the NQA test instance.

By default, the number of probes is 3.

By sending probes multiple times in an NQA test instance, you can accurately
estimate network quality based on the collected statistics.
7. Run:
start

The NQA test instance is started.

The start command can configure an NQA test instance to be started


immediately, at a specified time, or after a specified delay. You can perform
one of the following operations as required:
– Run:
start now [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds second | hh:mm:ss } | lifetime
{ seconds second | hh:mm:ss } } ]

The NQA test instance is started immediately.


– Run:
start at [ yyyy/mm/dd ] hh:mm:ss [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds
second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ]
The NQA test instance is started at a specified time.
– Run:
start delay { seconds second | hh:mm:ss } [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay
{ seconds second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ]

The NQA test instance is started after a specified delay.


8. Run:
quit

Return to the system view.

Step 2 Associate static routes with an NQA test instance.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 37


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

1. Run:
ip route-static ip-address { mask | mask-length } { nexthop-address | interface-type interface-number
[ nexthop-address ] } [ preference preference | tag tag ] * track nqa admin-name test-name
[ description text ]

IPv4 static routes are associated with an NQA test instance.

NOTE

The destination address of an NQA test instance cannot be the destination address of
an associated static route.
If the static route associated with an NQA test instance is associated with another
NQA test instance, the static route is disassociated from the first NQA test instance.

----End

Checking the Configuration


After IPv4 static routes are associated with NAQ, run the following commands to
check the configuration.

● Run the display current-configuration | include nqa command to check the


configuration of association between static routes and NQA.
● Run the display nqa results [ collection ] [ test-instance admin-name test-
name ] command to check the NQA test result.
The NQA test result cannot be displayed automatically. You must run the
display nqa results command to view the NQA test result. By default, the
command output shows the results of the latest five NQA tests.

2.10 Configuring IPv6 Static Routes

Pre-configuration Tasks
Before configuring IPv6 static routes, complete the following task:

● Configuring link layer parameters and IPv6 addresses for interfaces to ensure
network-layer communication between neighbor nodes

Configuration Procedures
You can perform the following configuration tasks (excluding the task of Checking
the Configuration) in any sequence as required.

2.10.1 Creating IPv6 Static Routes

Context
When creating IPv6 static routes, you can specify both the outbound interface and
next hop. Alternatively, you can specify only the outbound interface or next hop
based on the outbound interface type.
● Specify the outbound interface for P2P interfaces.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 38


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

● Specify the next hop for NBMA interfaces.


● Specify the next hop address for broadcast interfaces. The next hop address
can be a link-local address. When the next hop address is a link-local address,
the outbound interface must be specified.
If you specify the same preference for IPv6 static routes to the same destination,
you can implement load balancing among these routes. If you specify different
preferences for the IPv6 static routes, you can implement route backup among the
routes.
If the destination IP address and mask are set to all 0s, an IPv6 static default route
is configured. By default, no IPv6 static default route is configured.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Configure IPv6 static routes.
● Run:
ipv6 route-static dest-ipv6-address prefix-length { interface-type interface-number [ nexthop-ipv6-
address ] | nexthop-ipv6-address } [ preference preference | tag tag ] * [ bfd enable | track { bfd-
session cfg-name | nqa admin-name test-name } ] [ description text ]
An IPv6 static route is configured on the public network.
● Run:
ipv6 route-static vpn-instance vpn-instance-name dest-ipv6-address prefix-length { [ interface-type
interface-number ] nexthop-ipv6-address | nexthop-ipv6-address [ public ] | vpn-instance vpn-
destination-name nexthop-ipv6-address } [ preference preference | tag tag ] * [ description text ]
An IPv6 static route is configured in a VPN instance.

----End

2.10.2 (Optional) Setting the Default Preference for IPv6


Static Routes
Context
The default preference of IPv6 static routes affects route selection. When an IPv6
static route is configured, the default preference is used if no preference is
specified for the static route.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
ipv6 route-static default-preference preference

The default preference of IPv6 static routes is set.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 39


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

By default, the preference of static routes is 60.

After the default preference is reconfigured, the new default preference is valid
only for new IPv6 static routes.

----End

2.10.3 Checking the Configuration

Procedure
● Run the display ipv6 routing-table command to check brief information
about the IPv6 routing table.
● Run the display ipv6 routing-table verbose command to check detailed
information about the IPv6 routing table.

----End

2.11 Configuration Examples

2.11.1 Example for Configuring IPv4 Static Routes

Networking Requirements
Hosts on different network segments are connected using several Routers. Each
two hosts on different network segments can communicate with each other
without using dynamic routing protocols.

Figure 2-7 Networking diagram of configuring IPv4 static routes

PC2
192.168.2.2/24

GE3/0/0
192.168.2.1/24
GE1/0/0 GE2/0/0
192.168.4.2/30 192.168.4.5/30
RouterB
RouterA RouterC
GE1/0/0 GE1/0/0
192.168.4.1/30 192.168.4.6/30
GE2/0/0 GE2/0/0
192.168.1.1/24 192.168.3.1/24

PC1 PC3
192.168.1.2/24 192.168.3.2/24

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 40


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure IPv4 addresses for interfaces so that directly-connected interfaces
can communicate with each other.
2. Configure the default IPv4 gateway on each host, and configure IPv4 static
routes and default routes on each Router so that hosts on different network
segments can communicate with each other.

Procedure
Step 1 Configure IP addresses for interfaces on each Router.
# Configure an IP address for each interface on RouterA. The configurations of
RouterB and RouterC are similar to the configuration of RouterA, and are not
mentioned here.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 192.168.4.1 30
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 192.168.1.1 24

Step 2 Configure static routes.


# Configure an IPv4 default route on RouterA.
[RouterA] ip route-static 0.0.0.0 0.0.0.0 192.168.4.2

# Configure two IPv4 static routes on RouterB.


[RouterB] ip route-static 192.168.1.0 255.255.255.0 192.168.4.1
[RouterB] ip route-static 192.168.3.0 255.255.255.0 192.168.4.6

# Configure an IPv4 default route on RouterC.


[RouterC] ip route-static 0.0.0.0 0.0.0.0 192.168.4.5

Step 3 Configure hosts.


Set default gateway addresses of PC1, PC2, and PC3 to 192.168.1.1, 192.168.2.1,
and 192.168.3.1 respectively.
Step 4 Verify the configuration.
# Check the IP routing table of RouterA.
[RouterA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cos Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 192.168.4.2 GigabitEthernet1/0/0
192.168.1.0/24 Direct 0 0 D 192.168.1.1 GigabitEthernet2/0/0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0
192.168.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0
192.168.4.1/30 Direct 0 0 D 192.168.4.1 GigabitEthernet1/0/0
192.168.4.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
192.168.4.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 41


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0


255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

# Run the ping command to verify the connectivity.


[RouterA] ping 192.168.3.1
PING 192.168.3.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.3.1: bytes=56 Sequence=1 ttl=254 time=62 ms
Reply from 192.168.3.1: bytes=56 Sequence=2 ttl=254 time=63 ms
Reply from 192.168.3.1: bytes=56 Sequence=3 ttl=254 time=63 ms
Reply from 192.168.3.1: bytes=56 Sequence=4 ttl=254 time=62 ms
Reply from 192.168.3.1: bytes=56 Sequence=5 ttl=254 time=62 ms
--- 192.168.3.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 62/62/63 ms

# Run the tracert command to verify the connectivity.


[RouterA] tracert 192.168.3.1
traceroute to 192.168.3.1(192.168.3.1), max hops: 30 ,packet length: 40,press CTRL_C to break
1 192.168.4.2 31 ms 32 ms 31 ms
2 192.168.4.6 62 ms 63 ms 62 ms

----End

Configuration Files
● Configuration file of RouterA
#
sysname RouterA
#
interface GigabitEthernet2/0/0
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet1/0/0
ip address 192.168.4.1 255.255.255.252
#
ip route-static 0.0.0.0 0.0.0.0 192.168.4.2
#
return

● Configuration file of RouterB


#
sysname RouterB
#
interface GigabitEthernet1/0/0
ip address 192.168.4.2 255.255.255.252
#
interface GigabitEthernet2/0/0
ip address 192.168.4.5 255.255.255.252
#
interface GigabitEthernet3/0/0
ip address 192.168.2.1 255.255.255.0
#
ip route-static 192.168.1.0 255.255.255.0 192.168.4.1
ip route-static 192.168.3.0 255.255.255.0 192.168.4.6
#
return

● Configuration file of RouterC


#
sysname RouterC
#
interface GigabitEthernet2/0/0
ip address 192.168.3.1 255.255.255.0
#

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 42


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

interface GigabitEthernet1/0/0
ip address 192.168.4.6 255.255.255.252
#
ip route-static 0.0.0.0 0.0.0.0 192.168.4.5
#
return

2.11.2 Example for Configuring IPv6 Static Routes


Networking Requirements
On an IPv6 network, hosts on different network segments are connected using
several Routers. Each two hosts on different network segments can communicate
with each other without using dynamic routing protocols.

Figure 2-8 Networking diagram of configuring IPv6 static routes


PC2
2::2/64

GE0/0/0
2::1/64
GE1/0/0 GE2/0/0
10::2/64 20::1/64
RouterB
GE1/0/0 GE1/0/0
10::1/64 20::2/64
RouterA RouterC

GE2/0/0 GE2/0/0
1::1/64 3::1/64

PC1 PC3
1::2/64 3::2/64

Configuration Roadmap
The configuration roadmap is as follows:

1. Configure IPv6 addresses for interfaces so that devices can communicate with
each other.
2. Configure the IPv6 default gateway on each host, and configure IPv6 static
routes and default routes on each Router so that hosts on different network
segments can communicate with each other.

Procedure
Step 1 Configure IPv6 addresses for interfaces on each Router.

# Configure IPv6 addresses for interfaces on RouterA.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 43


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] ipv6
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ipv6 enable
[RouterA-GigabitEthernet1/0/0] ipv6 address 10::1/64
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ipv6 enable
[RouterA-GigabitEthernet2/0/0] ipv6 address 1::1/64

The configurations of RouterB and RouterC are similar to the configuration of


RouterA, and are not mentioned here.
Step 2 Configure IPv6 static routes.
# Configure an IPv6 default route on RouterA.
[RouterA] ipv6 route-static :: 0 gigabitethernet 1/0/0 10::2

# Configure two IPv6 static routes on RouterB.


[RouterB] ipv6 route-static 1:: 64 gigabitethernet 1/0/0 10::1
[RouterB] ipv6 route-static 3:: 64 gigabitethernet 2/0/0 20::2

# Configure an IPv6 default route on RouterC.


[RouterC] ipv6 route-static :: 0 gigabitethernet 1/0/0 20::1

Step 3 Configure host addresses and gateways.


Configure IPv6 addresses for hosts according to the networking diagram, and set
default gateway addresses of PC1, PC2, and PC3 to 1::1, 2::1, and 3::1 respectively.
Step 4 Verify the configuration.
# Check the IPv6 routing table of RouterA.
[RouterA] display ipv6 routing-table
Routing Table : Public
Destinations : 5 Routes : 5

Destination : :: PrefixLength : 0
NextHop : 10::2 Preference : 60
Cost :0 Protocol : Static
RelayNextHop : :: TunnelID : 0x0
Interface : GigabitEthernet1/0/0 Flags :D

Destination : ::1 PrefixLength : 128


NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : InLoopBack0 Flags :D

Destination : 1:: PrefixLength : 64


NextHop : 1::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : GigabitEthernet2/0/0 Flags :D

Destination : 1::1 PrefixLength : 128


NextHop : ::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : GigabitEthernet2/0/0 Flags :D

Destination : FE80:: PrefixLength : 10


NextHop : :: Preference : 0
Cost :0 Protocol : Direct

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 44


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

RelayNextHop : :: TunnelID : 0x0


Interface : NULL0 Flags :D

# Run the ping command to verify the connectivity.


[RouterA] ping ipv6 3::1
PING 3::1 : 56 data bytes, press CTRL_C to break
Reply from 3::1
bytes=56 Sequence=1 hop limit=64 time = 63 ms
Reply from 3::1
bytes=56 Sequence=2 hop limit=64 time = 62 ms
Reply from 3::1
bytes=56 Sequence=3 hop limit=64 time = 62 ms
Reply from 3::1
bytes=56 Sequence=4 hop limit=64 time = 63 ms
Reply from 3::1
bytes=56 Sequence=5 hop limit=64 time = 63 ms
--- 3::1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 62/62/63 ms

# Run the tracert command to verify the connectivity.


[RouterA] tracert ipv6 3::1
traceroute to 3::1 30 hops max,60 bytes packet
1 10::2 11 ms 3 ms 4 ms
2 3::1 4 ms 3 ms 3 ms

----End

Configuration Files
● Configuration file of RouterA
#
sysname RouterA
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 10::1/64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 1::1/64
#
ipv6 route-static :: 0 GigabitEthernet1/0/0 10::2
#
return

● Configuration file of RouterB


#
sysname RouterB
#
ipv6
#
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 2::1/64
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 10::2/64
#
interface GigabitEthernet2/0/0
ipv6 enable

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 45


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

ipv6 address 20::1/64


#
ipv6 route-static 1:: 64 GigabitEthernet1/0/0 10::1
ipv6 route-static 3:: 64 GigabitEthernet2/0/0 20::2
#
return

● Configuration file of RouterC


#
sysname RouterC
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 20::2/64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 3::1/64
#
ipv6 route-static :: 0 GigabitEthernet1/0/0 20::1
#
return

2.11.3 Example for Configuring BFD for IPv4 Static Routes


Networking Requirements
As shown in Figure 2-9, RouterA is connected to RouterB through SwitchC. You
need to configure static routes on RouterA so that RouterA can communicate with
the external network. Link fault detection between RouterA and RouterB must be
at the millisecond level to improve convergence speed.

Figure 2-9 Networking diagram of configuring static BFD for IPv4 static routes
GE1/0/0 GE1/0/0 GE2/0/0
1.1.1.1/24 1.1.1.2/24 2.2.2.2/24
Internet

RouterA SwitchC RouterB

Configuration Roadmap
The configuration roadmap is as follows:

1. Configure IP addresses for interfaces so that devices can communicate with


each other.
2. Configure a BFD session between RouterA and RouterB.
3. Configure a default static route from RouterA to the external network and
bind the default static route to the BFD session. This configuration can
implement link fault detection at the millisecond level and improve
convergence speed of static routes.

Procedure
Step 1 Configure IP addresses for interfaces on each Router.

# Configure IP addresses for interfaces on RouterA.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 46


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 1.1.1.1 24
[RouterA-GigabitEthernet1/0/0] quit

The configuration of Router B is similar to the configuration of Router A, and is


not mentioned here.
Step 2 Configure a BFD session between RouterA and RouterB.
# Configure a BFD session on RouterA.
[RouterA] bfd
[RouterA-bfd] quit
[RouterA] bfd aa bind peer-ip 1.1.1.2
[RouterA-bfd-session-aa] discriminator local 10
[RouterA-bfd-session-aa] discriminator remote 20
[RouterA-bfd-session-aa] commit
[RouterA-bfd-session-aa] quit

# Configure a BFD session on RouterB.


[RouterB] bfd
[RouterB-bfd] quit
[RouterB] bfd bb bind peer-ip 1.1.1.1
[RouterB-bfd-session-bb] discriminator local 20
[RouterB-bfd-session-bb] discriminator remote 10
[RouterB-bfd-session-bb] commit
[RouterB-bfd-session-bb] quit

Step 3 Configure a default static route and bind it to a BFD session.


# Configure a default static route to the external network on RouterA and bind it
to a BFD session named aa.
[RouterA] ip route-static 0.0.0.0 0 1.1.1.2 track bfd-session aa

Step 4 Verify the configuration.


# After the configuration is complete, run the display bfd session all command
on RouterA and RouterB. The command output shows that a BFD session has
been established and is in Up state. Then, run the display current-configuration |
include bfd command in the system view. The command output shows that the
default static route has been bound to the BFD session.
Take the display on RouterA as an example.
[RouterA] display bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
10 20 1.1.1.2 Up S_IP_PEER -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0
[RouterA] display current-configuration | include bfd
bfd
bfd aa bind peer-ip 1.1.1.2
ip route-static 0.0.0.0 0.0.0.0 1.1.1.2 track bfd-session aa

# Check the IP routing table of RouterA. The command output shows that the
static route exists in the routing table.
[RouterA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 47


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 1.1.1.2 GigabitEthernet1/0/0
1.1.1.0/24 Direct 0 0 D 1.1.1.1 GigabitEthernet1/0/0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
1.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

# Run the shutdown command on GE1/0/0 of RouterB to simulate a link fault.


[RouterB] interface gigabitethernet 1/0/0
[RouterB-GigabitEthernet1/0/0] shutdown

# Check the IP routing table of RouterA. The command output shows that default
route 0.0.0.0/0 does not exist. This is because the default static route is bound to a
BFD session. When BFD detects a link fault, BFD rapidly notifies that the bound
static route becomes unavailable. If the static route is not bound to a BFD session,
the default route 0.0.0.0/0 will always exist in IP routing table; however, this may
cause traffic loss.
[RouterA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Direct 0 0 D 1.1.1.1 GigabitEthernet1/0/0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
1.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

----End

Configuration Files
● Configuration file of RouterA
#
sysname RouterA
#
bfd
#
interface GigabitEthernet1/0/0
ip address 1.1.1.1 255.255.255.0
#
bfd aa bind peer-ip 1.1.1.2
discriminator local 10
discriminator remote 20
commit
#
ip route-static 0.0.0.0 0.0.0.0 1.1.1.2 track bfd-session aa
#
return
● Configuration file of RouterB
sysname RouterB
#
bfd
#
interface GigabitEthernet1/0/0
ip address 1.1.1.2 255.255.255.0
#

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 48


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

interface GigabitEthernet2/0/0
ip address 2.2.2.2 255.255.255.0
#
bfd bb bind peer-ip 1.1.1.1
discriminator local 20
discriminator remote 10
commit
#
return

2.11.4 Example for Configuring NQA for IPv4 Static Routes


Networking Requirements
As shown in Figure 2-10, multiple static routes are configured on RouterA so that
packets can be forwarded from RouterA to users. To improve link reliability when
access switches do not support BFD, customers require that packets sent from
RouterA be transmitted along the primary link RouterA->RouterB->Switch->User
when the primary link is working properly. When the primary link fails, the packets
can be switched to the backup link RouterA->RouterC->Switch->User for
forwarding.

Figure 2-10 Networking diagram of configuring NQA for IPv4 static routes
RouterA

GE1/0/0 GE2/0/0
172.16.3.1/24 172.16.4.1/24

GE2/0/0 GE2/0/0
172.16.3.2/24 172.16.4.2/24
RouterB RouterC
/0 /0
GE1/0/0 GE 3 4 GE1/0/0
1 3/0 GE .1/2
172.16.1.1/24 72 / 0 . 6 172.16.2.1/24
.16 .16
.5. 1 72 V
1/2 17 L
4 2.1 ANI
6.5 F20
VLANIF10 .2/
0 24 VLANIF10
172.16.1.2/24 IF2 2/24 172.16.2.2/24
L AN 6.6.
V 2.1 ......
VALNIF30 17 VLANIF30
172.16.7.1/24 SwitchA SwitchB 172.16.8.1/24

...... ......

Client1 Client10 Client91 Client100

Primary link
Backup link

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 49


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

Configuration Roadmap
To improve link reliability, a link detection mechanism needs to be deployed on
the device to detect the link status in real time and then the detected link status is
associated with the route status. Access switches do not support BFD. You can
associate IPv4 static routes with NQA to meet this link reliability requirement. The
configuration roadmap is as follows:
1. On RouterA, RouterB, and RouterC, configure IP addresses for interfaces and
configure static routes to Client1 (Client1 is used to represent users). Two
static routes must be configured on RouterA, and the static route with next
hop RouterB must have a higher priority than the static route with next hop
RouterC so that packets sent from RouterA to Client1 can be transmitted
according to the two primary and backup static routes.
2. Configure an ICMP NQA test instance on the primary link from RouterA to
SwitchA and associate the static route of which the next hop is RouterB with
the ICMP NQA test instance to fast detect link faults for service switching.

NOTE

When a static route is associated with an NQA test instance, only ICMP test instances are
used to test whether there are reachable routes between the source and destination.

Procedure
Step 1 Configure IP addresses on Routers.
# Configure IP addresses for interfaces on RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitEthernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 172.16.3.1 24
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitEthernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 172.16.4.1 24
[RouterA-GigabitEthernet2/0/0] quit

The configurations of RouterB and RouterC are similar to the configuration of


RouterA, and are not mentioned here.
Step 2 Configure static routes from RouterA, RouterB, and RouterC to Client1.
# On RouterA, configure two static routes to Client1 and set the priority of the
static route with next hop RouterC to 100.
[RouterA] ip route-static 172.16.7.0 255.255.255.0 172.16.3.2
[RouterA] ip route-static 172.16.7.0 255.255.255.0 172.16.4.2 preference 100

# On RouterB, configure a static route to Client1.


[RouterB] ip route-static 172.16.7.0 255.255.255.0 172.16.1.2

# On RouterC, configure a static route to Client1.


[RouterC] ip route-static 172.16.7.0 255.255.255.0 172.16.6.2

Step 3 Configure an NQA test instance on RouterA to test the link between RouterA and
SwitchA.
[RouterA] nqa test-instance aa bb
[RouterA-nqa-aa-bb] test-type icmp

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 50


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

[RouterA-nqa-aa-bb] destination-address ipv4 172.16.1.2


[RouterA-nqa-aa-bb] frequency 5
[RouterA-nqa-aa-bb] probe-count 1
[RouterA-nqa-aa-bb] start now
[RouterA-nqa-aa-bb] quit

NOTE

If a link becomes faulty, the NQA test instance detects this fault and then the static routes
associated with the NQA test instance become Down. After the link recovers, the NQA test
instance attempts to send ICMP test packets over the static routes. Because these static
routes are still Down, the NQA test instance still fails to detect link connectivity. Traffic fails
to be forwarded. The nexthop ipv4 ip-address command configures a next hop address for
the NQA test packets, which ensures that the packets are forwarded when the link recovers
from the fault, and the static routes associated with the NQA test instance are Up.

Step 4 On RouterA, associate the static route of which the next hop is RouterB with the
NQA test instance.
[RouterA] ip route-static 172.16.7.0 255.255.255.0 172.16.3.2 track nqa aa bb

Step 5 Verify the configuration.


# After the configuration is complete, run the display current-configuration |
include nqa command in the system view on RouterA to check whether the static
route has been associated with the NQA test instance.
[RouterA] display current-configuration | include nqa
ip route-static 172.16.7.0 255.255.255.0 172.16.3.2 track nqa aa bb
nqa test-instance aa bb

# Run the display nqa results command on RouterA to check the NQA test
results. In this example, information "Lost packet ratio: 0 %" is displayed,
indicating that the link works properly.
[RouterA] display nqa results test-instance aa bb

NQA entry(aa, bb) :testflag is active ,testtype is icmp


1 . Test 1987 result The test is finished
Send operation times: 1 Receive response times: 1
Completion:success RTD OverThresholds number: 0
Attempts number:1 Drop operation number:0
Disconnect operation number:0 Operation timeout number:0
System busy operation number:0 Connection fail number:0
Operation sequence errors number:0 RTT Status errors number:0
Destination ip address:172.16.1.2
Min/Max/Average Completion Time: 120/120/120
Sum/Square-Sum Completion Time: 120/14400
Last Good Probe Time: 2012-01-06 19:14:57.5
Lost packet ratio: 0 %

# Check the routing table on RouterA. The routing table contains a static route
with the next hop 172.16.3.2.
[RouterA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11

Destination/Mask Proto Pre Cost Flags NextHop Interface

127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0


127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.16.3.0/24 Direct 0 0 D 172.16.3.1 GigabitEthernet1/0/0
172.16.3.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
172.16.3.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 51


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

172.16.4.0/24 Direct 0 0 D 172.16.4.1 GigabitEthernet2/0/0


172.16.4.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0
172.16.4.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0
172.16.7.0/24 Static 60 0 D 172.16.3.2 GigabitEthernet1/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

The routing table contains a route destined for 172.16.7.0/24 with next hop
172.16.3.2. Therefore, traffic travels along the primary link.
# Shut down GE1/0/0 on RouterB to simulate a link fault.
[RouterB] interface GigabitEthernet 1/0/0
[RouterB-GigabitEthernet1/0/0] shutdown
[RouterB-GigabitEthernet1/0/0] quit

# Check the NQA test results. Information "Lost packet ratio: 100 %" is displayed,
indicating that the link fails.
[RouterA] display nqa results test-instance aa bb

NQA entry(aa, bb) :testflag is active ,testtype is icmp


1 . Test 2086 result The test is finished
Send operation times: 1 Receive response times: 0
Completion:failed RTD OverThresholds number: 0
Attempts number:1 Drop operation number:1
Disconnect operation number:0 Operation timeout number:0
System busy operation number:0 Connection fail number:0
Operation sequence errors number:0 RTT Status errors number:0
Destination ip address:172.16.1.2
Min/Max/Average Completion Time: 0/0/0
Sum/Square-Sum Completion Time: 0/0
Last Good Probe Time: 0000-00-00 00:00:00.0
Lost packet ratio: 100 %

# Check the routing table on RouterA.


[RouterA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11

Destination/Mask Proto Pre Cost Flags NextHop Interface

127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0


127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.16.3.0/24 Direct 0 0 D 172.16.3.1 GigabitEthernet1/0/0
172.16.3.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
172.16.3.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
172.16.4.0/24 Direct 0 0 D 172.16.4.1 GigabitEthernet2/0/0
172.16.4.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0
172.16.4.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0
172.16.7.0/24 Static 100 0 D 172.16.4.2 GigabitEthernet2/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

The command output shows that the next hop of the route to destination network
segment 172.16.7.0/24 is 172.16.4.2. After NQA detects that primary link fails,
NQA notifies RouterA that the static route to 172.16.7.0/24 becomes unavailable.
Packets are then switched to the backup link for forwarding.

----End

Configuration Files
● Configuration file of RouterA
#

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 52


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

sysname RouterA
#
interface GigabitEthernet1/0/0
ip address 172.16.3.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.16.4.1 255.255.255.0
#
ip route-static 172.16.7.0 255.255.255.0 172.16.3.2 track nqa aa bb
ip route-static 172.16.7.0 255.255.255.0 172.16.4.2 preference 100
#
nqa test-instance aa bb
test-type icmp
destination-address ipv4 172.16.1.2
frequency 5
probe-count 1
start now
#
return

● Configuration file of RouterB


#
sysname RouterB
#
interface GigabitEthernet1/0/0
ip address 172.16.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.16.3.2 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 172.16.5.1 255.255.255.0
#
ip route-static 172.16.7.0 255.255.255.0 172.16.1.2
#
return

● Configuration file of RouterC


#
sysname RouterC
#
interface GigabitEthernet1/0/0
ip address 172.16.2.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.16.4.2 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 172.16.6.1 255.255.255.0
#
ip route-static 172.16.7.0 255.255.255.0 172.16.6.2
#
return

2.12 FAQ
This section provides the questions you may encounter during configuration and
their answers.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 53


Huawei AR Series Access Routers
CLI-based Configuration Guide - IP Unicast Routing 2 Static Route Configuration

2.12.1 Is the Static Route Affected If the BFD for the Static
Route is in AdminDown State?
The static route is not affected. The static route is invalid only when the BFD
detects a link fault.

Issue 09 (2020-12-21) Copyright © Huawei Technologies Co., Ltd. 54

You might also like