Enterprise products and services are set forth in the express warranty statements accompanying such
products and services. Nothing herein should be construed as constituting an additional warranty. Hewlett
Packard Enterprise shall not be liable for technical or editorial errors or omissions contained herein.
Confidential computer software. Valid license from Hewlett Packard Enterprise required for possession, use, or
copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software
Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s
standard commercial license.
Links to third-party websites take you outside the Hewlett Packard Enterprise website. Hewlett Packard
Enterprise has no control over and is not responsible for information outside the Hewlett Packard Enterprise
website.
Acknowledgments
Intel®, Itanium®, Pentium®, Intel Inside®, and the Intel Inside logo are trademarks of Intel Corporation in the
United States and other countries.
Microsoft® and Windows® are trademarks of the Microsoft group of companies.
Adobe® and Acrobat® are trademarks of Adobe Systems Incorporated.
Java and Oracle are registered trademarks of Oracle and/or its affiliates.
UNIX® is a registered trademark of The Open Group.
Contents
Configuring basic IP routing ··········································································· 1
Routing table ······················································································································································ 1
Dynamic routing protocols·································································································································· 2
Route preference ··············································································································································· 2
Load sharing ······················································································································································ 3
Route backup ····················································································································································· 3
Route recursion ·················································································································································· 3
Route redistribution ············································································································································ 3
Extension attribute redistribution ························································································································ 3
Setting the maximum lifetime for routes and labels in the RIB··········································································· 4
Setting the maximum lifetime for routes in the FIB ···························································································· 4
Enabling the RIB to flush route attribute information to the FIB ········································································· 5
Setting the maximum number of ECMP routes ·································································································· 5
Configuring RIB NSR ········································································································································· 6
Controlling RIP reception and advertisement on interfaces ····································································· 28
Configuring a RIP version ························································································································ 29
Configuring RIP route control ··························································································································· 29
Configuring an additional routing metric ··································································································· 29
Configuring the RIP packet sending rate ································································································· 37
Setting the maximum length of RIP packets ···························································································· 38
Setting the DSCP value for outgoing RIP packets ··················································································· 38
Configuring RIP GR ········································································································································· 38
Enabling RIP NSR············································································································································ 39
Configuring BFD for RIP ·································································································································· 39
Configuring an additional metric for a RIP interface················································································· 48
Configuring RIP to advertise a summary route ························································································ 49
Configuring RIP GR ································································································································· 52
OSPF areas ············································································································································· 66
DR and BDR ············································································································································ 70
Protocols and standards ·························································································································· 71
OSPF configuration task list ····························································································································· 71
Enabling OSPF ················································································································································ 73
Enabling OSPF on a network ··················································································································· 74
Enabling OSPF on an interface················································································································ 74
Configuring OSPF areas ·································································································································· 75
Configuring a stub area ···························································································································· 75
Configuring an NSSA area ······················································································································· 76
ii
Configuring a virtual link ··························································································································· 76
Configuring OSPF network types ····················································································································· 77
Configuring the broadcast network type for an interface·········································································· 77
Configuring the NBMA network type for an interface ··············································································· 77
Configuring the P2MP network type for an interface················································································ 78
Configuring the P2P network type for an interface··················································································· 79
Configuring OSPF route control ······················································································································· 79
Advertising a host route ··························································································································· 84
Excluding interfaces in an OSPF area from the base topology································································ 84
Tuning and optimizing OSPF networks ············································································································ 84
Configuration procedure ························································································································· 101
Advertising OSPF link state information to BGP ···························································································· 103
Displaying and maintaining OSPF ················································································································· 103
OSPF configuration examples ······················································································································· 104
Basic OSPF configuration example ······································································································· 104
OSPF route redistribution configuration example ·················································································· 107
iii
OSPF route summarization configuration example ················································································ 109
OSPF stub area configuration example ································································································· 112
OSPF NSSA area configuration example ······························································································ 114
OSPF DR election configuration example ······························································································ 116
OSPF virtual link configuration example ································································································ 121
OSPF GR configuration example ··········································································································· 123
IS-IS address format ······························································································································ 135
NET ························································································································································ 136
IS-IS area ··············································································································································· 137
Setting the IS level and circuit level ······································································································· 143
Configuring P2P network type for an interface ······················································································· 143
Configuring IS-IS route control ······················································································································· 144
Advertising IS-IS link state information to BGP ······················································································ 149
Tuning and optimizing IS-IS networks ··········································································································· 150
Configuring a BGP peer group ··············································································································· 217
Specifying the source address of TCP connections ··············································································· 227
Generating BGP routes ·································································································································· 228
Injecting a local network ························································································································· 228
Redistributing IGP routes ······················································································································· 230
Controlling route distribution and reception ··································································································· 232
Setting a preferred value for routes received ························································································· 251
Configuring preferences for BGP routes ································································································ 252
Configuring the default local preference ································································································ 254
Configuring the MED attribute ················································································································ 256
Configuring the NEXT_HOP attribute ···································································································· 260
Configuring the AS_PATH attribute ······································································································· 263
Ignoring IGP metrics during optimal route selection ·············································································· 269
v
Configuring the SoO attribute ················································································································· 270
Tuning and optimizing BGP networks ············································································································ 271
Configuring the keepalive interval and hold time ··················································································· 271
Setting the session retry timer ················································································································ 273
Configuring the interval for sending updates for the same route ··························································· 274
Enabling BGP to establish an EBGP session over multiple hops ·························································· 275
Enabling immediate re-establishment of direct EBGP connections upon link failure ····························· 276
Disabling optimal route selection for labeled routes without tunnel information ····································· 293
Configuring a large-scale BGP network ········································································································· 293
Configuring BGP community ·················································································································· 294
Configuring optional 6PE capabilities····································································································· 309
Configuring BGP LS ······································································································································· 311
Configuring basic BGP LS ····················································································································· 311
Configuring BGP LS route reflection ······································································································ 311
Specifying an AS number and a router ID for BGP LS messages ························································· 312
Configuring BMP ············································································································································ 312
Displaying and maintaining BGP···················································································································· 313
PBR and Track ······································································································································· 381
PBR configuration task list ····························································································································· 382
Configuring a policy········································································································································ 382
Creating a node ······································································································································ 382
Setting match criteria for a node ············································································································ 382
Configuring actions for a node ··············································································································· 383
Configuring PBR ············································································································································ 383
Configuring local PBR ···························································································································· 383
Configuring the OSPFv3 network type for an interface ·········································································· 432
Configuring an NBMA or P2MP neighbor ······························································································ 432
Configuring OSPFv3 route control ················································································································· 432
Configuring an IP prefix list ···················································································································· 503
Configuring an AS path list ····················································································································· 504
Configuring a community list ·················································································································· 504
Configuring an extended community list ································································································ 505
Configuring a MAC list ··························································································································· 505
Configuring a routing policy···························································································································· 505
Basic features ········································································································································ 515
DCN configuration task list ····························································································································· 515
Enabling DCN ················································································································································ 516
Configuring the NE ID and NE IP ··················································································································· 516
Configuring DCN VPN···································································································································· 516
Enabling the automatic report feature ············································································································ 517
Configuring the source MAC address of LLDP frames ·················································································· 517
Advertising the LLDP management address ································································································· 518
Enabling the system to issue the generated ARP entry to a Layer 3 Ethernet subinterface after a port receives
an LLDP frame ··············································································································································· 518
DCN configuration examples ························································································································· 519
Document conventions and icons ······························································ 525
Remote support ······································································································································ 528
Index ·········································································································· 530
x
Configuring basic IP routing
Criterion
Categories
The destination is a netw ork. T he subnet mask i s les s than 32
•
•
•
•
IP routing directs IP packet forwarding on routers based on a routing table. This chapter focuses on
unicast routing protoc ols. For more inf ormation about m ulticast routing protoco ls, see IP Multicast Configuration Guide.
Routing table
A RIB contains the global routing information and related information, including route recursion, route
redistribution, and ro ute extension information. The r outer selects optimal routes from the routing
table and puts them into the FIB table. It uses the FIB table to forward packets. For more information
about the FIB table, see Layer 3—IP Services Configuration Guide.
Table 1categorizes routes by different criteria.
Table 1 Route categories
•Network route—
Destination
bits.
•Host route—The destination is a host. The subnet mask is 32 bits.
Whether the
destination is directly
connected
Origin
• Direct route—The destination is directly connected.
• Indirect route—The destination is indirectly connected.
• Direct route—A direct route is discovered by the data link protocol on an
interface, and is also called an interface route.
• Static route—A static route is manually configured by an administrator.
• Dynamic route—A dy nami c route is dynamically discovered by a routing
protocol.
To view brief information about a routing table, use the display ip routing-table command.
<Sysname> display ip routing-table
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
3.3.3.3/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
...
A route entry includes the following key items:
Destination—IP address of the destination host or network. Mask—Mask length of the IP address. Proto—Protocol that installed the route. Pre—Preference of the route. Among routes to the same destination, the route with the highest
preference is optimal.
1
•
•
•
Criterion
Categories
Route type
Preference
Cost—If multiple routes to a destination have the same preference, the one with the smallest
cost is the optimal route.
NextHop—Next hop. Interface—Output interface.
Dynamic routing protocols
Static routes work well in small, stable networks. They are easy to configure and require fewer
system resources. However, in networks where topology changes occur frequently, a typical practice
is to configure a dynamic routing protocol. Compared with static routing, a dynamic routing protocol
is complicated to configure, requires more router resources, and consumes more network resources.
Dynamic routing protocols dynamically collect and report reachability information to adapt to
topology changes. They are suitable for large networks.
Dynamic routing protocols can be classified by different criteria, as shown in Table 2.
Table 2 Categories of dynamic routing protocols
Operation scope
Routing algorithm
Destination address
type
IP version
• IGPs—Work within an AS. Examples include RIP, OSPF, and IS-IS.
• EGPs—Work between ASs. The most popular EGP is BGP.
• Distance-vector protocols—Examples include RIP and BGP. BGP is also
considered a path-vector protocol.
• Link-state protocols—Examples include OSPF and IS-IS.
• Unicast routing protocols—Examples include RIP, OSPF, BGP, and IS-IS.
• Multicast routing protocols—Examples include PIM-SM and PIM-DM.
• IPv4 routing protocols—Examples include RIP, OSPF, BGP, and IS-IS.
• IPv6 routing protocols—Examples include RIPng, OSPFv3, IPv6 BGP, and
IPv6 IS-IS.
An AS refers to a group of routers that use the same routing policy and work under the same
administration.
Route preference
Routing protocols, includ in g stat ic and direc t r out ing, eac h b y defau lt have a preference. If they find
multiple routes to the sam e destinat ion, the router s elect s the r oute with the hig hest pref erence as
the optimal route.
The preference of a direct route is always 0 and cannot be changed. Y ou can configure a preference
for each static route and each dynamic routing protocol. The following table lists the route types and
default preferences. The smaller the value, the higher the preference.
RIP 100
OSPF ASE 150
OSPF NSSA 150
IBGP 255
EBGP 255
Unknown (route from an unt r u sted source) 256
Load sharing
A routing protocol might find multiple optimal equal-cost routes to the same destination. You can use
these routes to implement equal-cost multi-path (ECMP) load sharing.
Route backup can im prove network availability. Among m ultiple rout es to the s ame destin ation, the
route with the highest priority is the prim ary route and others are secondary routes.
The router forwards m atc hing packets through the prim ary route. W hen the primar y route fails, the
route with the highest preference among the secondary routes is selected to forward packets. When
the primary route recovers, the router uses it to forward packets.
Route recursion
To use a BGP, static, or RIP rout e t hat h as a n ind irec tl y co nnec t ed nex t ho p, a r o uter must perform
route recursion to find the output interface to reach the next hop.
Link-state routing pro tocols, such as O SPF and IS-IS, do not need route rec ursion, because th ey
obtain directly connected next hops through route calculation.
The RIB records and sa ves route recursion informati on, including brief information abo ut related
routes, recursive paths, and recur sion dep th.
Route redistribution
Route redistribution enables routing protocols to learn routing information from each other. A
dynamic routing pr otocol can redistribute routes from other routing protocols, including direct and
static routing. For more inform ation, see the respective chapt ers on those routi ng protocols i n this
configuration guide.
The RIB records redistribution relationships of routing protocols.
Extension attribute redistribution
Extension attribute redistribution enables routi ng protocols to learn route extension attri butes from
each other, including BGP extended comm unity attributes , OSPF area IDs , rout e types, and r outer
IDs.
3
The RIB records extended attributes of each routing protocol and redistribution relationships of
Step
Command
Remarks
rib
Step
Command
Remarks
Step
Command
Remarks
different routing protocol extended attributes.
Setting the maximum lifetime for routes and labels
in the RIB
Perform this task to prevent rout es of a certain protocol from being aged out due to slo w protocol
convergence resulting from a large number of route entries or long GR period.
The configuration takes effect at the next protocol or RIB process switchover.
To set the maximum lifetime for routes and labels in the RIB (IPv4):
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv4 address
family and enter its view.
4. Set the maximum lifetime for
IPv4 routes and labels in the
RIB.
To set the maximum route lifetime for routes and labels in the RIB (IPv6):
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv6 address
family and enter its view.
4. Set the maximum lifetime for
IPv6 routes and labels in the
RIB.
system-view
address-family ipv4
protocol
instance-name ]
system-view
rib
address-family ipv6
protocol
instance-name ]
protocol [
protocol [
instance
lifetime
instance
lifetime
seconds
seconds
N/A
N/A
By default, no RIB IPv4
address family exists.
By default, the maximum
lifetime for routes and labels
in the RIB is 480 seconds.
N/A
N/A
By default, no RIB IPv6
address family exists.
By default, the maximum
lifetime for routes and labels
in the RIB is 480 seconds.
Setting the maximum lifetime for routes in the FIB
When GR or NSR is disabled, FIB entries m ust be ret ained for s ome tim e after a protoco l proces s
switchover or RIB proces s switcho ver. When GR or NSR is enab led, FIB entri es m ust be removed
immediately after a pro toc o l or RIB process s witcho ver to avoid routin g is sues . Pe r f orm this task to
meet such requirements.
To set the maximum lifetime for routes in the FIB (IPv4):
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv4 address
family and enter its view.
system-view
rib
address-family ipv4
4
N/A
N/A
By default, no RIB IPv4
address family exists.
Step
Command
Remarks
4. Set the maximum lifetime for
Step
Command
Remarks
Step
Command
Remarks
system-view
rib
Step
Command
Remarks
IPv4 routes in the FIB.
To set the maximum lifetime for routes in the FIB (IPv6):
fib lifetime
seconds
By default, the maximum
lifetime for routes in the FIB
is 600 seconds.
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv6 address
family and enter its view.
4. Set the maximum lifetime for
IPv6 routes in the FIB.
system-view
rib
address-family ipv6
fib lifetime
seconds
N/A
N/A
By default, no RIB IPv6
address family exists.
By default, the maximum
lifetime for routes in the FIB
is 600 seconds.
Enabling the RIB to flush route attribute
information to the FIB
This feature is a va ilabl e on l y f or BGP routes in the curr ent s of t ware vers io n. You can configure th is
feature when using sFlow to monitor BGP traffic. For more inform ation about BGP path attributes
—
and sFlow, see Layer 3
Configuration Guide.
To enable RIB to flush route attribute information to the FIB:
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv4 address
family and enter its view.
4. Enable the RIB to flush route
attribute information to the
FIB.
IP Routing Configuration Guide and Network Management and Monitoring
N/A
N/A
address-family ipv4
flush route-attribute
protocol
By default, no RIB IPv4
address family exists.
By default, the RIB does not
flush route attribute
information to the FIB.
Setting the maximum number of ECMP routes
This configuration takes effect at reboot. Make sure the reboot does not impact your network.
To set the maximum number of ECMP routes:
1. Enter system view.
2. Set the maximum number of
ECMP routes.
system-view
max-ecmp-num
5
number
N/A
By default, the maximum
number of ECMP routes is
not set.
Configuring RIB NSR
IMPORTANT:
Use this feature with protocol GR or NSR to avoid route timeouts and traffic interruption.
Step
Command
Remarks
Step
Command
Remarks
CAUTION:
This feature
faulty route, which might cause loops.
When an active/standby switchover occurs, nonstop routing (NSR) backs up routing information
from the active process to the standby process to a void routing flapping and ensure forwarding
continuity.
RIB NSR provides faster route convergence than protocol NSR during an active/standby switchover.
Configuring IP v4 RIB NSR
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv4 address
family and enter its view.
4. Enable IPv4 RIB NSR.
system-view
rib
address-family ipv4
non-stop-routing
Configuring IP v6 RIB NSR
N/A
N/A
By default, no RIB IPv4
address family exists.
By default, RIB NSR is
disabled.
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv6 address
family and enter its view.
4. Enable IPv6 RIB NSR.
system-view
rib
address-family ipv6
non-stop-routing
Configuring inter-protocol FRR
Inter-protocol fast reroute (FRR) enables fast rerouting between routes of different protocols. A
backup next hop is automatically selected to reduce the service interruption time caused by
unreachable next hops. W hen the next hop of the prim ary link fails, the traffic is redirected to the
backup next hop.
Among the routes to the same destination in the RIB, a router adds the route with the highest
preference to the FIB tab le. For example, if a static route and an O SPF route in the RI B have the
same destination, the router adds the OSPF ro ute to the FI B table by def ault. The next hop of the
static route is selected as the backup next hop for the OSPF route. When the next hop of the OSPF
route is unreachable, the backup next hop is used.
uses the next hop of a route from a different protocol as the backup next hop for the
N/A
N/A
By default, no RIB IPv6
address family exists.
By default, RIB NSR is
disabled.
6
Configuring IP v4 RIB inter-protoc ol FRR
Step
Command
Remarks
Step
Command
Remarks
rib
Step
Command
Remarks
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv4 address
family and enter its view.
4. Enable IPv4 RIB
inter-protocol FRR.
system-view
rib
address-family ipv4
inter-protocol fast-reroute
vpn-instance
[
vpn-instance-name ]
Configuring IP v6 RIB inter-protoc ol FRR
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv6 address
family and enter its view.
4. Enable IPv6 RIB
inter-protocol FRR.
system-view
address-family ipv6
inter-protocol fast-reroute
vpn-instance
[
vpn-instance-name ]
N/A
N/A
By default, no RIB IPv4
address family exists.
By default, inter-protocol
FRR is disabled.
If you do not specify a VPN
instance, inter-proto col FRR
is enabled for the public
network.
N/A
N/A
By default, no RIB IPv6
address family exists.
By default, inter-protocol
FRR is disabled.
If you do not specify a VPN
instance, inter-proto col FRR
is enabled for the public
network.
Configuring routing policy-based recursive lookup
When a route changes, the routing protocol has to perform a route recursion if the next hop is
indirectly connected. The routing protocol might select an incorrect path, which can cause traffic loss.
To prevent this problem, you can use a routing polic y to verify the recur sive route. If the recursive
route fails to m atch the routing policy, the routing protocol inval idates the rout e and marks it as
unreachable.
For the device to use exact routes to forward the traffic, make sure all desired routes can match the
routing policy.
To configure routing policy-based recursive lookup:
1. Enter system view.
2. Enter RIB view.
3. Create the RIB IPv4 address
family and enter its view.
system-view
rib
address-family ipv4
7
N/A
N/A
By default, no RIB IPv4 address
family exists.
Step
Command
Remarks
4. Configure routing
Task
Command
verbose ]
policy-based recursive
lookup.
protocol
recursive-lookup route-policy
route-policy-name
protocol
nexthop
By default, routing policy-based
recursive lookup is not
configured.
Displaying and maintaining a routing table
Execute display commands in any view and reset commands in user view.
Display routing table information.
Display information about routes
permitted by an IPv4 basic ACL.
Display information about routes to a
specific destination address.
Display information about routes to a
range of destination addresses.
Display information about routes
permitted by an IP prefix list.
Display information about routes
installed by a protocol.
Display IPv4 route statistics.
Display brief IPv4 routing table
information.
Display the maximum number of
ECMP routes.
Display route attribute information in
the RIB.
Display RIB GR state information.
display ip routing-table
verbose ]
[
display ip routing-table [ vpn-instance
ipv4-acl-number [
display ip routing-table
ip-address [ mask-length | mask ] [
display ip routing-table
ip-address1 to ip-address2 [
display ip routing-table [ vpn-instance
prefix-list
display ip routing-table [ vpn-instance
protocol
display ip routing-table [ vpn-instance
statistics
display ip routing-table
summary
display max-ecmp-num
display rib attribute
display rib graceful-restart
prefix-list-name [
protocol [
verbose ]
vpn-instance
[
vpn-instance
[
vpn-instance
[
verbose ]
verbose ]
inactive
[ attribute-id ]
verbose ]
|
vpn-instance
[
longer-match
vpn-instance-name ]
vpn-instance-name ]
vpn-instance-name ]
verbose ]
] [
vpn-instance-name ]
vpn-instance-name ]
vpn-instance-name ]
vpn-instance-name ]
vpn-instance-name ]
acl
Display next hop information in the
RIB.
Display next hop informatio n fo r direct
routes.
Clear IPv4 route statistics.
Display IPv6 routing tab le information.
Display information about rout es to an
IPv6 destination address.
Display information about routes
permitted by an IPv6 basic ACL.
Display information about routes to a
range of IPv6 destination addr esses.
Display information about routes
permitted by an IPv6 prefix list.
display rib nib
display rib nib protocol
display route-direct nib
reset ip routing-table statistics protocol [ vpn-instance
vpn-instance-name ] { protocol |
display ipv6 routing-table [ vpn-instance
verbose ]
[
display ipv6 routing-table [ vpn-instance
ipv6-address [ prefix-length ] [
display ipv6 routing-table [ vpn-instance
acl
ipv6-acl-number [
display ipv6 routing-table [ vpn-instance
ipv6-address1 to ipv6-address2 [
display ipv6 routing-table
prefix-list
8
self-originated
[
protocol [
[ nib-id ] [
verbose ]
prefix-list-name [
] [ nib-id ] [
verbose ]
verbose ]
all }
longer-match
vpn-instance
[
verbose ]
verbose
vpn-instance-name ]
vpn-instance-name ]
] [
vpn-instance-name ]
vpn-instance-name ]
vpn-instance-name ]
]
verbose ]
Task
Command
Display information about rout es
installed by an IPv6 protocol.
Static routes are m anuall y conf igured. If a net work 's topology is sim ple, you only nee d to co nfigure
static routes for the network to work correctly.
Static routes cannot ada pt t o net wor k topology changes. If a fault or a topological change oc c urs in
the network, the network administrator must modify the static routes manually.
Configuring a static route
Before you configure a static route, complete the following tasks:
Configure the physical parameters for related interfaces.
Configure the link-layer attributes for related interfaces.
Configure the IP addresses for related interfaces.
You can associate Track with a static route to m onitor the reachabil ity of the next hops. For m ore
information about Track, see High Availability Configuration Guide.
To configure a static route:
1. Enter system view.
2. (Optional.) Create a
static route group
and enter its view.
3. (Optional.) Add a
static route prefix to
the static route
group.
4. (Optional.) Return to
system view.
5. Configure a static
route.
ip route-static-group
prefix
dest-address { mask-length | mask }
quit
•Method 1:
ip route-static { dest-address { mask-length
By default, no static route
prefix is added to the static
route group.
N/A
By default, no static route is
configured.
10
Step
Command
Remarks
IMPORTANT:
Enabling BFD for a flapping route could worsen the situation.
•
•
Step
Command
Remarks
6. (Optional.) Enable
periodic sending of
ARP requests to the
next hops of static
routes.
7. (Optional.)
Configure the
default preference
for static routes.
8. (Optional.) Delete all
static routes,
including the default
route.
ip route-static arp-request interval
ip route-static default-preference
default-preference
delete [ vpn-instance
static-routes all
vpn-instance-name ]
interval
Configuring BFD for static routes
BFD provides a general-purpose, standard, medium-, and protocol-independent fast failure
detection mechanis m. It can uniformly and quickly detec t th e failures of the b id ire c tiona l f orwarding
paths between two routers for protocols, such as routing protocols and MPLS.
By default, the device does
not send ARP requests to
the next hops of static
routes.
The default setting is 60.
To delete one static route,
use the
route-static
undo ip
command.
For more information about BFD, see High Availability Configuration Guide.
Bidirectional c ontrol mode
To use BFD bidirectional control detection between two devices, enable BFD control mode for each
device's static route destined to the peer.
To configure a static route and enable BFD control mode, use one of the following methods:
Specify an output interface and a direct next hop. Specify an indirect next hop and a specific BFD packet source address for the static route.
To configure BFD control mode for a static route (direct next hop):
1. Enter system view.
2. Configure BFD
control mode for a
static route.
To configure BFD control mode for a static route (indirect next hop):
By default, BFD control
mode for a static route
is not configured.
11
Step
Command
Remarks
IMPORTANT:
Do not use BFD for a static route with the output interface in spoofing state.
Step
Command
Remarks
1. Enter system view.
2. Configure BFD
control mode for a
static route.
system-view
• Method 1:
• Method 2:
Single-hop echo mode
With BFD echo mode enabled for a static route, the output interface sends BFD echo packets to the
destination device, which loops the packets back to test the link reachability.
interface-number next-hop-address bfd
echo-packet [ preference preference ] [ tag
tag-value ] [ description text ]
ip-address
N/A
By default, the source
address of echo packets is
not configured.
For more information a bout
this command, see High
Availability Command
Reference.
By default, BFD echo mode
for a static route is not
configured.
12
•
•
•
•
•
•
Step
Command
Remarks
tag
description
Router A
Router BRouter E
Backup nexthop:
Router C
Nexthop:
Router D
Configuring static route FRR
A link or router failure on a path can cause packet loss and even routing loop. Static route fast reroute
(FRR) enables fast rerouting to minimize the impact of link or node failures.
Figure 1 Network diagram
As shown in Figure 1, upon a link failure, packets are directed to the backup next hop to avoid traffic
interruption. Y ou can either specify a backup next hop for FRR or enable FRR to automatically select
a backup next hop (which must be configured in advance).
Configuration guidelines
Do not use static route FRR and BFD (for a static route) at the same time.Static route does not take effect when the backup output interface is unavailable. Equal-cost routes do not support static route FRR. The backup output interface and next hop must be different from the primary output interface
and next hop.
To change the backup output interface or next hop, you must first remove the current setting. Static route FRR is available only when the state of primary link (with Layer 3 interfaces staying
up) changes from bidirectional to unidirectional or down.
Configuring static route FRR by specifying a backup next hop
Configuring static route FRR to automatically select a backup
next hop
1. Enter system view.
2. Configure static route FRR to
automatically select a
backup next hop.
ip route-static fast-reroute auto
N/A
By default, static route FRR is
disabled from automatically
selecting a backup next hop.
Enabling BFD echo packet mode for static route FRR
By default, static route F RR uses ARP to detec t primary link failures . Perform this task to enable
static route FRR to use BFD echo packet mode for fast failure detection on the primary link.
To enable BFD echo packet mode for static route FRR:
1. Enter system view.
2. Configure the source IP
address of BFD echo
packets.
system-view
bfd echo-source-ip
ip-address
N/A
By default, the source IP address
of BFD echo packets is not
configured.
The source IP address cannot be
on the same network segment as
any local interface's IP address.
For more information about this
command, see High Availability Command Reference.
3. Enable BFD echo packet
mode for static route FRR.
ip route-static
primary-path-detect bfd echo
By default, BFD echo mode for
static route FRR is disabled.
Displaying and maintaining static routes
Execute display commands in any view.
Display static route information.
Display static route next hop
As shown in Figure 2, c onf i gure s tat ic routes on th e switches for interc onnections between an y t wo
hosts.
Figure 2 Network diagram
Configuration procedure
1. Configure IP addresses for interfaces. (Details not shown.)
2. Configure static routes:
# Configure a default route on Switch A.
<SwitchA> system-view
[SwitchA] ip route-static 0.0.0.0 0.0.0.0 1.1.4.2
# Configure two static routes on Switch B.
<SwitchB> system-view
[SwitchB] ip route-static 1.1.2.0 255.255.255.0 1.1.4.1
[SwitchB] ip route-static 1.1.3.0 255.255.255.0 1.1.5.6
# Configure a default route on Switch C.
<SwitchC> system-view
[SwitchC] ip route-static 0.0.0.0 0.0.0.0 1.1.5.5
3. Configure the default gateways of Host A, Host B, and Host C as 1.1.2.3, 1.1.6.1, and 1.1.3.1.
(Details not shown.)
Verifying the configuration
# Display static routes on Switch A.
[SwitchA] display ip routing-table protocol static
Summary Coun t : 1
Static Routing table Status : <Active>
Summary Coun t : 1
15
Destination/M ask Proto Pre Cost NextHop Interface
0.0.0.0/0 Static 60 0 1.1.4.2 Vlan500
Static Routing ta ble Status : <Inacti ve>
Summary Coun t : 0
# Display static routes on Switch B.
[SwitchB] display ip routing-table protocol static
Summary Coun t : 2
Static Routing table Status : <Acti ve >
Summary Coun t : 2
Destination/Mask Proto Pre Cost NextHop Interface
1.1.2.0/24 Static 60 0 1.1.4.1 Vlan500
Static Routing table Status : <Inac ti ve>
Summary Coun t : 0
# Use the ping command on Host B to test the reachability of Host A (Windows XP runs on the two
hosts).
C:\Documents an d Settings\Administrator>ping 1.1.2.2
Pinging 1.1.2.2 with 32 bytes of data:
Reply from 1.1 .2.2: bytes=32 tim e=1ms TTL=126
Reply from 1.1 .2.2: bytes=32 tim e=1ms TTL=126
Reply from 1.1 .2.2: bytes=32 tim e=1ms TTL=126
Reply from 1.1 .2.2: bytes=32 tim e=1ms TTL=126
Ping statistics for 1.1.2.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
# Use the tracert command on Host B to test the reachability of Host A.
C:\Documents an d Settings\Administrator>tracert 1.1.2.2
Tracing rout e to 1.1.2.2 over a maxi mum of 30 hops
1 <1 ms <1 ms <1 ms 1.1.6.1
2 <1 ms <1 ms <1 ms 1.1.4.1
3 1 ms <1 ms <1 ms 1.1.2.2
Trace complete.
BFD for static routes configuration e x ample (direct next hop)
Network requirements
Configure the following, as shown in Figure 3:
16
•
•
•
•
Device
Interface
IP address
Switch ASwitch B
Switch C
BFD
L
2
Switch
Vlan-int10
Vlan
-int
11
Vlan-int11
Vlan
-int
13
Vlan-
int13
Vlan-int10
121.
1
.1
.0
/
24
120.1.1.0/24
Configure a static route to subnet 120.1.1.0/24 on Switch A. Configure a static route to subnet 121.1.1.0/ 24 on S wit c h B. Enable BFD for both routes. Configure a static route to subnet 120.1.1.0/24 and a static route to subnet 121.1.1.0/24 on
Switch C.
When the link between S witc h A and Switch B through the Layer 2 switch fai ls, B F D c an det ec t th e
failure immediately. Switch A then communicates with Switch B through Switch C.
Figure 3 Network diagram
Table 4 Interface and IP address assignment
Switch A VLAN-interface 10 12.1.1.1/24
Switch A VLAN-interface 11 10.1.1.102/24
Switch B VLAN-interface 10 12.1.1.2/24
Switch B VLAN-interface 13 13.1.1.1/24
Switch C VLAN-interface 11 10.1.1.100/24
Switch C VLAN-interface 13 13.1.1.2/24
Configuration procedure
1. Configure IP addresses for the interfaces. (Details not shown.)
2. Configure static routes and BFD:
# Configure static routes on Switch A and enable BFD control mode for the static route that
traverses the Layer 2 switch.