0% found this document useful (0 votes)
78 views43 pages

01-03 Static Route Configuration

Uploaded by

sss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views43 pages

01-03 Static Route Configuration

Uploaded by

sss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

S1720, S2700, S5700, and S6720 Series Ethernet

Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

3 Static Route Configuration

About This Chapter

This chapter describes the functions, purposes, and applications of static routes,
and explains how they can be configured.
3.1 Overview of Static Routes
3.2 Understanding Static Routes
3.3 Application Scenarios for Static Routes
3.4 Summary of Static Route Configuration Tasks
3.5 Default Settings for Static Routes
3.6 Configuring IPv4 Static Routes
3.7 Configuring Static BFD for IPv4 Static Routes
3.8 Associating IPv4 Static Routes with NQA
3.9 Associating IPv4 Static Routes with EFM
3.10 Configuring IPv6 Static Routes
3.11 Configuring Static BFD for IPv6 Static Routes
3.12 Configuration Examples for Static Routes

3.1 Overview of Static Routes

Definition
A static route is a fixed route that allows network traffic to reach its target
destination. Typically, static routes are manually configured by network
administrators.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 22


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 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 that bandwidth is available for
important applications.
● Static routes can be associated with VPN instances to manage VPN routes.

3.2 Understanding Static Routes

3.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.

In contrast to dynamic routing, static routing is easier to configure, has higher


controllability, uses less bandwidth, and does 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. Therefore, static routes are not
suitable for large and complex networks. In addition, it is difficult for network
administrators to know the entire network topology. When the network topology
or link state changes, a large amount of static routing information of routers
needs to be adjusted, which is a laborious.

A static route has five parameters: destination IP address, mask, outbound


interface, next-hop IP address, and preference.

Destination Address and Mask


The IPv4 destination 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 IPv6 destination address and mask of a static
route, see IPv6 Addresses in "Basic IPv6 Configuration" in the S1720, S2700, S5700,
and S6720 V200R011C10 Configuration Guide - IP Service. Setting the destination
and mask to all 0s configures a default static route. For details about a default
static route, see 3.3.2 Default Static 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, specify an outbound interface. This


automatically sets the IP address of the remote interface connected to the
outbound interface as the next-hop address.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 23


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

● For non-broadcast multiple access (NBMA) interfaces such as Asynchronous


Transfer Mode (ATM) interfaces, specify a next-hop IP address. This type of
interface supports point-to-multipoint (P2MP) networks, which require
mappings between IP addresses and link-layer addresses to be configured.
Therefore, during the configuration of static routes, only a next-hop IP
address needs to be specified, and no outbound interface needs to be
specified.
● For broadcast interfaces (such as Ethernet interfaces), specify a next-hop IP
address. Ethernet interfaces are broadcast interfaces. If an Ethernet 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 have different preference values configured. 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 3.3.1 Load Balancing and Route Backup.

3.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 Understanding BFD in "BFD Configuration" in the
S1720, S2700, S5700, and S6720 V200R011C10 Configuration Guide - Reliability.

3.2.3 NQA for Static Routes


As mentioned previously, static routes do not have a dedicated fault detection
mechanism. If a fault occurs on a non-directly connected link, 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.

This problem requires an effective solution to detect faults in links for static
routes. BFD for static routes is applicable only in situations where both
communicating devices support it. However, if either of the two communicating

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 24


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

devices supports Network Quality Analysis (NQA), NQA for static routes can be
used to detect faults.
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.
Based on the NQA test result, the system can determine an optimal route in time
to prevent communication interruptions and ensure service quality. NQA for static
routes works as follows:
● 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 detects that the link has recovered, the system sets the static route to
active. The route becomes available and is re-added to the IP routing table.
For details about NQA, see NQA Configuration in the S1720, S2700, S5700, and
S6720 V200R011C10 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 the source and destination can be reached through routes.
Each static route can be associated with only one NQA test instance.

Applications
On the network shown in Figure 3-1, access switches connect to users. Because
dynamic routing protocols are not available for communication between RouterB
and users, static routes are configured on RouterB. To make the network more
stable, RouterC is configured with static routes to the same destination as
RouterB, providing route backup. 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 configured
for these static routes. After configuration is complete, RouterA can use the
dynamic routing protocol to learn from RouterB and RouterC the routes to users.
RouterA uses the link associated with the static route with the lower cost as the
active link, and the other link as the standby link.
NQA for static routes is also configured on RouterB. NQA tests are performed to
check the active link of RouterB → SwitchA → SwitchC → SwitchD. If the active
link fails, the static route is deleted from the routing table, and traffic diverts to
the standby link of RouterC → SwitchB → SwitchC → SwitchD. If both links are
working properly, traffic travels along the active link.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 25


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Figure 3-1 NQA for static routes

IP Network

RouterA
RouterB RouterC

SwitchA SwitchB

SwitchC SwitchD

Client1 Client2 Client3 Client4

3.2.4 Permanent Advertisement of Static Routes


Link connectivity determines the stability and availability of a network. Therefore,
link detection plays an important role in network maintenance. BFD cannot be
used for link detection in all scenarios. For example, a simpler method is required
for link detection between different ISPs.

Permanent advertisement of static routes provides a simple, low-cost link


detection mechanism and improves compatibility between Huawei 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 link connectivity.

When permanent advertisement of static routes is configured, static routes that


cannot be advertised are still preferred and added to the routing table in the
following cases:

● 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 addition, you also need to control the priority and prefix length of a static route
to enable ping packets to always be forwarded through this static route. The

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 26


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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 3-2, border routers BR1, BR2, and BR3 belong to ISP1, ISP2, and ISP3
respectively. There are two links between BR1 and BR2, Link A and Link B.
However, ISP1 requires that service traffic be forwarded to ISP2 over Link A
without traveling through ISP3.

Figure 3-2 Permanent advertisement of static routes

ISP2
BR2
10.1.1.2/24

LinkA

BR1
ISP1
LinkB BR3
ISP3

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


between BR1 and BR2, making them BGP peers. For service monitoring purposes,
a static route destined for BR2 at 10.1.1.2/24 is configured on BR1, and permanent
advertisement of static routes is enabled on BR1. The interface that connects BR1
to BR2 is specified as the outbound interface of the static route. The network
monitoring system periodically pings 10.1.1.2 to determine the status of Link A.

If Link A is working properly, BR1 forwards ping packets over Link A. If Link A
becomes faulty, the static route is still preferred because permanent advertisement
of static routes is enabled, despite the fact that service traffic can reach BR2 over
Link B. BR1 still attempts to forward ping packets over Link A, but fails. This
scenario also applies to BGP packets, resulting in a link fault that interrupts the
BGP peer relationship. The monitoring system detects service faults as returned in
the ping result and prompts maintenance engineers to rectify the faults before
services are affected.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 27


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

3.3 Application Scenarios for Static Routes

3.3.1 Load Balancing and Route Backup


Load Balancing Among Static Routes
To implement load balancing, set the same preference value for different routes to
the same destination, as shown in Figure 3-3.

Figure 3-3 Load balancing among static routes


SwitchB

Preference=60

Preference=60
SwitchA SwitchC

SwitchD

Both static routes from SwitchA to SwitchC have a preference value of 60 and are
stored in the routing table.

Route Backup
To implement route backup, set different preference values for different routes to
the same destination, as shown in Figure 3-4.

Figure 3-4 Route backup


SwitchB

Preference=60

Preference=100
SwitchA SwitchC

SwitchD

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 28


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

There are two static routes with different preference values from SwitchA to
SwitchC. Static route B with next hop SwitchB has a smaller value, which signifies
a higher preference. The link associated with static route B functions as the active
link. Static route D with next hop SwitchD has a lower preference. The link
associated with static route D functions as the standby link, providing link backup
if a fault occurs on the active link.
● In normal situations, the link associated with static route B is the active link.
Static route B is included in the routing table and is used to forward data.
Static route D is not included in the routing table and is not used to forward
data.
● If a fault occurs on the active link, static route B is deleted from the routing
table. Static route D is added to the routing table and is used to forward data.
● When the fault on the active link is resolved, static route B is reactivated, and
is once again used to forward data. Static route D is deleted from the routing
table and functions as the backup route.
● Static routes used for backup are also known as floating static routes.

3.3.2 Default Static Route


A default route is a route with the destination IP address set to all 0s. It can be
automatically generated using a routing protocol or manually configured.
Manually configured default routes are called default static routes. Using default
static routes can simplify network configuration. If the destination address of a
packet does not match any entries in a router's routing table, the switch forwards
the packet along the default route instead.

Figure 3-5 Default static routes

2 SwitchB 4

1 5

SwitchA SwitchC

In Figure 3-5, if no default static route is configured, static routes destined for
networks 3, 4, and 5 must be configured on SwitchA, static routes destined for
networks 1 and 5 must be configured on SwitchB, and static routes destined for
networks 1, 2, and 3 must be configured on SwitchC. Once all of these static
routes are configured, SwitchA, SwitchB, and SwitchC can communicate with each
other.
The next hop of packets sent by SwitchA to networks 3, 4, and 5 is SwitchB.
Therefore, configuring a single default route on SwitchA can replace the three
static routes destined for networks 3, 4, and 5. Similarly, configuring a single

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 29


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

default route from SwitchC to SwitchB can replace the three static routes destined
for networks 1, 2, and 3.

3.4 Summary of Static Route Configuration Tasks


You can accurately control route selection on a network by configuring static
routes. If static route functions other than route selection control are required,
configure them according to reference sections. Table 3-1 describes static route
configuration tasks.

Table 3-1 Static route configuration tasks

Scenario Description Task

Configuring static routes Static routes are ● 3.6 Configuring IPv4


manually configured by Static Routes
administrators to ensure ● 3.10 Configuring
normal operations of IPv6 Static Routes
simple networks and
required bandwidth for
important network
applications.

Configuring fault In actual networking, ● 3.7 Configuring


detection protocols for static routes are Static BFD for IPv4
static routes associated with fault Static Routes
detection protocols to ● 3.8 Associating IPv4
improve network Static Routes with
performance. NQA
● 3.9 Associating IPv4
Static Routes with
EFM

3.5 Default Settings for Static Routes


Table 3-2 describes the default settings for static routes.

Table 3-2 Default settings for static routes

Parameter Default Setting

Preference of static routes 60

3.6 Configuring IPv4 Static Routes

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 30


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Pre-configuration Tasks
Before configuring IPv4 static routes, configure link layer parameters and IP
addresses for interfaces to ensure network-layer communication between
neighbor nodes.

Configuration Procedure
You can perform the following configuration tasks (excluding the task of Verifying
the IPv4 Static Route Configuration) in any sequence as required.

3.6.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,
depending on the interface type:
● For point-to-point (P2P) interfaces, specify the outbound interface.
● For non-broadcast multiple access (NBMA) interfaces, specify the next hop.
● For broadcast interfaces (for example, Ethernet interfaces), specify the next
hop.

Specifying the same preference value for static routes to the same destination
implements load balancing among these routes. Conversely, specifying different
preference values for static routes to the same destination implements route
backup among the routes.

Setting the destination IP address and mask to all 0s configures the default IPv4
static route. By default, no default IPv4 static route is configured.

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 ]
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 ]
An IPv4 static route is configured on a VPN instance.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 31


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

NOTE

To implement load balancing among an Ethernet interface's static route and other static
routes, configure the outbound interface and next hop.
Only the S6720EI, S6720S-EI, S5720HI, S5720EI, S6720SI, S6720S-SI, S5730SI, S5730S-EI,
S5720SI, S5720S-SI, S6720LI, S6720S-LI, S5720LI, S5720S-LI, S2720EI, S1720X-E, S1720GW-
E, S1720GWR-E, S1720GW, S1720GWR, S1720X support commands with the vpn-instance
parameter.

----End

3.6.2 (Optional) Setting the Default Preference Value for IPv4


Static Routes

Context
The default preference value of IPv4 static routes affects route selection. When an
IPv4 static route is configured without specifying a preference value, the default
preference value is used.

Procedure
Step 1 Run system-view

The system view is displayed.

Step 2 Run ip route-static default-preference preference

The default preference value of static routes is set.

The default preference value of static routes is initially set to 60.

NOTE

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

----End

3.6.3 (Optional) Configuring Permanent Advertisement of


IPv4 Static Routes

Context
Link connectivity directly affects network stability and availability. Monitoring link
status is an important part of network maintenance. If service traffic needs to be
forwarded along a specified path, you can monitor the status of the path by
pinging the destination addresses of static routes. In this manner, you can monitor
services at a very low cost.

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.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 32


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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.

NOTE

Only the S6720EI, S6720S-EI, S5720HI, S5720EI, S6720SI, S6720S-SI, S5730SI, S5730S-EI,
S5720SI, S5720S-SI, S6720LI, S6720S-LI, S5720LI, S5720S-LI, S2720EI, S1720X-E, S1720GW-
E, S1720GWR-E, S1720GW, S1720GWR, S1720X support the vpn-instance vpn-instance-
name parameter.

----End

3.6.4 (Optional) Preventing a Static Route from Being


Selected If the Associated BFD Session Is in AdminDown State

Context
If the BFD session associated with a static route on the switch is in AdminDown
state, you can configure the switch not to select the static route. This ensures that
the switch can work together with non-Huawei devices.

By default, a static route can still be selected by the switch even if the BFD session
associated with it is in AdminDown state. However, this is not the case for non-
Huawei devices. As a result, the switch cannot interwork with non-Huawei devices.

To address this problem, run the ip route-static track bfd-session admindown


invalid command to configure the switch not to select the static route if the
associated BFD session is in AdminDown state.

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 switch is configured not to select the static route if the associated BFD session
is in AdminDown state.

By default, a static route can still be selected by the switch even if the associated
BFD session is in AdminDown state.

----End

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 33


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

3.6.5 (Optional) Preventing Static Routes from Being Iterated


to a Blackhole Route

Context
If a link failure occurs on a network with IGP (OSPF for example), static, and
blackhole routes, static routes may be iterated to a blackhole route to remain
active. Static routes are preferentially selected over OSPF routes because they have
a higher priority. Although active, the static routes are unreachable because they
have been iterated to a blackhole route, resulting in service interruptions.

To address this problem, prevent static routes from being iterated to a blackhole
route so that OSPF routes will 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 are prevented from being iterated to a blackhole route.

By default, static routes can be iterated to a blackhole route.

----End

3.6.6 Verifying the IPv4 Static Route 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

3.7 Configuring Static BFD for IPv4 Static Routes

Pre-configuration Tasks
Before configuring static BFD for IPv4 static routes, complete the following tasks:

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


network-layer communication between neighbor nodes.
● Configure a BFD session.
For details, see BFD Configuration in the S1720, S2700, S5700, and S6720
V200R011C10 Configuration Guide - Reliability.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 34


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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 ]

An IPv4 static route on a public network is associated with a BFD session.

NOTE

Only the S6720EI, S6720S-EI, S5720HI, S5720EI, S6720SI, S6720S-SI, S5730SI, S5730S-EI,
S5720SI, and S5720S-SI support BFD for IPv4 static routes.
Before associating a static route with a BFD session, ensure that the BFD session and static
route are on the same link.
BFD Echo function can be associated with the a static route.
When a BFD session is associated with VRRP or a static route, by default, the system does
not allow the associated BFD session to be deleted. To delete the associated BFD session,
run the bfd session nonexistent-config-check disable command to prevent the device
from checking whether the associated BFD session is deleted. Note that deleting the BFD
session will prevent the configured association function from being implemented.

----End

Verifying the Configuration


Run the following command to verify the previous configuration.

● Run the display bfd session all [ verbose ] command to check information
about the BFD session.

3.8 Associating IPv4 Static Routes with NQA

Pre-configuration Tasks
Before associating IPv4 static routes with NQA, configure link layer parameters for
interfaces to ensure that the link layer protocol status 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 its view is displayed.


3. Run test-type icmp

The test type is set to ICMP.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 35


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 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, and 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 be used to configure an NQA test instance to start
immediately, at a specified time, or after a specified delay period. 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 starts 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 will start 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 will start after a specified delay period.
8. Run quit

Return to the system view.

Step 2 Associate static routes with an NQA test instance.


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.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 36


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

NOTE

The destination address of an NQA test instance cannot be the destination address of
an associated static route.
If the static route to be associated with an NQA test instance is already associated
with a different NQA test instance, the static route is disassociated from the first NQA
test instance once it becomes associated with the new NQA test instance.

----End

Verifying the Configuration


Once IPv4 static routes are associated with NQA, run the following commands to
verify 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.

3.9 Associating IPv4 Static Routes with EFM


Background
EFM for static routes can be configured to provide a fault detection mechanism
for static routes so that the static routes can detect the link quality changes in real
time and switch services immediately. You can associate Ethernet in the First Mile
(EFM) with an IPv4 static route so that the associated static route can be deleted
from the IP routing table when the EFM session of a specified interface goes
Down. Traffic is then switched to a route without link faults to prevent lengthy
service interruptions.

Pre-configuration Tasks
Before associating IPv4 static routes with EFM, set link layer protocol parameters
and assign IP addresses to interfaces to ensure that the link layer protocol status
of the interfaces is Up.

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 ]
track efm-state interface-type interface-number [ description text ]
EFM is associated with the IPv4 static route.

----End

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 37


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Verifying the Configuration


● Run the display efm session { all | interface interface-type interface-number
command to check information about EFM OAM on a specified interface.
● Run the display current-configuration | include efm command to check
associations between EFM and IPv4 static routes.

3.10 Configuring IPv6 Static Routes

Pre-configuration Tasks
Before configuring IPv6 static routes, configure link layer parameters and IPv6
addresses for interfaces to ensure network-layer communication between
neighbor nodes.

Configuration Procedure
You can perform the following configuration tasks (excluding the task of Verifying
the IPv6 Static Route Configuration) in any sequence as required.

3.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,
depending on the interface type:
● For point-to-point (P2P) interfaces, specify the outbound interface.
● For non-broadcast multiple access (NBMA) interfaces, specify the next hop.
● For broadcast interfaces, specify the next-hop address. If a link-local address is
specified as the next-hop address, you must also specify the outbound
interface.
Specifying the same preference value for IPv6 static routes to the same destination
implements load balancing among these routes. Conversely, specifying different
preference values for IPv6 static routes to the same destination implements route
backup among the routes.
Setting the destination IP address and mask to all 0s configures the default IPv6
static route. By default, no default IPv6 static 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 ] * [ description text ]

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 38


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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 on a VPN instance.
NOTE

To implement load balancing among an Ethernet interface's static route and other static
routes, configure the outbound interface and next hop.
Only the S6720EI, S6720S-EI, S5720HI, S5720EI, S6720SI, S6720S-SI, S5730SI, S5730S-EI,
S5720SI, S5720S-SI, S6720LI, S6720S-LI, S5720LI, S5720S-LI, S2720EI, S1720X-E, S1720GW-
E, S1720GWR-E, S1720GW, S1720GWR, S1720X support commands with the vpn-instance
vpn-instance-name parameter.

----End

3.10.2 (Optional) Setting the Default Preference Value for


IPv6 Static Routes
Context
The default preference value of IPv6 static routes affects route selection. When an
IPv6 static route is configured without specifying a preference value, the default
preference value is used.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ipv6 route-static default-preference preference
The default preference value of IPv6 static routes is set.
The default preference value of static routes is initially set to 60.
After the default preference value is reconfigured, the new default preference
value is valid only for new IPv6 static routes.

----End

3.10.3 Verifying the IPv6 Static Route 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

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 39


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

3.11 Configuring Static BFD for IPv6 Static Routes

Usage Scenario
To use BFD sessions to provide link detection for IPv6 static routes, you can bind
IPv6 static routes to BFD sessions. One IPv6 static route can be bound to one BFD
session.
Optimal IPv6 static routes are delivered to the forwarding table for packet
forwarding. However, IPv6 static routes cannot detect the status of the link to the
next hop. You can bind IPv6 static routes to BFD sessions. A BFD session can fast
detect changes over a link and inform the routing management system of the
changes. The routing management system immediately deletes the static route
that is bound to the BFD session from the forwarding table and recalculates
another active route. In this manner, fast route convergence is implemented.

Pre-configuration Tasks
Before configuring static BFD for IPv6 static routes, complete the following tasks:
● Configure link layer protocol parameters and IP addresses for interfaces and
ensure that the link layer protocol of the interfaces is Up.
● Configure a BFD session. For details, see BFD Configuration in the S1720,
S2700, S5700, and S6720 V200R011C10 Configuration Guide - Reliability.
.

Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ipv6 route-static dest-ipv6-address prefix-length { interface-type interface-
number [ nexthop-ipv6-address ] | nexthop-ipv6-address | vpn-instance vpn-
destination-name nexthop-ipv6-address } [ preference preference | tag tag ] *
[ track bfd-session cfg-name ] [ description text ]
A BFD session is bound to an IPv6 static route.

NOTE

Only the S6720EI, S6720S-EI, S5720HI, S5720EI, S6720SI, S6720S-SI, S5730SI, S5730S-EI,
S5720SI, and S5720S-SI support static BFD for IPv6 static routes.
Before associating a static route with a BFD session, ensure that the BFD session and static
route are on the same link.
When a BFD session is associated with VRRP or a static route, the system does not allow
the associated BFD session to be deleted by default. To delete the associated BFD session,
run the bfd session nonexistent-config-check disable command to prevent the device
from checking whether the associated BFD session is deleted. However, deleting the BFD
session will prevent the configured association function from being implemented.

----End

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 40


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Verifying the Configuration


Run the following commands to check the previous configuration.

Information about a BFD session can be viewed only after parameters of the BFD
session are set and the BFD session is established.

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


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

3.12 Configuration Examples for Static Routes

3.12.1 Example for Configuring IPv4 Static Routes

Networking Requirements
In Figure 3-6, PC1, PC2, and PC3 are on different network segments, and are
connected through SwitchA, SwitchB, and SwitchC. Any two PCs must be
connected using static routes to communicate with each other without using
dynamic routing protocols.

Figure 3-6 Configuring IPv4 static routes


PC2
10.1.2.2/24

GE0/0/3
VLANIF40
10.1.2.1/24
GE0/0/1 GE0/0/2
VLANIF10 VLANIF20
10.1.4.2/30 10.1.4.5/30
SwitchB
SwitchA SwitchC
GE0/0/1 GE0/0/1
VLANIF10 VLANIF20
10.1.4.1/30 10.1.4.6/30
GE0/0/2 GE0/0/2
VLANIF30 VLANIF50
10.1.1.1/24 10.1.3.1/24

PC1 PC3
10.1.1.2/24 10.1.3.2/24

Configuration Roadmap
The configuration roadmap is as follows:

1. Create VLANs, add interfaces to VLANs, and assign IPv4 addresses to VLANIF
interfaces so that neighboring devices can communicate with each other.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 41


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

2. Configure an IPv4 default gateway on each PC, and configure IPv4 static
routes or default static routes on each Switch so that any two PCs on
different network segments can communicate with each other.

Procedure
Step 1 Create VLANs and add interfaces to the VLANs.
# Configure SwitchA. The configurations of SwitchB and SwitchC are similar to the
configuration of SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 10 30
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type access
[SwitchA-GigabitEthernet0/0/2] port default vlan 30
[SwitchA-GigabitEthernet0/0/2] quit

Step 2 Assign IPv4 addresses to VLANIF interfaces.


# Configure SwitchA. The configurations of SwitchB and SwitchC are similar to the
configuration of SwitchA.
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 10.1.4.1 30
[SwitchA-Vlanif10] quit
[SwitchA] interface vlanif 30
[SwitchA-Vlanif30] ip address 10.1.1.1 24
[SwitchA-Vlanif30] quit

Step 3 Configure PCs.


Set the default gateway addresses of PC1, PC2, and PC3 to 10.1.1.1, 10.1.2.1, and
10.1.3.1 respectively.
Step 4 Configure IPv4 static routes.
# Configure a default IPv4 static route on SwitchA.
[SwitchA] ip route-static 0.0.0.0 0.0.0.0 10.1.4.2

# Configure two IPv4 static routes on SwitchB.


[SwitchB] ip route-static 10.1.1.0 255.255.255.0 10.1.4.1
[SwitchB] ip route-static 10.1.3.0 255.255.255.0 10.1.4.6

# Configure a default IPv4 static route on SwitchC.


[SwitchC] ip route-static 0.0.0.0 0.0.0.0 10.1.4.5

Step 5 Verify the configuration.


# Check the IP routing table on SwitchA.
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7

Destination/Mask Proto Pre Cost Flags NextHop Interface

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 42


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

0.0.0.0/0 Static 60 0 RD 10.1.4.2 Vlanif10


10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif30
10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif30
10.1.4.0/30 Direct 0 0 D 10.1.4.1 Vlanif10
10.1.4.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
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

# Run the ping command to verify the connectivity.


[SwitchA] ping 10.1.3.1
PING 10.1.3.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.3.1: bytes=56 Sequence=1 ttl=253 time=62 ms
Reply from 10.1.3.1: bytes=56 Sequence=2 ttl=253 time=63 ms
Reply from 10.1.3.1: bytes=56 Sequence=3 ttl=253 time=63 ms
Reply from 10.1.3.1: bytes=56 Sequence=4 ttl=253 time=62 ms
Reply from 10.1.3.1: bytes=56 Sequence=5 ttl=253 time=62 ms

--- 10.1.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.


[SwitchA] tracert 10.1.3.1
traceroute to 10.1.3.1(10.1.3.1), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.1.4.2 31 ms 32 ms 31 ms
2 10.1.3.1 62 ms 63 ms 62 ms

----End

Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 10 30
#
interface Vlanif10
ip address 10.1.4.1 255.255.255.252
#
interface Vlanif30
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 30
#
ip route-static 0.0.0.0 0.0.0.0 10.1.4.2
#
return

● SwitchB configuration file


#
sysname SwitchB
#
vlan batch 10 20 40
#
interface Vlanif10
ip address 10.1.4.2 255.255.255.252

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 43


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

#
interface Vlanif20
ip address 10.1.4.5 255.255.255.252
#
interface Vlanif40
ip address 10.1.2.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 40
#
ip route-static 10.1.1.0 255.255.255.0 10.1.4.1
ip route-static 10.1.3.0 255.255.255.0 10.1.4.6
#
return
● SwitchC configuration file
#
sysname SwitchC
#
vlan batch 20 50
#
interface Vlanif20
ip address 10.1.4.6 255.255.255.252
#
interface Vlanif50
ip address 10.1.3.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 50
#
ip route-static 0.0.0.0 0.0.0.0 10.1.4.5
#
return

Relevant Information
Video
How to Configure a Static Route
How to Configure a Default Route
How to Configure a Floating Static Route

3.12.2 Example for Configuring IPv6 Static Routes


Networking requirements
Figure 3-7 shows an IPv6 network. PC1, PC2, and PC3 are on different network
segments, and are connected through SwitchA, SwitchB, and SwitchC. Any two PCs
must be connected using static routes to communicate with each other without
using dynamic routing protocols.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 44


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Figure 3-7 Configuring IPv6 static routes

PC2
FC00:0:0:2002::2/64
GE0/0/3
VLANIF30
GE0/0/1 FC00:0:0:2002::1/64
VLANIF20 GE0/0/2
FC00:0:0:2010::2/64 VLANIF40
FC00:0:0:2020::1/64

SwitchA SwitchB
SwitchC
GE0/0/1 GE0/0/1
VLANIF20
VLANIF40
FC00:0:0:2010::1/64 FC00:0:0:2020::2/64
GE0/0/2 GE0/0/2
VLANIF10 VLANIF50
FC00:0:0:2001::1/64 FC00:0:0:2003::1/64
PC1 PC3
FC00:0:0:2001::2/64 FC00:0:0:2003::2/64

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs, add interfaces to the VLANs, and assign IPv6 addresses to
VLANIF interfaces so that neighboring devices can communicate with each
other.
2. Configure an IPv6 default gateway on each PC, and configure IPv6 static
routes or default static routes on each Switch so that any two PCs on
different network segments can communicate with each other.

Procedure
Step 1 Add interfaces to VLANs.
# Configure SwitchA. The configurations of SwitchB and SwitchC are similar to the
configuration of SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 10 20
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 20
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type access
[SwitchA-GigabitEthernet0/0/2] port default vlan 10
[SwitchA-GigabitEthernet0/0/2] quit

Step 2 Assign IPv6 addresses to VLANIF interfaces.


# Configure SwitchA. The configurations of SwitchB and SwitchC are similar to the
configuration of SwitchA.
[SwitchA] ipv6
[SwitchA] interface vlanif 10

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 45


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

[SwitchA-Vlanif10] ipv6 enable


[SwitchA-Vlanif10] ipv6 address fc00:0:0:2001::1/64
[SwitchA-Vlanif10] quit
[SwitchA] interface vlanif 20
[SwitchA-Vlanif20] ipv6 enable
[SwitchA-Vlanif20] ipv6 address fc00:0:0:2010::1/64
[SwitchA-Vlanif20] quit

Step 3 Configure IPv6 addresses for the PCs and default gateway addresses.
Assign IPv6 addresses to the PCs, and set the default gateway address of PC1, PC2,
and PC3 to fc00:0:0:2001::1, fc00:0:0:2002::1, and fc00:0:0:2003::1 respectively.
Step 4 Configure IPv6 static routes.
# Configure a default IPv6 static route on SwitchA.
[SwitchA] ipv6 route-static :: 0 vlanif20 fc00:0:0:2010::2

# Configure two IPv6 static routes on SwitchB.


[SwitchB] ipv6 route-static fc00:0:0:2001:: 64 vlanif20 fc00:0:0:2010::1
[SwitchB] ipv6 route-static fc00:0:0:2003:: 64 vlanif40 fc00:0:0:2020::2

# Configure a default IPv6 static route on SwitchC.


[SwitchC] ipv6 route-static :: 0 vlanif40 fc00:0:0:2020::1

Step 5 Verify the configuration.


# Check the IPv6 routing table on SwitchA.
[SwitchA] display ipv6 routing-table
Routing Table : Public
Destinations : 7 Routes : 7

Destination : :: PrefixLength : 0
NextHop : FC00:0:0:2010::2 Preference : 60
Cost :0 Protocol : Static
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif20 Flags :D

Destination : ::1 PrefixLength : 128


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

Destination : FC00:0:0:2001:: PrefixLength : 64


NextHop : FC00:0:0:2001::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif10 Flags :D

Destination : FC00:0:0:2001::1 PrefixLength : 128


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

Destination : FC00:0:0:2010:: PrefixLength : 64


NextHop : FC00:0:0:2010::1 Preference : 0
Cost :0 Protocol : Direct
RelayNextHop : :: TunnelID : 0x0
Interface : Vlanif20 Flags :D

Destination : FC00:0:0:2010::1 PrefixLength : 128


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

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 46


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

RelayNextHop : :: TunnelID : 0x0


Interface : Vlanif20 Flags :D

Destination : FE80:: PrefixLength : 10


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

# Run the ping command to verify the connectivity.


[SwitchA] ping ipv6 fc00:0:0:2003::1
PING fc00:0:0:2003::1 : 56 data bytes, press CTRL_C to break
Reply from FC00:0:0:2003::1
bytes=56 Sequence=1 hop limit=63 time = 63 ms
Reply from FC00:0:0:2003::1
bytes=56 Sequence=2 hop limit=63 time = 62 ms
Reply from FC00:0:0:2003::1
bytes=56 Sequence=3 hop limit=63 time = 62 ms
Reply from FC00:0:0:2003::1
bytes=56 Sequence=4 hop limit=63 time = 63 ms
Reply from FC00:0:0:2003::1
bytes=56 Sequence=5 hop limit=63 time = 63 ms

--- fc00:0:0:2003::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.


[SwitchA] tracert ipv6 fc00:0:0:2003::1
traceroute to fc00:0:0:2003::1 30 hops max,60 bytes packet
1 FC00:0:0:2010::2 31 ms 32 ms 31 ms
2 FC00:0:0:2003::1 62 ms 63 ms 62 ms

----End

Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
ipv6
#
vlan batch 10 20
#
interface Vlanif10
ipv6 enable
ipv6 address FC00:0:0:2001::1/64
#
interface Vlanif20
ipv6 enable
ipv6 address FC00:0:0:2010::1/64
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
#
ipv6 route-static :: 0 Vlanif20 FC00:0:0:2010::2
#
return

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 47


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

● SwitchB configuration file


#
sysname SwitchB
#
ipv6
#
vlan batch 20 30 40
#
interface Vlanif20
ipv6 enable
ipv6 address FC00:0:0:2010::2/64
#
interface Vlanif30
ipv6 enable
ipv6 address FC00:0:0:2002::1/64
#
interface Vlanif40
ipv6 enable
ipv6 address FC00:0:0:2020::1/64
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 40
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 30
#
ipv6 route-static FC00:0:0:2001:: 64 Vlanif20 FC00:0:0:2010::1
ipv6 route-static FC00:0:0:2003:: 64 Vlanif40 FC00:0:0:2020::2
#
return

● SwitchC configuration file


#
sysname SwitchC
#
ipv6
#
vlan batch 40 50
#
interface Vlanif40
ipv6 enable
ipv6 address FC00:0:0:2020::2/64
#
interface Vlanif50
ipv6 enable
ipv6 address FC00:0:0:2003::1/64
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 40
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 50
#
ipv6 route-static :: 0 Vlanif40 FC00:0:0:2020::1
#
return

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 48


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

3.12.3 Example for Configuring Static BFD for IPv4 Static


Routes

Networking Requirements
In Figure 3-8, SwitchA connects to the network management system (NMS)
across a network segment through SwitchB. Static routes need to be configured
on SwitchA so that SwitchA can communicate with the NMS. Link fault detection
between SwitchA and SwitchB must be completed within a few milliseconds to
speed up route convergence.

Figure 3-8 Configuring static BFD for IPv4 static routes


GE0/0/1 GE0/0/2
VLANIF10 VLANIF20
10.1.1.1/24 10.2.2.2/24

GE0/0/1 10.2.2.1/24
SwitchA VLANIF10 SwitchB NMS
10.1.1.2/24

Configuration Roadmap
The configuration roadmap is as follows:

1. Configure a BFD session between SwitchA and SwitchB to complete link fault
detection within a few milliseconds.
2. Configure a static route from SwitchA to the NMS and bind a BFD session to
the static route to complete link fault detection within a few milliseconds and
speed up route convergence.

Procedure
Step 1 Create VLANs and add interfaces to the VLANs.

# Configure SwitchA. The configurations of SwitchB are similar to the


configuration of SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan 10
[SwitchA-vlan10] quit
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[SwitchA-GigabitEthernet0/0/1] quit

Step 2 Assign IP addresses to VLANIF interfaces.

# Configure SwitchA. The configurations of SwitchB are similar to the


configuration of SwitchA.
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 10.1.1.1 24
[SwitchA-Vlanif10] quit

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 49


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Step 3 Configure a BFD session between SwitchA and SwitchB.


# Create a BFD session on SwitchA.
[SwitchA] bfd
[SwitchA-bfd] quit
[SwitchA] bfd aa bind peer-ip 10.1.1.2
[SwitchA-bfd-session-aa] discriminator local 10
[SwitchA-bfd-session-aa] discriminator remote 20
[SwitchA-bfd-session-aa] commit
[SwitchA-bfd-session-aa] quit

# Create a BFD session on SwitchB.


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

Step 4 Configure a static route and bind it to the BFD session.


# On SwitchA, configure a default static route to the external network and bind it
to the BFD session named aa.
[SwitchA]ip route-static 10.2.2.0 24 10.1.1.2 track bfd-session aa

Step 5 Verify the configuration.


# After the configuration is complete, run the display bfd session all command
on SwitchA and SwitchB. The command output shows that the BFD session has
been established and is Up.
The display on SwitchA is used as an example.
[SwitchA] display bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
10 20 10.1.1.2 Up S_IP_PEER -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0

# Check the IP routing table on SwitchA. The command output shows that the
static route 10.2.2.0/24 exists in the routing table.
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 5 Routes : 5

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif10


10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
10.2.2.0/24 Static 60 0 RD 10.1.1.2 Vlanif10
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

# Run the shutdown command on GE 0/0/1 of SwitchB to simulate a link fault.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] shutdown

# Check the IP routing table on SwitchA. The command output shows that the
static route 10.2.2.0/24 does not exist. This is because the static route has been

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 50


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

bound to a BFD session, and BFD immediately notifies that the bound static route
becomes unavailable after detecting a link fault.
[SwitchA]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

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

# Run the undo shutdown command on GE0/0/1 of SwitchB to simulate link


recovery.
[SwitchB-GigabitEthernet0/0/1]undo shutdown

# Check the IP routing table on SwitchA. The command output shows that the
static route 10.2.2.0/24 exists in the routing table. This is because BFD
immediately notifies that the bound static route becomes reachable again after
detecting link recovery.
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 5 Routes : 5

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.1.1.0/24 Direct 0 0 D 10.1.1.1 Vlanif10


10.1.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
10.2.2.0/24 Static 60 0 RD 10.1.1.2 Vlanif10
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

----End

Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 10
#
bfd
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
bfd aa bind peer-ip 10.1.1.2
discriminator local 10
discriminator remote 20
commit
#
ip route-static 10.2.2.0 255.255.255.0 10.1.1.2 track bfd-session aa
#
return

● SwitchB configuration file

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 51


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

#
sysname SwitchB
#
vlan batch 10 20
#
bfd
#
interface Vlanif10
ip address 10.1.1.2 255.255.255.0
#
interface Vlanif20
ip address 10.2.2.2 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
bfd bb bind peer-ip 10.1.1.1
discriminator local 20
discriminator remote 10
commit
#
return

Relevant Information
Video
How to Configure a Static Route
How to Configure a Default Route
How to Configure a Floating Static Route

3.12.4 Example for Configuring Static BFD for IPv6 Static


Routes
Networking Requirements
In Figure 3-9, SwitchA and SwitchB connect to each other and have IPv6 static
routes configured between them. It is required that a fault on the link between
SwitchA and SwitchB be detected within a few milliseconds, and that SwitchA and
SwitchB dynamically update their IPv6 routing tables.

Figure 3-9 Configuring static BFD for IPv6 static routes


GE0/0/1
FC00::1/64
GE0/0/1
SwitchA FC00::2/64 SwitchB

Configuration Roadmap
The configuration roadmap is as follows:

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 52


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

1. Configure a BFD session between SwitchA and SwitchB to complete fault


detection within a few milliseconds.
2. Configure a static route from SwitchA to SwitchB and bind the IPv6 static
route to the BFD session so that SwitchA and SwitchB can update their IPv6
routing tables after a fault is detected.

Procedure
Step 1 Configure IPv6 addresses for interfaces of SwitchA and SwitchB.
# Configure SwitchA. The configuration of SwitchB is similar to that of SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] ipv6
[SwitchA] interface GigabitEthernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] undo portswitch
[SwitchA-GigabitEthernet0/0/1] ipv6 enable
[SwitchA-GigabitEthernet0/0/1] ipv6 address fc00::1 64
[SwitchA-GigabitEthernet0/0/1] quit

Step 2 Configure a BFD session between SwitchA and SwitchB.


# On SwitchA, create a BFD session with SwitchB.
[SwitchA] bfd
[SwitchA-bfd] quit
[SwitchA] bfd aa bind peer-ipv6 fc00::2
[SwitchA-bfd-session-aa] discriminator local 10
[SwitchA-bfd-session-aa] discriminator remote 20
[SwitchA-bfd-session-aa] commit
[SwitchA-bfd-session-aa] quit

# On SwitchB, create a BFD session with SwitchA.


[SwitchB] bfd
[SwitchB-bfd] quit
[SwitchB] bfd bb bind peer-ipv6 fc00::1
[SwitchB-bfd-session-bb] discriminator local 20
[SwitchB-bfd-session-bb] discriminator remote 10
[SwitchB-bfd-session-bb] commit
[SwitchB-bfd-session-bb] quit

Step 3 Configure a default static route and bind the route to the BFD session.
# On SwitchA, configure a default static route to SwitchB and bind the route to
the BFD session named aa.
[SwitchA] ipv6 route-static 0::0 0 fc00::2 track bfd-session aa

Step 4 Verify the configuration.


# After the configuration is complete, run the display bfd session all command
on SwitchA and SwitchB. The display on SwitchA is used as an example:
[SwitchA] display bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
10 20 FC00::2
Up S_IP_PEER -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0

The command output shows that the BFD session has been established and is Up.
Run the display current-configuration | include bfd command in the system

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 53


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

view. The command output shows that the default static route has been bound to
the BFD session. The display on SwitchA is used as an example:
[SwitchA] display current-configuration | include bfd
bfd
bfd aa bind peer-ipv6 FC00::2
ipv6 route-static :: 0 FC00::2 track bfd-session aa

# Check the IPv6 routing table on SwitchA. The command output shows that the
default static route exists in the routing table.
[SwitchA] display ipv6 routing-table
Routing Table : Public
Destinations : 5 Routes : 5

Destination : :: PrefixLength : 0
NextHop : FC00::2 Preference : 60
Cost :0 Protocol : Static
RelayNextHop : :: TunnelID : 0x0
Interface : GigabitEthernet0/0/1 Flags : RD

Destination : ::1 PrefixLength : 128


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

Destination : FC00:: PrefixLength : 64


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

Destination : FC00::1 PrefixLength : 128


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

Destination : FE80:: PrefixLength : 10


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

# Run the shutdown command on GE0/0/1 of SwitchB to simulate a link fault.


[SwitchB] interface GigabitEthernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] shutdown

# Check the IPv6 routing table on SwitchA. The command output shows that the
default static route 0::0/0 does not exist. This is because the default static route
has been bound to a BFD session, and BFD immediately notifies that the bound
static route becomes unavailable after detecting a link fault.
[SwitchA] display ipv6 routing-table
Routing Table : Public
Destinations : 1 Routes : 1

Destination : ::1 PrefixLength : 128


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

----End

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 54


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
ipv6
#
bfd
#
interface GigabitEthernet0/0/1
undo portswitch
ipv6 enable
ipv6 address FC00::1/64
#
bfd aa bind peer-ipv6 FC00::2
discriminator local 10
discriminator remote 20
commit
#
ipv6 route-static :: 0 FC00::2 track bfd-session aa
#
return

● SwitchB configuration file


#
sysname SwitchB
#
ipv6
#
bfd
#
interface GigabitEthernet0/0/1
undo portswitch
ipv6 enable
ipv6 address FC00::2/64
#
bfd bb bind peer-ipv6 FC00::1
discriminator local 20
discriminator remote 10
commit
#
return

3.12.5 Example for Configuring NQA for IPv4 Static Routes


Networking Requirements
As shown in Figure 3-10, SwitchA on a company network is connected to two
egress routers (RouterA and RouterB) through two default static routes to
implement load balancing. The company wants to deploy a link failure detection
mechanism for the default static routes, so that traffic can be switched from a
faulty link to the other functioning link promptly to prevent services from being
interrupted.

NOTE

In this scenario, ensure that all connected interfaces have STP disabled. If STP is enabled
and VLANIF interfaces of switches are used to construct a Layer 3 ring network, an
interface on the network will be blocked. As a result, Layer 3 services on the network
cannot run normally.

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 55


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Figure 3-10 Configuring NQA for IPv4 static routes

Internet

RouterA RouterB
10.1.10.1/24 10.1.20.1/24

SwitchA
GE0/0/1 GE0/0/2
VLANIF 100 VLANIF 200
10.1.10.2/24 10.1.20.2/24
GE0/0/3
VLANIF 300
10.1.30.2/24

LSW

Client

Configuration Roadmap
1. Create VLANs, add interfaces to the VLANs, and configure IP addresses for
VLANIF interfaces, so that neighboring devices can communicate with each
other.
2. Create ICMP NQA test instances to monitor the status of links.
ICMP NQA test instances need to be created on the NQA client SwitchA to
detect the status of links between SwitchA and RouterA and between SwitchA
and RouterB.
3. Configure default static routes and bind them to the NQA test instances.
Default static routes destined for RouterA and RouterB need to be configured
on SwitchA and bound to NQA test instances. In this way, if an NQA test
instance detects a link failure, traffic is switched to the other link.

Procedure
Step 1 On SwitchA, create VLANs and add interfaces to them.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 100 200 300
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 200
[SwitchA-GigabitEthernet0/0/2] quit

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 56


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

[SwitchA] interface gigabitethernet 0/0/3


[SwitchA-GigabitEthernet0/0/3] port link-type trunk
[SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 300
[SwitchA-GigabitEthernet0/0/3] quit

Step 2 On SwitchA, configure an IP address for each VLANIF interface.


[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 10.1.10.2 24
[SwitchA-Vlanif100] quit
[SwitchA] interface vlanif 200
[SwitchA-Vlanif200] ip address 10.1.20.2 24
[SwitchA-Vlanif200] quit
[SwitchA] interface vlanif 300
[SwitchA-Vlanif300] ip address 10.1.30.2 24
[SwitchA-Vlanif300] quit

Step 3 On SwitchA, configure NQA test instances.


[SwitchA] nqa test-instance user test1
[SwitchA-nqa-user-test1] test-type icmp
[SwitchA-nqa-user-test1] destination-address ipv4 10.1.10.1
[SwitchA-nqa-user-test1] frequency 11
[SwitchA-nqa-user-test1] probe-count 2
[SwitchA-nqa-user-test1] interval seconds 5
[SwitchA-nqa-user-test1] timeout 4
[SwitchA-nqa-user-test1] start now
[SwitchA-nqa-user-test1] quit
[SwitchA] nqa test-instance user test2
[SwitchA-nqa-user-test2] test-type icmp
[SwitchA-nqa-user-test2] destination-address ipv4 10.1.20.1
[SwitchA-nqa-user-test2] frequency 11
[SwitchA-nqa-user-test2] probe-count 2
[SwitchA-nqa-user-test2] interval seconds 5
[SwitchA-nqa-user-test2] timeout 4
[SwitchA-nqa-user-test2] start now
[SwitchA-nqa-user-test2] quit

Step 4 Configure default static routes and bind them to the NQA test instances.
[SwitchA] ip route-static 0.0.0.0 0.0.0.0 10.1.10.1 track nqa user test1
[SwitchA] ip route-static 0.0.0.0 0.0.0.0 10.1.20.1 track nqa user test2

Step 5 Verify the configuration.


# Check the configuration of NQA for default static routes. The command output
shows that the default static routes have been bound to NQA test instances.
[SwitchA] display current-configuration | include nqa
ip route-static 0.0.0.0 0.0.0.0 10.1.10.1 track nqa user test1
ip route-static 0.0.0.0 0.0.0.0 10.1.20.1 track nqa user test2
nqa test-instance user test1
nqa test-instance user test2

# Check NQA test results.


[SwitchA] display nqa results test-instance user test1

NQA entry(user, test1) :testflag is active ,testtype is icmp


1 . Test 10 result The test is finished
Send operation times: 2 Receive response times: 2
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:10.1.10.1
Min/Max/Average Completion Time: 30/30/30
Sum/Square-Sum Completion Time: 7/25
Last Good Probe Time: 2014-09-09 09:55:38.2
Lost packet ratio: 0 %

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 57


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

[SwitchA] display nqa results test-instance user test2

NQA entry(user, test2) :testflag is active ,testtype is icmp


1 . Test 11 result The test is finished
Send operation times: 2 Receive response times: 2
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:10.1.20.1
Min/Max/Average Completion Time: 30/30/30
Sum/Square-Sum Completion Time: 7/25
Last Good Probe Time: 2014-09-09 09:56:38.2
Lost packet ratio: 0 %

Completion:success and Lost packet ratio: 0 % in the command output show


that the links between SwitchA and RouterA and between SwitchA and RouterB
are normal.
# Check the routing table. The command output shows that there are two default
static routes destined for RouterA and RouterB, respectively.
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 10

Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 Static 60 0 RD 10.1.10.1 Vlanif100


Static 60 0 RD 10.1.20.1 Vlanif200
10.1.10.0/24 Direct 0 0 D 10.1.10.2 Vlanif100
10.1.10.2/32 Direct 0 0 D 127.0.0.1 Vlanif100
10.1.20.0/24 Direct 0 0 D 10.1.20.2 Vlanif200
10.1.20.2/32 Direct 0 0 D 127.0.0.1 Vlanif200
10.1.30.0/24 Direct 0 0 D 10.1.30.2 Vlanif300
10.1.30.2/32 Direct 0 0 D 127.0.0.1 Vlanif300
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

# Shut down GigabitEthernet0/0/2 on SwitchA to simulate a link fault.


[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] shutdown
[SwitchA-GigabitEthernet0/0/2] quit

# Check NQA test results.


[SwitchA] display nqa results test-instance user test1

NQA entry(user, test1) :testflag is active ,testtype is icmp


1 . Test 12 result The test is finished
Send operation times: 2 Receive response times: 2
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:10.1.10.1
Min/Max/Average Completion Time: 30/30/30
Sum/Square-Sum Completion Time: 7/25
Last Good Probe Time: 2014-09-09 09:57:38.2
Lost packet ratio: 0 %
[SwitchA] display nqa results test-instance user test2

NQA entry(user, test2) :testflag is active ,testtype is icmp


1 . Test 13 result The test is finished

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 58


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Send operation times: 2 Receive response times: 0


Completion:failed RTD OverThresholds number: 0
Attempts number:1 Drop operation number:0
Disconnect operation number:0 Operation timeout number:2
System busy operation number:0 Connection fail number:0
Operation sequence errors number:0 RTT Status errors number:0
Destination ip address:10.1.20.1
Min/Max/Average Completion Time: 0/0/0
Sum/Square-Sum Completion Time: 0/0
Last Good Probe Time: 2014-09-09 09:58:38.2
Lost packet ratio: 100 %

Completion:failed and Lost packet ratio: 100 % in the command output show
that the link between SwitchA and RouterB is faulty.
# Check the routing table. Only the default static route to RouterA is available.
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7

Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 Static 60 0 RD 10.1.10.1 Vlanif100


10.1.10.0/24 Direct 0 0 D 10.1.10.2 Vlanif100
10.1.10.2/32 Direct 0 0 D 127.0.0.1 Vlanif100
10.1.30.0/24 Direct 0 0 D 10.1.30.2 Vlanif300
10.1.30.2/32 Direct 0 0 D 127.0.0.1 Vlanif300
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

----End

Configuration Files
SwitchA configuration file
#
sysname SwitchA
#
vlan batch 100 200 300
#
interface Vlanif100
ip address 10.1.10.2 255.255.255.0
#
interface Vlanif200
ip address 10.1.20.2 255.255.255.0
#
interface Vlanif300
ip address 10.1.30.2 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 200
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 300
#
ip route-static 0.0.0.0 0.0.0.0 10.1.10.1 track nqa user test1
ip route-static 0.0.0.0 0.0.0.0 10.1.20.1 track nqa user test2
#
nqa test-instance user test1

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 59


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

test-type icmp
destination-address ipv4 10.1.10.1
frequency 11
interval seconds 5
timeout 4
probe-count 2
start now
#
nqa test-instance user test2
test-type icmp
destination-address ipv4 10.1.20.1
frequency 11
interval seconds 5
timeout 4
probe-count 2
start no
#
return

Relevant Information
Video
How to Configure a Static Route
How to Configure a Default Route
How to Configure a Floating Static Route

3.12.6 Example for Configuring EFM for Static IPv4 Routes


Networking Requirements
In Figure 3-11, SwitchA connects to the NMS across a network segment through
SwitchB. SwitchA communicates with the NMS using static routes. SwitchA and
SwitchB need to detect the link quality in real time. When the link between them
becomes faulty, the corresponding static route will be deleted from the IP routing
table. Traffic is then switched from the route using the faulty link to a working
route to improve network reliability.

Figure 3-11 Configuring EFM for IPv4 static routes


GE0/0/1 GE0/0/2
VLANIF10 VLANIF20
192.168.1.1/24 192.168.2.2/24

GE0/0/1 192.168.2.1/24
SwitchA VLANIF10 SwitchB NMS
192.168.1.2/24

Configuration Roadmap
The configuration roadmap is as follows:
1. Enable Ethernet in the First Mile (EFM) OAM globally and on interfaces of
SwitchA and SwitchB to implement real-time link quality detection.
2. Configure a static route from SwitchA to the NMS and bind the static route to
the EFM state to associate the static route with EFM. When a link where the

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 60


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

static route resides becomes faulty, traffic is switched to a route without link
faults.

Procedure
Step 1 Configure VLANs and add interfaces to the VLANs.
# Configure SwitchA. The configuration of SwitchB is similar to that of SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan 10
[SwitchA-vlan10] quit
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[SwitchA-GigabitEthernet0/0/1] quit

Step 2 Configure IP addresses for VLANIF interfaces.


# Configure SwitchA. The configuration of SwitchB is similar to that of SwitchA.
[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 192.168.1.1 24
[SwitchA-Vlanif10] quit

Step 3 Configure an EFM session between SwitchA and SwitchB.


# Enable EFM OAM on SwitchA.
[SwitchA] efm enable
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] efm enable
[SwitchA-GigabitEthernet0/0/1] quit

# Enable EFM OAM on SwitchB.


[SwitchB] efm enable
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] efm enable
[SwitchB-GigabitEthernet0/0/1] quit

Step 4 Configure a static route and bind it to the EFM state.


# Configure a static route from SwitchA to an external network and bind it to the
EFM state of GigabitEthernet0/0/1.
[SwitchA] ip route-static 192.168.2.0 24 192.168.1.2 track efm-state gigabitethernet0/0/1

Step 5 Verify the configuration.


# After the configuration is complete, run the display efm session all command
on SwitchA and SwitchB. The command output shows that an EFM session has
been set up and is in detect mode. That is, the interface is in handshake state. The
following uses the display on SwitchA as an example.
[SwitchA] display efm session all
Interface EFM State Loopback Timeout
----------------------------------------------------------------------
GigabitEthernet0/0/1 detect --

# Check the IP routing table on SwitchA. The IP routing table contains the static
route 192.168.2.0/24.
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 61


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 5 Routes : 5

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
192.168.1.0/24 Direct 0 0 D 192.168.1.1 Vlanif10
192.168.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
192.168.2.0/24 Static 60 0 RD 192.168.1.2 Vlanif10

# Run the undo efm enable command in the view of GigabitEthernet0/0/1 on


SwitchB to simulate a link fault.
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] undo efm enable

# Run the display efm session all command on SwitchA. The command output
shows that the EFM OAM protocol state is discovery, indicating that the interface
is in OAM discovery state.
[SwitchA] display efm session all
Interface EFM State Loopback Timeout
----------------------------------------------------------------------
GigabitEthernet0/0/1 discovery --

# Check the IP routing table on SwitchA. The IP routing table does not contain the
static route 192.168.2.0/24. This is because the static route has been bound to the
EFM state, and EFM OAM rapidly notifies SwitchA that the static route becomes
unavailable after detecting a link fault.
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 4 Routes : 4

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
192.168.1.0/24 Direct 0 0 D 192.168.1.1 Vlanif10
192.168.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif10

# Run the efm enable command in the view of GigabitEthernet0/0/1 on SwitchB


to simulate link recovery.
[SwitchB-GigabitEthernet0/0/1]efm enable

# Run the display efm session all command on SwitchA. The command output
shows that the EFM OAM protocol state is detect, indicating that the interface is
in handshake state again.
[SwitchA] display efm session all
Interface EFM State Loopback Timeout
----------------------------------------------------------------------
GigabitEthernet0/0/1 detect --

# Check the IP routing table on SwitchA. The IP routing table contains the static
route 192.168.2.0/24 again. This is because EFM OAM rapidly notifies that the
bound static route becomes reachable again after detecting link recovery.
[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 62


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Destinations : 5 Routes : 5

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
192.168.1.0/24 Direct 0 0 D 192.168.1.1 Vlanif10
192.168.1.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
192.168.2.0/24 Static 60 0 RD 192.168.1.2 Vlanif10

----End

Configuration Files
● SwitchA configuration file
#
sysname SwitchA
#
vlan batch 10
#
efm enable
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
efm enable
#
ip route-static 192.168.2.0 255.255.255.0 192.168.1.2 track efm-state GigabitEthernet0/0/1
#
return

● SwitchB configuration file


#
sysname SwitchB
#
vlan batch 10 20
#
efm enable
#
interface Vlanif10
ip address 192.168.1.2 255.255.255.0
#
interface Vlanif20
ip address 192.168.2.2 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
efm enable
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
return

Relevant Information
Video

How to Configure a Static Route

How to Configure a Default Route

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 63


S1720, S2700, S5700, and S6720 Series Ethernet
Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

How to Configure a Floating Static Route

Issue 13 (2021-10-20) Copyright © Huawei Technologies Co., Ltd. 64

You might also like