Professional Documents
Culture Documents
This chapter provides an overview of the functions, purposes and use cases of static routes,
and explains how they can be configured.
2.1 Overview of Static Routes
2.2 Understanding Static Routes
2.3 Application Scenarios for Static Routes
2.4 Summary of Static Route Configuration Tasks
2.5 Licensing Requirements and Limitations for Static Routes
2.6 Default Settings for Static Routes
2.7 Configuring IPv4 Static Routes
2.8 Configuring IPv6 Static Routes
2.9 Configuration Examples for Static Routes
Definition
A static route is a route that, in most cases, manually configured by the network administrator
to allow network traffic to reach a target destination.
Purpose
Static routes are used in different ways on different types of networks.
l On simple networks, static routes can be used alone without the need for dynamic routes
to ensure network connectivity.
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 associated with VPN instances are used to manage VPN routes.
same destination implements load balancing among these routes. Conversely, specifying
different preference values for static routes with the same destination implements route
backup among the routes. For details, see 2.3.1 Load Balancing and Route Backup.
l If the BFD session bound to a static route detects a link fault, BFD reports the fault to the
system. The system then sets the route to inactive, and this route is no longer available in
the IP 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 system. The system then sets the route to
active, and this route becomes available in the IP routing table again.
For more details about BFD, see "BFD Configuration - Principles" in Configuration Guide -
Reliability.
An effective method is required to detect faults in links related to static routes. BFD for static
routes is applicable only to the scenario where both communicating devices support BFD. If
either of the two communicating devices supports NQA, NQA for static routes can be used to
detect link 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 and determines an
optimal route in time according to the NQA test result to prevent communication interruption
and ensure service quality. NQA for static routes functions as follows:
l If the NQA test instance detects a link fault, the system sets the static route to inactive.
The route becomes unavailable and is deleted from the IP routing table.
l If the NQA test instance finds that the link recovers, the system sets the static route to
active. The route becomes available and is added to the IP routing table.
For details about NQA, see "NQA Configuration - Principles" in the Configuration Guide -
Network Management and Monitoring.
NOTE
When a static route is associated with an NQA test instance, only ICMP test instances are used to test
whether there are reachable routes between the source and destination.
Each static route can be associated with only one NQA test instance.
Application Scenario
On the network shown in Figure 2-1, each access switch provides access services for 10
users, and a total of 100 users are connected to the network. Because dynamic routing
protocols are unavailable for communication between RouterB and users, static routes
destined for users are configured on RouterB. For network stability, RouterC, functioning as
the backup for RouterB, is configured with static routes to the same destination. RouterA,
RouterB, and RouterC run a dynamic routing protocol to learn routes from each other.
RouterB and RouterC import static routes using a dynamic routing protocol and have different
costs for these static routes. After the configuration is complete, RouterA can use the dynamic
routing protocol to learn routes destined for users from RouterB and RouterC. RouterA uses
the link related to the static route with a lower cost as the active link and the other link as the
standby link.
NQA for static routes is configured on RouterB. NQA tests are performed to check the active
link of RouterB → SwitchA → SwitchC (SwitchD). If the active link fails, the corresponding
static route is deleted from the routing table, and traffic diverts to the standby link of RouterC
→ SwitchB → SwitchC (SwitchD). If both links work properly, traffic travels along the active
link.
Figure 2-1 Networking diagram for applying NQA for static routes
IP Network
RouterA
RouterB RouterC
SwitchA SwitchB
......
SwitchC SwitchD
...... ......
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.
Application Scenarios
In Figure 2-2, BR1, BR2, and BR3 belong to ISP1, ISP2, and ISP3 respectively. There are
two reachable links (Link A and Link B) between BR1 and BR2. ISP1, however, requires that
service traffic be forwarded to ISP2 over Link A without traveling through ISP3.
Figure 2-2 Networking diagram for applying permanent advertisement of static routes
ISP2
BR2
10.1.1.2/24
LinkA
BR1
ISP1 BR3
LinkB
ISP3
The External Border Gateway Protocol (EBGP) peer relationship is established between BR1
and BR2. For service monitoring, a static route destined for the BGP peer (BR2) at
10.1.1.2/24 is configured on BR1, and permanent advertisement of static routes is enabled.
The interface that connects BR1 to BR2 is specified as the outbound interface of the static
route. Then, the network monitoring system periodically pings 10.1.1.2 to determine the
status of Link A.
If Link A works properly, ping packets are forwarded over Link A. If Link A becomes faulty,
although service traffic can reach BR2 over Link B, the static route is still preferred because
permanent advertisement of static routes is enabled. Therefore, ping packets are still
forwarded over Link A, but packet forwarding fails. This scenario is also applicable to BGP
packets. That is, a link fault causes the BGP peer relationship to be interrupted. The network
monitoring system detects service faults as returned in the ping result and prompts
maintenance engineers to rectify the faults before services are affected.
RouterB
Preference=60
Preference=60
RouterA RouterC
RouterD
In Figure 2-3, there are two static routes with the same preference from RouterA to RouterC.
The two routes are stored in the routing table and used to forward data.
Route Backup
If different preferences are specified for multiple routes to the same destination, route backup
is implemented.
RouterB
Preference=60
Preference=100
RouterA RouterC
RouterD
In Figure 2-4, there are two static routes with different preferences from RouterA to RouterC.
Static route B with the next hop RouterB has a higher preference, and its link therefore
functions as the active link. Static route D with the next hop RouterD has a lower preference,
and its link therefore functions as the standby link.
l In normal situations, static route B is activated, and the active link forwards data. Static
route D is not shown in the routing table.
l If a fault occurs on the active link, static route B is deleted from the routing table. Static
route D, functioning as the backup route, is activated, and the standby link forwards data.
l When the active link restores, static route B is activated again, and the active link
forwards data. Static route D is deleted from the routing table and functions as the
backup route. Static route D is also called a floating static route.
2 4
RouterB
1 5
RouterA RouterC
In Figure 2-5, if no static default route is configured, you need to configure static routes
destined for networks 3, 4, and 5 on RouterA, configure static routes destined for networks 1
and 5 on RouterB, and configure static routes destined for networks 1, 2, and 3 on RouterC. In
this way, RouterA, RouterB, and RouterC can communicate with each other.
The next hop of the packets sent by RouterA to networks 3, 4, and 5 is RouterB. Therefore, a
default route configured on RouterA can replace the three static routes destined for networks
3, 4, and 5 in the preceding example. Similarly, just one default route from RouterC to
RouterB can replace the three static routes destined for networks 1, 2, and 3 in the preceding
example.
Configuring static routes Static routes are manually l 2.7 Configuring IPv4
configured by the Static Routes
administrator to ensure l 2.8 Configuring IPv6
normal operation of simple Static Routes
networks and bandwidth for
important network
applications.
dynamic routing
protocols cannot be
configured and
therefore IGP
convergence cannot
be implemented.
NQA for static routes
only requires one end of
the interconnected
devices to support NQA
and can be used even if
there are Layer 2
devices. In this case, the
preceding issues are
resolved. When a link is
faulty, an NQA test
instance can immediately
detect the link change
and delete the static route
associated with the NQA
test instance from the IP
routing table, affecting
traffic forwarding.
Licensing Requirements
Static routing is a basic feature of the CE12800 and CE12800E series switches and is not
under license control.
Version Requirements
CE12804/CE12808/CE12812 V100R001C00
CE12816 V100R003C00
CE12804S/CE12808S V100R005C00
CE12804E/CE12808E/CE12816E V200R002C50
Feature Limitations
If a switch has FD, FDA, FD1, FG, FG1, and SD cards installed, IP packet forwarding
through the default route referenced in a VPN instance may fail because of insufficient
routing and forwarding entries.
During an upgrade from V200R001C00SPC100 to a later version, if a static route's next hop
is iterated to a remote VPN cross route and the next hop is a VXLAN tunnel, the static route
is inactive in the source version but will become active in the target version. This
modification will cause inconsistent traffic transmission paths before and after the upgrade.
To prevent this issue, check whether a static route's next hop is iterated to a remote VPN cross
route and the next hop is a VXLAN tunnel. If so, delete this static route.
Pre-configuration Tasks
Before configuring IPv4 static routes, complete the following task:
l Configure link layer parameters and IP addresses for interfaces to ensure network-layer
communication between neighbor nodes.
Configuration Procedure
You can perform the following configuration tasks (excluding the task of Verifying the IPv4
Static Route Configuration) in any sequence as required.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Configure IPv4 static routes.
l Run ip route-static ip-address { mask | mask-length } { nexthop-address | vpn-instance
vpn-instance-name nexthop-address } [ recursive-lookup host-route [ arp-vlink-
only ] ] [ preference preference | tag tag ] * [ bfd enable | track { bfd-session cfg-name
| nqa admin-name test-name } | inherit-cost | permanent ] [ description text ]
An IPv4 static route is configured on the public network.
----End
Context
The default preference of an IPv4 static route affects route selection. When an IPv4 static
route is configured, the default preference is used if no preference is specified for the static
route.
Procedure
Step 1 Run system-view
NOTE
After the default preference is reconfigured, the new default preference is valid only for new IPv4 static
routes.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ip route-static selection-rule relay-depth
Static route selection based on iteration depth is configured.
By default, static routes are not selected based on iteration depth.
Step 3 Run commit
The configuration is committed.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
NOTE
To configure a device to iterate static routes to ARP Vlink routes, both the ip route-static with
recursive-lookup host-route [ arp-vlink-only ] specified and ip route recursive-lookup arp vlink-
direct-route protocol static commands must be run.
----End
Context
By default, a device does not compare the costs of inherited routes during static route
selection, and static routes with different costs work in load-balancing mode. To enable the
device to compare the costs of inherited routes and select only the static route with the
smallest cost, configure the device to compare the costs of inherited routes during static route
selection.
Procedure
Step 1 Run system-view
The device is enabled to compare the costs of inherited routes during static route selection.
----End
Pre-configuration Tasks
Before configuring dynamic BFD for IPv4 static routes, complete the following task:
l Configure link layer parameters and IP addresses for interfaces to ensure that the link
layer protocol on the interfaces is Up.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run bfd
BFD is enabled globally.
Step 3 Run quit
Return to the system view.
Step 4 (Optional) Run ip route-static default-bfd [ min-rx-interval min-rx-interval ] [ min-tx-
interval min-tx-interval ] [ detect-multiplier multiplier ]
Global BFD parameters are configured for static routes.
By default, the values of min-rx-interval, min-tx-interval, and detect-multiplier are 1000
ms, 1000 ms, and 3 respectively.
Step 5 Run ip route-static bfd [ interface-type interface-number ] nexthop-address [ local-address
address ] [ min-rx-interval min-rx-interval | min-tx-interval min-tx-interval | detect-
multiplier multiplier ] *
BFD parameters are configured for an IPv4 static route.
NOTE
NOTE
When the type and number of the outbound interface of a static route are specified, and the VPN
instance name is specified, a static route searches the routing table of the VPN instance for an outbound
interface according to nexthop-address. Run the ip route-static vpn-instance vpn-source-name
destination-address { mask | mask-length } interface-type interface-number [ nexthop-address ]
[ preference preference | tag tag ] * bfd enable [ description text ] command to bind a dynamic BFD
session to static routes.
----End
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 BFD sessions.
For details, see "BFD Configuration" in the CloudEngine 12800 and 12800E Series
Switches - Configuration Guide - Reliability.
Procedure
Step 1 Run system-view
Before binding a static route to a BFD session, ensure that the BFD session and the static route reside on
the same link.
----End
l Run the display bfd session all [ verbose ] command to check information about the
BFD session.
Pre-configuration Tasks
Before configuring FRR for IPv4 static routes, complete the following task:
l Configure link layer parameters and IP addresses for interfaces to ensure that the link
layer protocol on the interfaces is Up.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ip route-static frr [ vpn-instance vpn-instance-name ]
FRR is enabled for public network IPv4 static routes.
NOTE
FRR is implemented only on the static routes that are manually configured. That is, FRR cannot be
implemented on iterated next hops.
To implement route backup by configuring FRR for static routes, specify different preferences for these
static routes.
To enable FRR for an Ethernet interface's static route and other static routes, configure the outbound
interface and next hop.
----End
Pre-configuration Tasks
Before associating IPv4 static routes with NQA, complete the following task:
l Configure link layer parameters for interfaces to ensure that the link layer protocol on the
interfaces is Up.
Procedure
Step 1 Configure an ICMP NQA test instance.
1. Run system-view
The system view is displayed.
2. Run nqa test-instance admin-name test-name
An NQA test instance is created, and the view of the test instance is displayed.
3. Run test-type icmp
The test type is set to ICMP.
NOTE
When a static route is associated with an NQA test instance, only ICMP test instances are used to
test whether there are reachable routes between the source and destination.
4. Run destination-address ipv4 ip-address
The destination address is set.
In an NQA test instance, you can specify an NQA server by running the destination-
address command to configure a destination address for the NQA test instance.
5. (Optional) Run frequency interval
The interval for automatically performing an NQA test is set.
By default, no interval is set, that is, only one test is performed.
6. (Optional) Run probe-count number
The number of probes to be sent each time is set for the NQA test instance.
By default, the number of probes is 3.
By sending probes multiple times in an NQA test instance, you can accurately estimate
network quality based on the collected statistics.
7. Run start
The NQA test instance is started.
The start command can configure an NQA test instance to be started immediately, at a
specified time, after a specified delay, or every day. You can perform one of the
following operations as required:
– Run start now [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds second |
hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ]
The NQA test instance is started immediately.
– Run start at [ yyyy/mm/dd ] hh:mm:ss [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay
{ seconds second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ]
The NQA test instance is started at a specified time.
– Run start delay { seconds second | hh:mm:ss } [ end { at [ yyyy/mm/dd ] hh:mm:ss
| delay { seconds second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ]
The NQA test instance is started after a specified delay.
– Run start daily hh:mm:ss to hh:mm:ss [ begin { yyyy-mm-dd | yyyy/mm/dd } ]
[ end { yyyy-mm-dd | yyyy/mm/dd } ]
The NQA test instance is started every day.
8. Run commit
The configuration is committed.
9. Run quit
NOTE
The destination address of an NQA test instance cannot be the destination address of an associated
static route.
If the static route associated with an NQA test instance is associated with another NQA test
instance, the static route is disassociated from the first NQA test instance.
2. Run commit
----End
Procedure
l Run the display static-route routing-table command to check information about static
routes.
l Run the display ip routing-table command to check brief information about the IPv4
routing table.
l Run the display ip routing-table verbose command to check detailed information about
the IPv4 routing table.
----End
Pre-configuration Tasks
Before configuring IPv6 static routes, complete the following task:
l Configure link layer parameters and IPv6 addresses for interfaces to ensure network-
layer communication between neighbor nodes.
Configuration Procedure
You can perform the following configuration tasks (excluding the task of Verifying the IPv6
Static Route Configuration) in any sequence as required.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Configure IPv6 static routes.
l Run ipv6 route-static dest-ipv6-address prefix-length { interface-type interface-number
[ nexthop-ipv6-address ] | vpn-instance vpn-instance-name 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 dest-ipv6-address prefix-length [ vpn-instance vpn-instance-
name ] nexthop-ipv6-address [ preference preference | tag tag ] * inherit-cost
[ description text ]
An IPv6 static route is configured on the public network.
l Run ipv6 route-static dest-ipv6-address prefix-length vpn-instance vpn-instance-name
[ preference preference | tag tag ] [ description text ]
An IPv6 static route is configured on the public network.
l Run ipv6 route-static vpn-instance vpn-source-name dest-ipv6-address prefix-length
{ interface-type interface-number [ nexthop-ipv6-address ] | vpn-instance vpn-
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ipv6 route-static default-preference preference
The default preference of IPv6 static routes is set.
By default, the preference of static routes is 60.
After the default preference is reconfigured, the new default preference is valid only for new
IPv6 static routes.
Step 3 Run commit
The configuration is committed.
----End
Applicable Environment
Preferred IPv6 static routes are delivered to the forwarding table for packet forwarding. An
IPv6 static route, however, is incapable of detecting whether the link to the next hop is
working properly. Binding the IPv6 static route to a BFD session can address this problem,
because a BFD session is capable of detecting link changes and informing the routing
management module of the changes. If a BFD session detects that a link is interrupted, the
routing management module immediately withdraws the IPv6 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 dynamic BFD for IPv6 static routes, complete the following task:
l Configuring link layer protocol parameters and IPv6 addresses for interfaces to ensure
that the link layer protocol on the interfaces is Up
Procedure
Step 1 Run system-view
The global BFD parameters of the IPv6 static routes on the device are set.
The default values of the global BFD parameters min-rx-interval, min-tx-interval, and
multiplier are 1000 ms, 1000 ms, and 3 respectively.
NOTE
NOTE
When the type and number of the outbound interface of a static route are specified, and the VPN
instance name is specified, a static route searches the routing table of the VPN instance for an outbound
interface according to nexthop-address. Run the ipv6 route-static vpn-instance vpn-source-name dest-
ipv6-address prefix-length { interface-type interface-number [ nexthop-ipv6-address ] | vpn-instance
vpn-destination-name nexthop-ipv6-address | nexthop-ipv6-address [ public ] } [ preference preference |
tag tag ]* bfd enable [ description text ] command to bind a dynamic BFD session to static routes.
----End
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 quickly 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 on the interfaces is Up.
l Configure a BFD Session. For details, see "BFD Configuration" in the CloudEngine
12800 and 12800E Series Switches Configuration Guide-Reliability
Procedure
Step 1 Run system-view
The system view is displayed.
----End
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.
Pre-configuration Tasks
Before configuring FRR for IPv6 static routes, complete the following task:
l Configure link layer parameters and IPv6 addresses for interfaces to ensure that the link
layer protocol on the interfaces is Up.
Procedure
Step 1 Run system-view
NOTE
To implement route backup by configuring FRR for ipv6 static routes, specify different preferences for
these static routes.
----End
Pre-configuration Tasks
Before associating IPv6 static routes with NQA, complete the following task:
l Configure link layer parameters and IPv6 addresses for interfaces to ensure that the link
layer protocol on the interfaces is Up.
Procedure
Step 1 Configure an ICMP NQA test instance.
1. Run system-view
The system view is displayed.
2. Run nqa test-instance admin-name test-name
An NQA test instance is created, and the view of the test instance is displayed.
3. Run test-type icmp
The test type is set to ICMP.
4. Run destination-address ipv6 ipv6-address
A destination address is configured.
In an NQA test instance, you can specify an NQA server by running the destination-
address command to configure a destination address for the NQA test instance.
5. (Optional) Run frequency interval
The interval for automatically performing an NQA test is set.
By default, no interval is set, that is, only one test is performed.
6. (Optional) Run probe-count number
The number of probes to be sent each time is set for the NQA test instance.
By default, the number of probes is 3.
By sending probes multiple times in an NQA test instance, you can accurately estimate
network quality based on the collected statistics.
7. (Optional) Run interval seconds interval
The interval at which probe packets are sent is set.
The default interval is 4 seconds for an NQA ICMP test instance.
NOTE
NOTE
The destination address of an NQA test instance cannot be the destination address of an associated
IPv6 static route.
If the IPv6 static route associated with an NQA test instance is associated with another NQA test
instance, the IPv6 static route is disassociated from the first NQA test instance.
2. Run commit
----End
Procedure
l Run the display static-route ipv6 routing-table command to check information about
IPv6 static routes.
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
Networking Requirements
Servers on different network segments are connected using several Switchs. Every two
servers on different network segments can communicate with each other without using
dynamic routing protocols.
Server2
10.1.2.2/24
10GE1/0/3
VLANIF40
10.1.2.1/24
10GE1/0/1 10GE1/0/2
VLANIF10 VLANIF20
10.1.4.2/30 10.1.4.5/30
SwitchB
SwitchA SwitchC
10GE1/0/1 10GE1/0/1
VLANIF10 VLANIF20
10.1.4.1/30 10.1.4.6/30
10GE1/0/2 10GE1/0/2
VLANIF30 VLANIF50
10.1.1.1/24 10.1.3.1/24
Server1 Server3
10.1.1.2/24 10.1.3.2/24
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs, add interfaces to the VLANs, and assign IPv4 addresses to VLANIF
interfaces so that directly-connected interfaces can communicate with each other.
2. Configure the IPv4 default gateway on each server, and configure IPv4 static routes and
default routes on each Switch so that servers on different network segments can
communicate with each other.
Procedure
Step 1 Create VLANs and add interfaces to the VLANs.
<HUAWEI> system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] vlan 10
[*SwitchA-vlan10] quit
[*SwitchA] vlan 30
[*SwitchA-vlan30] quit
[*SwitchA] interface 10ge 1/0/1
[*SwitchA-10GE1/0/1] port link-type trunk
[*SwitchA-10GE1/0/1] port trunk allow-pass vlan 10
[*SwitchA-10GE1/0/1] quit
[*SwitchA] interface 10ge 1/0/2
The configurations of SwitchB and SwitchC are similar to that of SwitchA, and are not
mentioned here.
Step 2 Assign IPv4 addresses to the VLANIF interfaces.
[~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
[*SwitchA] commit
The configurations of SwitchB and SwitchC are similar to that of SwitchA, and are not
mentioned here.
Step 3 Configure servers.
Set the Server1 default gateway to 10.1.1.1, the Server2 default gateway to 10.1.2.1, and the
Server3 default gateway to 10.1.3.1.
Step 4 Configure static routes.
# Configure an IPv4 default route on SwitchA.
[~SwitchA] ip route-static 0.0.0.0 0.0.0.0 10.1.4.2
[*SwitchA] commit
----End
Configuration Files
l Configuration file of SwitchA
#
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 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port default vlan 30
#
ip route-static 0.0.0.0 0.0.0.0 10.1.4.2
#
return
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 devices can communicate with each other.
2. Configure the IPv6 default gateway on each host, and configure IPv6 static routes and
default static routes on each Switch so that hosts on different network segments can
communicate with each other without using dynamic routing protocols.
Procedure
Step 1 Add interfaces to VLANs.
<HUAWEI> system-view
[~HUAWEI] sysname SwitchA
[*SwitchA] vlan batch 10 20
[*SwitchA] interface 10ge 1/0/2
[*SwitchA-10GE1/0/2] port link-type trunk
[*SwitchA-10GE1/0/2] port trunk allow-pass vlan 10
[*SwitchA-10GE1/0/2] commit
[~SwitchA-10GE1/0/2] quit
[~SwitchA] interface 10ge 1/0/1
[~SwitchA-10GE1/0/1] port link-type trunk
[*SwitchA-10GE1/0/1] port trunk allow-pass vlan 20
[*SwitchA-10GE1/0/1] commit
[~SwitchA-10GE1/0/1] quit
The configurations of SwitchB and SwitchC are similar to that of SwitchA. The detailed
configurations are not mentioned here.
Step 2 Assign IP addresses to the VLANIF interfaces.
[~SwitchA] interface vlanif 10
[*SwitchA-Vlanif10] ipv6 enable
[*SwitchA-Vlanif10] ipv6 address fc00:0:0:2001::1/64
[*SwitchA-Vlanif10] commit
[~SwitchA-Vlanif10] quit
[~SwitchA] interface vlanif 20
[*SwitchA-Vlanif20] ipv6 enable
[*SwitchA-Vlanif20] ipv6 address fc00:0:0:2004::1/64
[*SwitchA-Vlanif20] commit
[~SwitchA-Vlanif20] quit
The configurations of SwitchB and SwitchC are similar to that of SwitchA. The detailed
configurations are not mentioned here.
Step 3 Configure the host addresses and gateways.
Configure an IPv6 address for each host according to the networking diagram. Configure the
default gateway of PC1 to FC00:0:0:2001::1, that of PC2 to FC00:0:0:2002::1, and that of
Host3 to FC00:0:0:2003::1.
Step 4 Configure static IPv6 routes.
Destinations : 6 Routes :
6
Destination : :: PrefixLength :
0
NextHop : FC00:0:0:2004::2 Preference :
60
Cost : 0 Protocol :
Static
RelayNextHop : :: TunnelID :
0x0
Interface : Vlanif20 Flags :
D
Direct
RelayNextHop : :: TunnelID :
0x0
Interface : Vlanif20 Flags :
D
----End
Configuration Files
l Configuration file of SwitchA
#
sysname SwitchA
#
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:2004::1/64
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
interface 10GE1/0/2
Figure 2-8 Networking diagram for configuring dynamic BFD for IPv4 static routes
SwitchA SwitchB
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure dynamic BFD for IPv4 static routes to implement millisecond-level link fault
detection between SwitchA and SwitchB. This configuration can improve convergence
speed of static routes.
Procedure
Step 1 Add interfaces to VLANs.
<HUAWEI> system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] vlan 10
[*SwitchA-vlan10] quit
[*SwitchA] interface 10ge 1/0/1
[*SwitchA-10GE1/0/1] port link-type trunk
[*SwitchA-10GE1/0/1] port trunk allow-pass vlan 10
[*SwitchA-10GE1/0/1] quit
[*SwitchA] vlan 20
[*SwitchA-vlan20] quit
[*SwitchA] interface 10ge 1/0/2
[*SwitchA-10GE1/0/2] port link-type trunk
[*SwitchA-10GE1/0/2] port trunk allow-pass vlan 20
[*SwitchA-10GE1/0/2] quit
[*SwitchA] commit
The configuration of SwitchB is similar to that of SwitchA, and is not mentioned here.
Step 2 Assign IP addresses to the VLANIF interfaces.
[~SwitchA] interface vlanif 10
[*SwitchA-Vlanif10] ip address 192.168.1.1 24
[*SwitchA-Vlanif10] quit
[*SwitchA] interface vlanif 20
[*SwitchA-Vlanif20] ip address 10.7.1.1 24
[*SwitchA-Vlanif20] quit
[*SwitchA] commit
The configuration of SwitchB is similar to that of SwitchA, and is not mentioned here.
# When the configuration is complete, run the display bfd session all verbose command on
SwitchA and SwitchB. The command output shows that the BFD session is established, the
BFD session status is Up, and static routes are bound to BFD sessions.
--------------------------------------------------------------------------------
----End
Configuration Files
l Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 10 20
#
bfd
#
interface Vlanif10
ip address 192.168.1.1 255.255.255.0
#
interface Vlanif20
ip address 10.7.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
ip route-static bfd 192.168.1.2 local-address 192.168.1.1
ip route-static 10.8.1.1 255.255.255.0 192.168.1.2 bfd enable
#
return
Figure 2-9 Networking diagram for configuring dynamic BFD for IPv6 static routes
10GE1/0/2 10GE1/0/1 10GE1/0/2
FC00:0:0:2007::1/64 FC00:0:0:2200::1/64 FC00:0:0:2008::1/64
Configuration Roadmap
To meet the preceding requirement, configure dynamic BFD for IPv6 static routes. The
configuration roadmap is as follows:
1. Configure dynamic BFD for IPv6 static routes so that link faults between SwitchA and
SwitchB can be detected within milliseconds to speed up route convergence.
Procedure
Step 1 Configure IPv6 addresses for interfaces. The configuration details are not provided here.
----End
Configuration Files
l Configuration file of SwitchA
#
sysname SwitchA
#
bfd
#
interface 10GE1/0/1
undo portswitch
ipv6 enable
ipv6 address FC00:0:0:2200::1/64
#
interface 10GE1/0/2
undo portswitch
ipv6 enable
ipv6 address FC00:0:0:2007::1/64
#
ipv6 route-static bfd FC00:0:0:2200::2 local-address FC00:0:0:2200::1
ipv6 route-static FC00:0:0:2008:: 64 FC00:0:0:2200::2 bfd enable
#
return
#
bfd
#
interface 10GE1/0/1
undo portswitch
ipv6 enable
ipv6 address FC00:0:0:2200::2/64
#
interface 10GE1/0/2
undo portswitch
ipv6 enable
ipv6 address FC00:0:0:2008::1/64
#
ipv6 route-static bfd FC00:0:0:2200::1 local-address FC00:0:0:2200::2
ipv6 route-static FC00:0:0:2007:: 64 FC00:0:0:2200::1 bfd enable
#
return
2.9.5 Example for Configuring Static BFD for IPv4 Static Routes
Networking Requirements
As shown in Figure 2-10, you can configure the default static route on SwitchA so that
SwitchA can connect to the external network. Millisecond-level link fault detection must be
implemented between SwitchA and SwitchB to improve convergence speed.
Figure 2-10 Networking diagram for configuring static BFD for static routes
SwitchA SwitchB
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a BFD session between SwitchA and SwitchB.
2. Configure a default route from SwitchA to another device and bind a BFD session to the
default route. This configuration can implement millisecond-level link fault detection
and improve convergence speed of static routes.
Procedure
Step 1 Create VLANs, add interfaces to the VLANs, and assign IP addresses to the VLANIF
interfaces. (Details are not mentioned here.)
Step 2 Configure device names. (Details are not mentioned here.)
[*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
Step 4 Configure a default static route and bind a BFD session to the default static route.
# Configure a default static route to the external network on SwitchA and bind the default
static route to the BFD session named aa.
[~SwitchA] ip route-static 0.0.0.0 0 10.1.1.2 track bfd-session aa
[*SwitchA] commit
# Check the IP routing table on SwitchA, and you can find that the static route exists in the
routing table.
[~SwitchA] display ip routing-table
Proto: Protocol Pre: Preference
Route Flags: R -
relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table: _Public_
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 10.1.1.2 Vlanif10
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
# Check the routing table on SwitchA, and you can find that the default static route 0.0.0.0/0
does not exist. This is because when the default static route is bound to a BFD session, BFD
rapidly notifies that the bound static route is unavailable after BFD detects a link fault.
[~SwitchA] display ip routing-table
Proto: Protocol Pre: Preference
Route Flags: R -
relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table: _Public_
Destinations : 2 Routes : 2
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
----End
Configuration Files
l Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 10
#
bfd
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
ip route-static 0.0.0.0 0.0.0.0 10.1.1.2 track bfd-session aa
#
bfd aa bind peer-ip 10.1.1.2
discriminator local 10
discriminator remote 20
#
return
2.9.6 Example for Configuring Static BFD for IPv6 Static Routes
Networking Requirements
As shown in Figure 2-11, SwitchA and SwitchB connect to each other and have static routes
configured between them. Customers require that a link fault between SwitchA and SwitchB
be detected within milliseconds and SwitchA and SwitchB dynamically update their routing
tables.
Figure 2-11 Networking diagram for configuring static BFD for IPv6 static routes
10GE1/0/1 10GE1/0/2
FC00:0:0:2001::1/64 FC00:0:0:2002::1/64
10GE1/0/1
SwitchA FC00:0:0:2001::2/64 SwitchB
Configuration Roadmap
To meet the preceding requirement, configure static BFD for IPv6 static routes. The
configuration roadmap is as follows:
1. Configure a BFD session between SwitchA and SwitchB to implement millisecond-level
fault detection.
2. Configure a static route from SwitchA to SwitchB and bind the static route to the BFD
session so that SwitchA and SwitchB can update their routing tables after a fault is
detected.
Procedure
Step 1 Configure IPv6 addresses for interfaces. The configuration details are not provided here.
Step 2 Configure a BFD session between SwitchA and SwitchB.
# On SwitchA, create a BFD session with SwitchB.
<SwitchA> system-view
[~SwitchA] bfd
[*SwitchA-bfd] quit
[*SwitchA] bfd aa bind peer-ipv6 fc00:0:0:2001::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
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:0:0:2001::2 track bfd-session aa
[*SwitchA] commit
[~SwitchA] quit
# After the configurations are complete, run the display bfd session all command on SwitchA
or SwitchB. You can view that the BFD session has been established and in Up state. Run the
display current-configuration | include bfd command in the system view. You can view that
the default static route has already been bound to the BFD session.
D: Dynamic
session
IP: IP
session
IF: Single-hop
session
PEER: Multi-hop
session
LDP: LDP
session
TE: Traffic
Engineering
VXLAN: VXLAN
session
VSI: VSI PW
session
(w): State in
WTR
(*): State is
invalid
--------------------------------------------------------------------------------
10 20
FC00:0:0:2004::2
Up S/IP-PEER
-
--------------------------------------------------------------------------------
# Check the IPv6 routing table on SwitchA. You can view that the default static route exists in
the routing table.
<SwitchA> display ipv6 routing-table
Route
Flags: R - relay, D - download to fib, T - to
vpn-instance, B - black hole route
----------------------------------------------------------------------------
Routing Table : _public_
Destinations : 5 Routes : 5
Destination : :: PrefixLength : 0
NextHop : FC00:0:0:2001::2 Preference : 60
Cost : 0 Protocol : Static
RelayNextHop : :: TunnelID : 0x0
Interface : 10GE1/0/1 Flags : RD
# Check the routing table on SwitchA. You can view that the default static route 0::0/0 does
not exist. This is because the default static route is bound to the BFD session. After BFD
detects a link fault, BFD rapidly notifies SwitchA that the static route is unavailable.
<SwitchA> display ipv6 routing-table
Route
Flags: R - relay, D - download to fib, T - to
vpn-instance, B - black hole route
----------------------------------------------------------------------------
Routing Table : _public_
Destinations : 1 Routes : 1
----End
Configuration Files
l Configuration file of SwitchA
#
sysname SwitchA
#
bfd
#
interface 10GE1/0/1
undo portswitch
ipv6 enable
ipv6 address FC00:0:0:2001::1/64
#
bfd aa bind peer-ipv6 FC00:0:0:2001::2
discriminator local 10
discriminator remote 20
#
ipv6 route-static :: 0 FC00:0:0:2001::2 track bfd-session aa
#
return
2.9.7 Example for Configuring FRR for IPv4 Static Routes on the
Public Network
Networking Requirements
As shown in Figure 2-12, two static routes with next hops being SwitchA and SwitchB
respectively are configured on SwitchT. Link B functions as the backup of link A. If link A is
faulty, traffic can be switched to link B in a timely manner.
Figure 2-12 Networking diagram for configuring FRR for IPv4 static routes on the public
network
10GE1/0/1 10GE1/0/2
VLANIF20 VLANIF40
192.168.10.2/24 192.168.11.2/24
10GE1/0/2 10GE1/0/2
VLANIF20
SwitchA VLANIF40
192.168.10.1/24 Link A 192.168.11.1/24
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure two static routes with next hops being SwitchA and SwitchB respectively on
SwitchT so that the devices can communicate with each other.
2. Set a higher preference for link A on SwitchT to ensure that link A functions as the
primary link and link B functions as the backup of link A.
3. Enable FRR for static routes on SwitchT so that traffic can be quickly switched to link B
if link A is faulty.
Procedure
Step 1 Create VLANs, add interfaces to the VLANs, and assign IP addresses to the VLANIF
interfaces. (Details are not mentioned here.)
Step 2 Configure device names. (Details are not mentioned here.)
# Check the IP routing table on SwitchT. You can view that the two static routes are in load
balancing mode.
[~SwitchT] display ip routing-table
Proto: Protocol Pre: Preference
Route Flags: R -
relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table : _public_
Destinations : 11 Routes : 12
# Check the IP routing table on SwitchT, and you can view that preferences of the static
routes are changed.
[~SwitchT] display ip routing-table
Proto: Protocol Pre: Preference
Route Flags: R -
relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table : _public_
Destinations : 10 Routes : 10
# Check information about the backup outbound interface and backup next hop on SwitchT.
[~SwitchT] display ip routing-table 172.17.1.0 verbose
Route Flags: R -
relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table : _public_
Summary Count : 1
Destination: 172.17.1.0/24
Protocol: Static Process ID: 0
Preference: 40 Cost: 0
NextHop: 192.168.10.2 Neighbour: 0.0.0.0
State: Active Adv Age: 00h00m03s
Tag: 0 Priority: medium
Label: NULL QoSInfo: 0x0
IndirectID: 0x31000032
RelayNextHop: 0.0.0.0 Interface: Vlanif20
TunnelID: 0x0 Flags: D
BkNextHop: 192.168.20.2 BkInterface: Vlanif30
BkLabel: NULL SecTunnelID: 0x0
BkPETunnelID: 0x0 BkPESecTunnelID: 0x0
BkIndirectID: 0x32000033
Destination: 172.17.1.0/24
Protocol: Static Process ID: 0
Preference: 60 Cost: 0
NextHop: 192.168.20.2 Neighbour: 0.0.0.0
State: Active Adv Age: 00h00m07s
Tag: 0 Priority: medium
Label: NULL QoSInfo: 0x0
IndirectID: 0x32000033
RelayNextHop: 0.0.0.0 Interface: Vlanif30
TunnelID: 0x0 Flags: D
----End
Configuration Files
l Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 20 40
#
interface Vlanif20
ip address 192.168.10.2 255.255.255.0
#
interface Vlanif40
ip address 192.168.11.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 20
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 40
#
ip route-static 172.16.1.0 255.255.255.0 vlanif 20 192.168.10.1
ip route-static 172.17.1.0 255.255.255.0 vlanif 40 192.168.11.1
#
return
Figure 2-13 Networking diagram for configuring NQA for static IPv4 routes
IP Network
10GE1/0/1 10GE1/0/2
VLANIF30 VLANIF40
172.16.3.1/24 172.16.4.1/24
SwitchA
10GE1/0/1 GE1/0/2
VLANIF30 VLANIF40
172.16.3.2/24 172.16.4.2/24
SwitchB /3 SwitchC
E 1/0 0
10GE1/0/2 G 6 10GE1/0/1
10
GE 10 ANIF .1/24
VLANIF10 V
1 LA 1/0 VL 16.6 VLANIF20
172.16.1.1/24 72.1 NIF /3 2. V 172.16.2.1/24
6.5 50 17 17 LAN
.1/ 2.1 IF
VLANIF10 24 0 6.5 50 VLANIF20
172.16.1.2/24 I F6 /24 .2/
24 172.16.2.2/24
L AN .6.2
V 16
VLANIF70 2. VLANIF80
17
172.16.7.1/24 SwitchD SwitchE 172.16.8.1/24
...... ......
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure IP addresses and OSPF on each switch, and configure the cost of each link so
that SwitchB functions as the master switch and SwitchC functions as the backup switch.
2. Create an ICMP NQA test instance to monitor the link between SwitchB and SwitchD,
and configure static routes destined for clients on SwitchB SwitchC. Associate the static
route with the NQA test instance to implement fast link fault detection and service
switchover.
NOTE
When a static route is associated with an NQA test instance, only ICMP test instances are used to test
whether there are reachable routes between the source and destination.
Procedure
Step 1 Create VLANs and add interfaces to the VLANs.
<HUAWEI> system-view
[~HUAWEI] sysname SwitchA
[*HUAWEI] commit
[~SwitchA] vlan 30
[*SwitchA-vlan30] quit
[*SwitchA] vlan 40
[*SwitchA-vlan40] quit
[*SwitchA] interface 10ge 1/0/1
The configurations of SwitchB and SwitchC are similar to that of SwitchA, and are not
mentioned here.
Step 2 Assign IPv4 addresses to the VLANIF interfaces.
[~SwitchA] interface vlanif 30
[*SwitchA-Vlanif30] ip address 172.16.3.1 24
[*SwitchA-Vlanif30] quit
[*SwitchA] interface vlanif 40
[*SwitchA-Vlanif40] ip address 172.16.4.1 24
[*SwitchA-Vlanif40] quit
[*SwitchA] commit
The configurations of SwitchB and SwitchC are similar to that of SwitchA, and are not
mentioned here.
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 172.16.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] commit
[~SwitchB-nqa-user-test] quit
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
[*SwitchA-ospf-1] area 0.0.0.0
[*SwitchA-ospf-1-area-0.0.0.0] network 172.16.3.0 0.0.0.255
[*SwitchA-ospf-1-area-0.0.0.0] network 172.16.4.0 0.0.0.255
[*SwitchA-ospf-1-area-0.0.0.0] quit
[*SwitchA-ospf-1] quit
[*SwitchA] commit
[*SwitchB-ospf-1] quit
[*SwitchB] commit
# Configure OSPF on SwitchC to import a static route, and set the cost of the static route to
20.
[~SwitchC] ospf 1
[*SwitchC-ospf-1] import-route static cost 20
[*SwitchC-ospf-1] commit
[~SwitchC-ospf-1] quit
The command output shows "Lost packet ratio 0 %", indicating that the link is running
properly.
# Check the routing table on SwitchB.
[~SwitchB] display ip routing-table
The command output shows that the static route exists in the routing table.
# Check the routing table on SwitchA.
[~SwitchA] display ip routing-table
Proto: Protocol Pre: Preference
Route Flags: R -
relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table : _public_
Destinations : 11 Routes : 11
The command output shows that a route to 172.16.7.0/24 exists in the routing table. The
route's next hop address is 172.16.3.2 and cost is 10. Traffic is preferentially transmitted along
the link SwitchB->SwitchD.
# Shut down 10GE1/0/2 on SwitchB to simulate a link fault.
[~SwitchB] interface 10ge 1/0/2
[~SwitchB-10GE1/0/2] shutdown
[*SwitchB-10GE1/0/2] commit
[~SwitchB] quit
The command output shows "Completion:failed" and "Lost packet ratio: 100 %," indicating
that the link is faulty.
The command output shows that the static route has been deleted.
On SwitchB, the NQA test instance is associated with a static route. When NQA detects a link
fault, it immediately notifies SwitchB that the static route bound to the link is unreachable.
SwitchA cannot learn the route to 172.16.7.0/24 from SwitchB, but it can learn the route to
172.16.7.0/24 from SwitchC. Therefore, you can view that the route to 172.16.7.0/24 has a
next hop 172.16.4.2 and cost 20. Service traffic is then switched to the link SwitchC-
>SwitchD.
----End
Configuration Files
l Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 30 40
#
interface Vlanif30
ip address 172.16.3.1 255.255.255.0
#
interface Vlanif40
ip address 172.16.4.1 255.255.255.0
#
interface 10GE1/0/1
port link-type
trunk
port trunk allow-pass vlan 30
#
interface 10GE1/0/2
port link-type
trunk
port trunk allow-pass vlan 40
#
ospf 1
area 0.0.0.0
network 172.16.3.0 0.0.0.255
network 172.16.4.0 0.0.0.255
#
return
ospf 1
import-route static cost 10
area 0.0.0.0
network 172.16.3.0 0.0.0.255
#
ip route-static 172.16.7.0 255.255.255.0 Vlanif 10 172.16.1.2 track nqa user
test
#
nqa test-instance user test
test-type icmp
destination-address ipv4 172.16.1.2
interval seconds 5
timeout 4
probe-count 2
frequency 10
start now
#
return