Вы находитесь на странице: 1из 47

S1720&S2700&S5700&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 Static Route Overview
3.2 Principles
3.3 Applications
3.4 Configuration Task Summary
3.5 Default Configuration of 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
3.13 References

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 17


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

3.1 Static Route Overview

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.

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

3.2 Principles

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.
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 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 "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 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.
l 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 03 (2016-07-22) Huawei Proprietary and Confidential 18


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

l 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.
l 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 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.
l 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.
l 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 the 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 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:

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 19


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

l 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.
l 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 - 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 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 03 (2016-07-22) Huawei Proprietary and Confidential 20


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&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:
l 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.
l 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 permanent advertisement
mechanism provides a way for you to monitor services and detect link connectivity.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 21


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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

IS P 2
BR2
1 0 .1 .1 .2 /2 4
L in k A

BR1
IS P 1
L in k B BR3
IS P 3

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.

3.3 Applications

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 22


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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


S w itc h B

P re fe re n ce = 6 0

P re fe re n ce = 6 0
S w itc h A S w itch C

S w itch D

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


S w itc h B

P re fe re n ce = 6 0

P re fe re n ce = 1 0 0
S w itc h A S w itch C

S w itch D

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.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 23


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

l 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.
l 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.
l 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.
l 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 default route from SwitchC to SwitchB
can replace the three static routes destined for networks 1, 2, and 3.

3.4 Configuration Task Summary


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.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 24


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Table 3-1 Static route configuration tasks


Scenario Description Task

Configuring static routes Static routes are manually l 3.6 Configuring IPv4
configured by administrators Static Routes
to ensure normal operations l 3.10 Configuring IPv6
of simple networks and Static Routes
required bandwidth for
important network
applications.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 25


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Scenario Description Task

Configuring fault detection In actual networking, static l 3.7 Configuring Static


protocols for static routes routes are associated with BFD for IPv4 Static
fault detection protocols to Routes
improve network l 3.8 Associating IPv4
performance. Static Routes with
l BFD for static routes: NQA
enables a BFD session to l 3.9 Associating IPv4
detect the link status of a Static Routes with
static route and performs EFM
fault detection within
milliseconds. This
compensates for static
routes' lack of a fault
detection mechanism,
and so reduces the
administrator workload.
NOTE
Only the S5720S-SI,
S5720SI, S5720EI,
S5720HI, S6720S-EI and
S6720EI support BFD for
IPv4 static routes.
l Unlike BFD, NQA for
static routes only
requires one end of
interconnected devices to
support NQA and can be
used even if there are
Layer 2 devices. Unlike
ARP, NQA can be used
for all links on a
network. 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, improving
traffic forwarding.
l 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.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 26


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

3.5 Default Configuration of Static Routes


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

Table 3-2 Default configuration of static routes


Parameter Default Setting

Preference of static routes 60

3.6 Configuring IPv4 Static Routes

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 Procedures
You can perform the following configuration tasks (excluding checking the configuration) as
required and in any sequence.

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:
l For point-to-point (P2P) interfaces, specify the outbound interface.
l For non-broadcast multiple access (NBMA) interfaces, specify the next hop.
l 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.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 27


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Step 2 Configure IPv4 static routes.


l For public networks, 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.


l For VPN instances, 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-instance-name nexthop-address }
[ preference preference | tag tag ] * [ description text ]

An IPv4 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 S5720S-SI, S5720SI, S5720EI, S5720HI, S6720S-EI and S6720EI 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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 28


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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.

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 S5720S-SI, S5720SI, S5720EI, S5720HI, S6720S-EI and S6720EI support 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.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 29


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&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 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

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 Checking the Configuration

Procedure
l Run the display ip routing-table command to check brief information about the IPv4
routing table.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 30


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

l 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:
l Configure link layer parameters and IP addresses for interfaces to ensure network-layer
communication between neighbor nodes.
l Configure a BFD session.
For details, see "BFD Configuration" in S1720&S2700&S5700&S6720 Series Ethernet
Switches - 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 ]

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

NOTE

Only the S5720S-SI, S5720SI, S5720EI, S5720HI, S6720S-EI and S6720EI 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.
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

Checking the Configuration


Run the following command to check the previous configuration.
l Run the display bfd session all [ verbose ] command to check information about the
BFD session.

3.8 Associating IPv4 Static Routes with NQA

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 31


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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.

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:

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 32


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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.


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

Checking the Configuration


Once IPv4 static routes are associated with NQA, run the following commands to check the
configuration.
l Run the display current-configuration | include nqa command to check the
configuration of association between static routes and NQA.
l 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
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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 33


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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

Checking the Configuration


l Run the display efm session { all | interface interface-type interface-number command
to check information about EFM OAM on a specified interface.
l 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 Procedures
You can perform the following configuration tasks (excluding checking the configuration) as
required and in any sequence.

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:
l For point-to-point (P2P) interfaces, specify the outbound interface.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 34


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

l For non-broadcast multiple access (NBMA) interfaces, specify the next hop.
l For broadcast interfaces, specify the outbound interface. If the next hop address is also
specified, it does not need to be a link-local address.

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.


l For public networks, 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.


l 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 the S5720S-SI, S5720SI, S5720EI, S5720HI, S6720S-EI and S6720EI supports 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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 35


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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 Checking the Configuration

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

----End

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:

l Configure link layer protocol parameters and IP addresses for interfaces and ensure that
the link layer protocol of the interfaces is Up.
l Configure a BFD session. For details, see "BFD Configuration" in the
S1720&S2700&S5700&S6720 Series Ethernet Switches Configuration Guide -
Reliability
.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 36


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&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:
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 S5720S-SI, S5720SI, S5720EI, S5720HI, S6720S-EI and S6720EI 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

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

l Run the display bfd session { all | discriminator discr-value } [ verbose ] command to
check information about BFD sessions.
l Run the display current-configuration | include bfd command to check configurations
of BFD for IPv6 static routes.

3.12 Configuration Examples

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.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 37


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Figure 3-6 Configuring IPv4 static routes


PC2
1 0 .1 .2 .2 /2 4
G E 0 /0 /3
V L A N IF 4 0
1 0 .1 .2 .1 /2 4
G E 0 /0 /1 G E 0 /0 /2
V L A N IF 1 0 V L A N IF 2 0
1 0 . 1 .4 .2 /3 0 1 0 .1 .4 .5 /3 0
S w it c h B
S w it c h A S w it c h C
G E 0 /0 /1 G E 0 /0 /1
V L A N IF 1 0 V L A N IF 2 0
1 0 .1 .4 .1 /3 0 1 0 .1 .4 .6 /3 0
G E 0 /0 /2 G E 0 /0 /2
V L A N IF 3 0 V L A N IF 5 0
1 0 .1 .1 .1 /2 4 1 0 .1 .3 .1 /2 4
PC1 PC3
1 0 .1 .1 .2 /2 4 1 0 .1 .3 .2 /2 4

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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 38


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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

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
l SwitchA configuration file

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 39


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

#
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
l SwitchB configuration file
#
sysname SwitchB
#
vlan batch 10 20 40
#
interface Vlanif10
ip address 10.1.4.2 255.255.255.252
#
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
l 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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 40


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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

Figure 3-7 Configuring IPv6 static routes


PC2
F C 0 0 :0 :0 :2 0 0 2 ::2 /6 4
G E 0 /0 /3
V L A N IF 3 0
G E 0 /0 /1 F C 0 0 :0 :0 :2 0 0 2 ::1 /6 4
V L A N IF 2 0 G E 0 /0 /2
F C 0 0 :0 :0 :2 0 1 0 ::2 /6 4 V L A N IF 4 0
F C 0 0 :0 :0 :2 0 2 0 ::1 /6 4
S w it c h A S w it c h B
S w it c h C
G E 0 /0 /1 G E 0 /0 /1
V L A N IF 2 0 V L A N IF 4 0
F C 0 0 :0 :0 :2 0 1 0 ::1 /6 4
G E 0 /0 /2 F C 0 0 :0 :0 :2 0 2 0 ::2 /6 4 G E 0 /0 /2
V L A N IF 1 0 V L A N IF 5 0
F C 0 0 :0 :0 :2 0 0 1 ::1 /6 4 F C 0 0 :0 :0 :2 0 0 3 ::1 /6 4
PC1 PC3
F C 0 0 :0 :0 :2 0 0 1 ::2 /6 4 F C 0 0 :0 :0 :2 0 0 3 ::2 /6 4

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.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 41


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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
[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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 42


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 43


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Configuration Files
l 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

l 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

l SwitchC configuration file

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 44


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

#
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

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


G E 0 /0 /1 G E 0 /0 /2
V L A N IF 1 0 V L A N IF 2 0
1 0 .1 .1 .1 /2 4 1 0 .2 .2 .2 /2 4
G E 0 /0 /1 1 0 .2 .2 .1 /2 4
S w it c h A V L A N IF 1 0 S w it c h B NMS
1 0 .1 .1 .2 /2 4

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.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 45


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

# 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

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.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 46


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

[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 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
l SwitchA configuration file
#
sysname SwitchA
#
vlan batch 10
#

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 47


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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

l SwitchB configuration file


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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 48


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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:
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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 49


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 50


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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

Configuration Files
l 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
l 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
Figure 3-10 shows a company network. Access switches SwitchD and SwitchE are dual-
homed to aggregation switches SwitchB and SwitchC using static routes for redundancy
backup. The requirements for the network are as follows:

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 51


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

l A fault detection mechanism must be deployed for static routes so that link faults can be
detected rapidly for static routes and traffic can be switched from a faulty link to prevent
lengthy service interruptions.
l When the primary link SwitchBSwitchD is working properly, traffic must be
transmitted along the primary link.
l When the primary link becomes faulty, traffic must be switched to the backup link
SwitchCSwitchD.

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 may be
blocked. As a result, Layer 3 services on the network cannot run normally.

Figure 3-10 NQA for IPv4 static routes

IP N e t w o r k
S w it c h A
V L A N IF 3 0 V L A N IF 4 0
G E 0 /0 /1 G E 0 /0 /2

V L A N IF 3 0 V L A N IF 4 0
S w it c h B G E 0 /0 /1 G E 0 /0 /1 S w it c h C
V L A N IF 1 0 V L A N IF 2 0
VL 0
G E 0 /0 /3 AN IF 6 /2 G E 0 /0 /3
G E IF 5 0 AN 0
0 /0 VL E0/
G
/2

V L A N IF 1 0 0 VL V L A N IF 2 0
G E 0 /0 /1 IF 6 /2 AN
G E 0 /0 /1
AN 0 G E IF 5 0
VL E 0/ ...... 0 /0
G /2
V L A N IF 7 0 GE V L A N IF 8 0
0/ 0 /3 G E 0 /0 /4
G E 0 /0 /4 0/
3 0/
S w it c h D GE S w it c h E
...... ......

C lie n t 1 C lie n t 1 0 C lie n t 9 1 C lie n t 1 0 0

Device Name Interface IP Address

VLANIF 30 192.168.3.1/24
SwitchA
VLANIF 40 192.168.4.1/24

VLANIF 30 192.168.3.2/24

SwitchB VLANIF 50 192.168.5.1/24

VLANIF 10 192.168.1.1/24

VLANIF 40 192.168.4.2/24

SwitchC VLANIF 60 192.168.6.1/24

VLANIF 20 192.168.2.1/24

SwitchD VLANIF 10 192.168.1.2/24

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 52


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Device Name Interface IP Address

VLANIF 60 192.168.6.2/24

VLANIF 70 192.168.7.1/24

VLANIF 20 192.168.2.2/24

SwitchE VLANIF 50 192.168.5.2/24

VLANIF 80 192.168.8.1/24

Configuration Roadmap
1. Create an Internet Control Message Protocol (ICMP) NQA test instance to monitor the
status of the primary link.
Create an ICMP NQA test instance on the NQA client SwitchB to test whether the
primary link SwitchBSwitchD is running properly.
2. Configure static routes and associate the static routes with the NQA test instance.
Configure static routes on aggregation switches SwitchB and SwitchC, and associate the
static route configured on SwitchB with the ICMP NQA test instance. When the ICMP
NQA test instance detects a link fault, it instructs the routing management module to
delete the associated static route from the IPv4 routing table.
3. Configure a dynamic routing protocol (for example, OSPF).
Configure a dynamic routing protocol on aggregation switches SwitchA, SwitchB, and
SwitchC so that they can learn routes from each other.
4. Configure OSPF to import static routes, and set a higher cost for the static route used for
the backup link than that for the static route used for the primary link to implement link
backup.
Configure OSPF on aggregation switches SwitchB and SwitchC to import static routes,
and set a higher cost for the static route imported by SwitchC than for the static route
imported by SwitchB. This configuration allows SwitchA to preferentially select the link
SwitchBSwitchD with a lower cost.

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

# Configure SwitchA. The configurations of SwitchB, SwitchC, SwitchD, and SwitchE are
similar to the configuration of SwitchA.
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 30 40
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 30
[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 40
[SwitchA-GigabitEthernet0/0/2] quit

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 53


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

Step 2 Configure IP addresses for VLANIF interfaces.

# Configure SwitchA. The configurations of SwitchB, SwitchC, SwitchD, and SwitchE are
similar to the configuration of SwitchA.
[SwitchA] interface vlanif 30
[SwitchA-Vlanif30] ip address 192.168.3.1 24
[SwitchA-Vlanif30] quit
[SwitchA] interface vlanif 40
[SwitchA-Vlanif40] ip address 192.168.4.1 24
[SwitchA-Vlanif40] quit

Step 3 Create an NQA test instance on SwitchB to test the link between SwitchB and SwitchD.
[SwitchB] nqa test-instance user test
[SwitchB-nqa-user-test] test-type icmp
[SwitchB-nqa-user-test] destination-address ipv4 192.168.1.2
[SwitchB-nqa-user-test] frequency 10
[SwitchB-nqa-user-test] probe-count 2
[SwitchB-nqa-user-test] interval seconds 5
[SwitchB-nqa-user-test] timeout 4
[SwitchB-nqa-user-test] start now
[SwitchB-nqa-user-test] quit

Step 4 Configure IPv4 static routes.

# Configure an IPv4 static route on SwitchB and associate it with the NQA test instance.
[SwitchB] ip route-static 192.168.7.0 255.255.255.0 Vlanif 10 192.168.1.2 track
nqa user test

# Configure an IPv4 static route on SwitchC.


[SwitchC] ip route-static 192.168.7.0 255.255.255.0 Vlanif 60 192.168.6.2

Step 5 Configure a dynamic routing protocol on SwitchA, SwitchB, and SwitchC. OSPF is used in
this example.

# Configure OSPF on SwitchA.


[SwitchA] ospf 1 router-id 10.1.1.1
[SwitchA-ospf-1] area 0.0.0.0
[SwitchA-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] network 192.168.4.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit

# Configure OSPF on SwitchB.


[SwitchB] ospf 1 router-id 10.2.2.2
[SwitchB-ospf-1] area 0.0.0.0
[SwitchB-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.0] quit
[SwitchB-ospf-1] quit

# Configure OSPF on SwitchC.


[SwitchC] ospf 1 router-id 10.3.3.3
[SwitchC-ospf-1] area 0.0.0.0
[SwitchC-ospf-1-area-0.0.0.0] network 192.168.4.0 0.0.0.255
[SwitchC-ospf-1-area-0.0.0.0] quit
[SwitchC-ospf-1] quit

Step 6 Configure OSPF on SwitchB and SwitchC to import static routes.

# Configure OSPF on SwitchB to import a static route, and set the cost to 10 for the static
route.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 54


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

[SwitchB] ospf 1
[SwitchB-ospf-1] import-route static cost 10
[SwitchB-ospf-1] quit

# Configure OSPF on SwitchC to import a static route, and set the cost to 20 for the static
route.
[SwitchC] ospf 1
[SwitchC-ospf-1] import-route static cost 20
[SwitchC-ospf-1] quit

Step 7 Verify the configuration.

After the configuration is complete, run the display current-configuration | include nqa
command in the system view on aggregation switch Switch B. The command output shows
that the IPv4 static route has been associated with the NQA test instance. Run the display nqa
results command. The command output shows that an NQA test instance has been created.

# Check the configuration of NQA for IPv4 static routes.


[SwitchB] display current-configuration | include nqa
ip route-static 192.168.7.0 255.255.255.0 Vlanif10 192.168.1.2 track nqa user test
nqa test-instance user test

# Check the NQA test results.


[SwitchB] display nqa results test-instance user test

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


1 . Test 288 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:192.168.1.2
Min/Max/Average Completion Time: 3/4/3
Sum/Square-Sum Completion Time: 7/25
Last Good Probe Time: 2014-09-09 09:55:38.2
Lost packet ratio: 0 %

The command output shows "Lost packet ratio 0 %," indicating that the link is running
properly.

# Check the IP routing table on SwitchB.


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

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.3.0/24 Direct 0 0 D 192.168.3.2 Vlanif30
192.168.3.2/32 Direct 0 0 D 127.0.0.1 Vlanif30
192.168.4.0/24 OSPF 10 2 D 192.168.3.1 Vlanif30
192.168.5.0/24 Direct 0 0 D 192.168.5.1 Vlanif50
192.168.5.1/32 Direct 0 0 D 127.0.0.1 Vlanif50
192.168.7.0/24 Static 60 0 D 192.168.1.2 Vlanif10

# Check the IP routing table on aggregation switch SwitchA.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 55


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

[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

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.3.0/24 Direct 0 0 D 192.168.3.1 Vlanif30
192.168.3.1/32 Direct 0 0 D 127.0.0.1 Vlanif30
192.168.4.0/24 Direct 0 0 D 192.168.4.1 Vlanif40
192.168.4.1/32 Direct 0 0 D 127.0.0.1 Vlanif40
192.168.7.0/24 O_ASE 150 10 D 192.168.3.2 Vlanif30

The command output shows that a route to 192.168.7.0/24 exists in the routing table. The
route's next-hop address is 192.168.3.2 and its cost is 10. Traffic is then preferentially
transmitted along the link SwitchB -> SwitchD.
# Shut down GigabitEthernet0/0/3 on SwitchB to simulate a link fault.
[SwitchB] interface GigabitEthernet0/0/3
[SwitchB-GigabitEthernet0/0/3] shutdown
[SwitchB-GigabitEthernet0/0/3] quit

# Check the NQA test results.


[SwitchB] display nqa results test-instance user test

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


1 . Test 309 result The test is finished
Send operation times: 2 Receive response times: 0
Completion:failed RTD OverThresholds number: 0
Attempts number:1 Drop operation number:2
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:192.168.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 %

The command output shows "Completion:failed" and "Lost packet ratio is 100 %," indicating
that the link is faulty.
# Check the IP routing table on SwitchB.
[SwitchB] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8

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.3.0/24 Direct 0 0 D 192.168.3.2 Vlanif30
192.168.3.2/32 Direct 0 0 D 127.0.0.1 Vlanif30
192.168.4.0/24 OSPF 10 2 D 192.168.3.1 Vlanif30
192.168.5.0/24 Direct 0 0 D 192.168.5.1 Vlanif50
192.168.5.1/32 Direct 0 0 D 127.0.0.1 Vlanif50
192.168.7.0/24 O_ASE 150 20 D 192.168.3.1 Vlanif30

The command output shows that the static route has been deleted.
# Check the IP routing table on SwitchA.

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 56


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

[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

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.3.0/24 Direct 0 0 D 192.168.3.1 Vlanif30
192.168.3.1/32 Direct 0 0 D 127.0.0.1 Vlanif30
192.168.4.0/24 Direct 0 0 D 192.168.4.1 Vlanif40
192.168.4.1/32 Direct 0 0 D 127.0.0.1 Vlanif40
192.168.7.0/24 O_ASE 150 20 D 192.168.4.2 Vlanif40

The static route has been associated with the NQA test instance on SwitchB. If NQA detects a
link fault, it rapidly notifies SwitchB that the associated static route becomes unavailable.
SwitchA then cannot learn the route to 192.168.7.0/24 from SwitchB. However, SwitchA can
learn the route to 192.168.7.0/24 from SwitchC. The route's next-hop address is 192.168.4.2,
and its cost is 20. Traffic has been switched to the link SwitchC -> SwitchD.

----End

Configuration Files
l SwitchA configuration file
#
sysname SwitchA
#
vlan batch 30 40
#
interface Vlanif30
ip address 192.168.3.1 255.255.255.0
#
interface Vlanif40
ip address 192.168.4.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 30
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 40
#
ospf 1 router-id 10.1.1.1
area 0.0.0.0
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255
#
return

l SwitchB configuration file


#
sysname SwitchB
#
vlan batch 10 30 50
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif30
ip address 192.168.3.2 255.255.255.0
#
interface Vlanif50
ip address 192.168.5.1 255.255.255.0

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 57


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 30
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 50
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10
#
ospf 1 router-id 10.2.2.2
import-route static cost 10
area 0.0.0.0
network 192.168.3.0 0.0.0.255
#
ip route-static 192.168.7.0 255.255.255.0 Vlanif10 192.168.1.2 track nqa user
test
#
nqa test-instance user test
test-type icmp
destination-address ipv4 192.168.1.2
frequency 10
interval seconds 5
timeout 4
probe-count 2
start now
#
return

l SwitchC configuration file


#
sysname SwitchC
#
vlan batch 20 40 60
#
interface Vlanif20
ip address 192.168.2.1 255.255.255.0
#
interface Vlanif40
ip address 192.168.4.2 255.255.255.0
#
interface Vlanif60
ip address 192.168.6.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 40
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 60
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 20
#
ospf 1 router-id 10.3.3.3
import-route static cost 20
area 0.0.0.0
network 192.168.4.0 0.0.0.255
#
ip route-static 192.168.7.0 255.255.255.0 Vlanif60 192.168.6.2
#
return

l SwitchD configuration file

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 58


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

#
sysname SwitchD
#
vlan batch 10 60 70
#
interface Vlanif10
ip address 192.168.1.2 255.255.255.0
#
interface Vlanif60
ip address 192.168.6.2 255.255.255.0
#
interface Vlanif70
ip address 192.168.7.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 60
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 70
#
return

l SwitchE configuration file


#
sysname SwitchE
#
vlan batch 20 50 80
#
interface Vlanif20
ip address 192.168.2.2 255.255.255.0
#
interface Vlanif50
ip address 192.168.5.2 255.255.255.0
#
interface Vlanif80
ip address 192.168.8.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 trunk
port trunk allow-pass vlan 50
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 80
#
return

Relevant Information
Video

How to Configure a Static Route

How to Configure a Default Route

How to Configure a Floating Static Route

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 59


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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


G E 0 /0 /1 G E 0 /0 /2
V L A N IF 1 0 V L A N IF 2 0
1 9 2 .1 6 8 .1 .1 /2 4 1 9 2 .1 6 8 .2 .2 /2 4
G E 0 /0 /1 1 9 2 .1 6 8 .2 .1 /2 4
S w it c h A V L A N IF 1 0 S w it c h B NMS
1 9 2 .1 6 8 .1 .2 /2 4

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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 60


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 61


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

[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
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
l 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

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 62


Copyright Huawei Technologies Co., Ltd.
S1720&S2700&S5700&S6720 Series Ethernet Switches
Configuration Guide - IP Unicast Routing 3 Static Route Configuration

l 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
How to Configure a Floating Static Route

3.13 References
None

Issue 03 (2016-07-22) Huawei Proprietary and Confidential 63


Copyright Huawei Technologies Co., Ltd.