01-02 Static Route Configuration
01-02 Static Route Configuration
This chapter provides an overview of the functions, purposes, and use cases of
static routes, and explains how they can be configured.
Definition
A static route is a route that, in most cases, the network administrator manually
configures to allow network traffic to reach a target destination.
Purpose
Static routes are used in different ways on different types of network.
● On simple networks, static routes can be used alone, without the need for
dynamic routes.
● On complex networks, static routes can be used alongside dynamic routes to
improve network performance and ensure bandwidth is available for
important applications.
● Static routes associated with VPN instances are used to manage VPN routes.
● If the BFD session bound to a static route detects a link fault, BFD reports the
link fault to the Routing Management (RM) module. The RM module then
sets the route to inactive, and this route is no longer available in the routing
table.
● If the BFD session bound to a static route detects that the faulty link has been
re-established, BFD reports a message to the RM module. The RM module
then sets the route to active, and this route becomes available in the IP
routing table once again.
For more details about BFD, see "BFD Configuration - Principles" in Configuration
Guide - Reliability.
NQA for static routes refers to the association between a static route and an NQA
test instance. The system can use the NQA test instance to check the link status.
Then, according to the NQA test result, the system can determine an optimal
route in time to prevent communication interruption and ensure service quality.
NQA for static routes functions as follows:
● If NQA detects a fault in the link, the system sets the static route to inactive.
The route becomes unavailable and is deleted from the IP routing table.
● If NQA finds that the link recovers, the system sets the static route to active.
The route becomes available and is added to the IP routing table.
For details about NQA, see "NQA Configuration - Principles" in the Configuration
Guide - Network Management and Monitoring.
NOTE
When a static route is associated with an NQA test instance, only ICMP test instances are
used to test whether there are reachable routes between the source and destination.
Each static route can be associated with only one NQA test instance.
Applications
On the network shown in Figure 2-1, each access switch provides access services
for 10 users, and a total of 100 users are connected to the network. Because
dynamic routing protocols are unavailable for communication between RouterB
and users, static routes are configured on RouterB. For network stability, RouterC,
functioning as the backup for RouterB, is configured with static routes to the same
destination. RouterA, RouterB, and RouterC run a dynamic routing protocol to
learn routes from each other. RouterB and RouterC import static routes using a
dynamic routing protocol and have different costs for these static routes. After the
configuration is complete, RouterA can use the dynamic routing protocol to learn
routes destined for users from RouterB and RouterC. RouterA uses the link related
to the static route with a lower cost as the active link and the other link as the
standby link.
NQA for static routes is configured on RouterB. NQA tests are performed to check
the active link of RouterB → SwitchA → SwitchC (SwitchD). If the active link fails,
the corresponding static route is deleted from the routing table, and traffic diverts
to the standby link of RouterC → SwitchB → SwitchC (SwitchD). If both links work
properly, traffic travels along the active link.
IP Network
RouterA
RouterB RouterC
SwitchA SwitchB
......
SwitchC SwitchD
...... ......
After permanent advertisement of static routes is configured, the static routes that
cannot be advertised are still preferred and are added to the routing table in the
following cases:
NOTICE
A device enabled with this feature always stores static routes in its IP routing
table, regardless of whether the static routes are reachable. If a path is
unreachable, the corresponding static route may become a blackhole route.
Applications
In Figure 2-2, BR1, BR2, and BR3 belong to ISP1, ISP2, and ISP3 respectively.
Between BR1 and BR2 are two links, Link A and Link B. ISP1, however, requires
that service traffic be forwarded to ISP2 over Link A without traveling through
ISP3.
ISP2
BR2
10.1.1.2/24
LinkA
BR1
ISP1
LinkB BR3
ISP3
Preference=60
Preference=60
RouteA RouteC
RouteD
As shown in Figure 2-3, there are two static routes with the same preference from
RouterA to RouterC. The two routes are stored in the routing table and used to
forward data.
Route Backup
To implement route backup, specify different preferences for multiple routes to the
same destination.
Preference=60
Preference=100
RouteA RouteC
RouteD
As shown in Figure 2-4, there are two static routes with different preferences from
RouterA to RouterC. Static route B with next hop RouterB has a higher preference.
The link that static route B belongs to functions as the active link. Static route D
with next hop RouterD has a lower preference. The link that static route D belongs
to functions as the standby link.
● In normal situations, static route B is activated, and the active link forwards
data. Static route D is not shown in the routing table.
● If a fault occurs on the active link, static route B is deleted from the routing
table. Static route D is activated, and the standby link forwards data.
● When the active link restores, static route B is activated again, and the active
link forwards data. Static route D is deleted from the routing table and
functions as the backup route. Static route D is also called a floating static
route.
2 4
RouteB
1 5
RouteA RouteC
– If any device on
the network does
not support BFD,
BFD detection
cannot be
implemented.
– If either end of the
link is a Layer 2
device, dynamic
routing protocols
cannot be
configured and
therefore IGP
convergence
cannot be
implemented.
NQA for static routes
only requires one end
of the interconnected
devices to support
NQA and can be used
even if there are
Layer 2 devices. The
preceding problems
are solved. When a
link is faulty, an NQA
test instance can
immediately detect
the link change and
delete the static route
associated with the
NQA test instance
from the IP routing
table, affecting traffic
forwarding.
Licensing Requirements
Static route is a basic feature of a router and is not under license control.
Feature Limitations
None
Pre-configuration Tasks
Before configuring IPv4 static routes, complete the following task:
● Configuring link layer parameters and IP addresses for interfaces to ensure
network-layer communication between neighbor nodes
Configuration 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
----End
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.
----End
With permanent advertisement of static routes, you can detect link connectivity by
pinging the destination addresses of static routes. After permanent advertisement
of static routes is configured, static routes always take effect regardless of the
outbound interface status. In this case, the system forwards ping packets along a
specified path only, which helps monitor the link status of the path.
Procedure
Step 1 Run system-view
----End
Context
By default, a static route can still be selected by the router even though the BFD
session associated with it is in the AdminDown state, but not by non-Huawei
devices. As a result, the router cannot interwork with non-Huawei devices.
Procedure
Step 1 Run system-view
The router has been configured not to select the static route if the BFD session
associated with it is in the AdminDown state.
By default, a static route can still be selected by the router even though the BFD
session associated with it is in the AdminDown state.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ip route recursive-lookup blackhole protocol static disable
Static routes have been prevented from being iterated to the black-hole route.
By default, static routes can be iterated to a black-hole route.
----End
Background
If you want to advertise configured static routes to a network through routing
protocols, but do not want to use the routes for packet forwarding, use static
route filtering function to prohibit these routes from being used for packet
forwarding.
In Figure 2-6, RouterB connects to RouterA and RouterC. RouterA and RouterB
have interface IP addresses with 23-bit masks planned, but RouterC is newly
added to the network and does not support the routing table containing 23-bit
mask routes. As a result, RouterC cannot receive routes from RouterB, which may
lead to service failures. To prevent this situation, configure 24-bit mask routes on
RouterB and send these routes to RouterC, while allowing RouterB to use existing
23-bit mask routes for packet forwarding. To achieve this purpose, configure static
route filtering function on RouterB to filter 24-bit mask routes. Then RouterB can
still send these routes to RouterC but does not use these routes for service packet
forwarding.
Prerequisites
Before configuring IPv4 static route filtering, complete the following task:
● Run the acl command to create an advanced ACL.
● Run the rule command to configure IPv4 static route filtering rules.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run routing-table download filter acl acl-number
The static route filtering function is configured.
By default, the static route filtering function is not configured.
Step 3 Run quit
Return to the system view.
----End
Follow-up Procedure
Run the ip route-static command to configure static routes to be filtered.
Pre-configuration Tasks
Before configuring static BFD for IPv4 static routes, complete the following tasks:
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ip route-static ip-address { mask | mask-length } { nexthop-address |
interface-type interface-number [ nexthop-address ] } [ preference preference |
tag tag ] * track bfd-session cfg-name [ description text ]
A public network static IPv4 route is bound to a BFD session.
NOTE
Before binding a static route to a BFD session, ensure that the BFD session and the static
route reside on the same link.
----End
Pre-configuration Tasks
Before associating IPv4 static routes with NQA, complete the following task:
● Configuring link layer parameters for interfaces to ensure that the link layer
protocol on the interfaces is Up
Procedure
Step 1 Configure an NQA ICMP test instance.
1. Run system-view
NOTE
When a static route is associated with an NQA test instance, only ICMP test instances
are used to test whether there are reachable routes between the source and
destination.
4. Run destination-address ipv4 ip-address
The destination address is set.
In an NQA test instance, you can specify an NQA server by running the
destination-address command to configure a destination address for the
NQA test instance.
5. (Optional) Run frequency interval
The interval for automatically performing an NQA test is set.
By default, no interval is set, that is, only one test is performed.
6. (Optional) Run probe-count number
The number of probes to be sent each time is set for the NQA test instance.
By default, the number of probes is 3.
By sending probes multiple times in an NQA test instance, you can accurately
estimate network quality based on the collected statistics.
7. Run start
The NQA test instance is started.
The start command can configure an NQA test instance to be started
immediately, at a specified time, or after a specified delay. You can perform
one of the following operations as required:
– Run start now [ end { at [ yyyy/mm/dd ] hh:mm:ss | delay { seconds
second | hh:mm:ss } | lifetime { seconds second | hh:mm:ss } } ]
The NQA test instance is started immediately.
– Run start at [ yyyy/mm/dd ] hh:mm:ss [ end { at [ yyyy/mm/dd ]
hh:mm:ss | delay { seconds second | hh:mm:ss } | lifetime { seconds
second | hh:mm:ss } } ]
The NQA test instance is started at a specified time.
– Run start delay { seconds second | hh:mm:ss } [ end { at [ yyyy/mm/dd ]
hh:mm:ss | delay { seconds second | hh:mm:ss } | lifetime { seconds
second | hh:mm:ss } } ]
The NQA test instance is started after a specified delay.
8. Run quit
Return to the system view.
NOTE
The destination address of an NQA test instance cannot be the destination address of
an associated static route.
If the static route associated with an NQA test instance is associated with another
NQA test instance, the static route is disassociated from the first NQA test instance.
----End
Pre-configuration Tasks
Before configuring IPv6 static routes, complete the following task:
● Configuring link layer parameters and IPv6 addresses for interfaces to ensure
network-layer communication between neighbor nodes
Configuration 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.
● Run ipv6 route-static dest-ipv6-address prefix-length { interface-type
interface-number [ nexthop-ipv6-address ] | nexthop-ipv6-address }
[ preference preference | tag tag ] * [track nqa admin-name test-name |
permanent ] [ description text ]
An IPv6 static route is configured on the public network.
● Run ipv6 route-static vpn-instance vpn-instance-name dest-ipv6-address
prefix-length { [ interface-type interface-number ] nexthop-ipv6-address |
nexthop-ipv6-address [ public ] | vpn-instance vpn-destination-name
nexthop-ipv6-address } [ preference preference | tag tag ] * [ description
text ]
An IPv6 static route is configured in a VPN instance.
----End
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.
----End
Pre-configuration Tasks
Before configuring static BFD for IPv6 static routes, complete the following tasks:
● Configuring link layer parameters and IP addresses for interfaces to ensure
network-layer communication between neighbor nodes
● Configuring BFD sessions
For details, see BFD Configuration in the Huawei AR Series Access Routers -
Configuration Guide - Reliability.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ipv6 route-static dest-ipv6-address prefix-length { nexthop-ipv6-address |
interface-type interface-number [ nexthop-ipv6-address ] } [ preference
preference | tag tag ]* track bfd-session bfd-name [ description text ]
A public network static IPv6 route is bound to a BFD session.
By default, no IPv6 static route is configured.
NOTE
Before binding a static route to a BFD session, ensure that the BFD session and the static
route reside on the same link.
----End
Networking Requirements
Hosts on different network segments are connected using several Routers. Every
two hosts on different network segments can communicate with each other
without using dynamic routing protocols.
PC2
192.168.2.2/24
GE3/0/0
192.168.2.1/24
GE1/0/0 GE2/0/0
192.168.4.2/30 192.168.4.5/30
RouterB
RouterA RouterC
GE1/0/0 GE1/0/0
192.168.4.1/30 192.168.4.6/30
GE2/0/0 GE2/0/0
192.168.1.1/24 192.168.3.1/24
PC1 PC3
192.168.1.2/24 192.168.3.2/24
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure IP addresses for interfaces on each Router.
# Configure an IP address for each interface on RouterA. The configurations of
RouterB and RouterC are similar to the configuration of RouterA, and are not
mentioned here.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ip address 192.168.4.1 30
[RouterA-GigabitEthernet1/0/0] quit
[RouterA] interface gigabitethernet 2/0/0
[RouterA-GigabitEthernet2/0/0] ip address 192.168.1.1 24
----End
Configuration Files
● Configuration file of RouterA
#
sysname RouterA
#
interface GigabitEthernet2/0/0
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet1/0/0
ip address 192.168.4.1 255.255.255.252
#
ip route-static 0.0.0.0 0.0.0.0 192.168.4.2
#
return
GE0/0/0
2::1/64
GE1/0/0 GE2/0/0
10::2/64 20::1/64
RouterB
GE1/0/0 GE1/0/0
10::1/64 20::2/64
RouterA RouterC
GE2/0/0 GE2/0/0
1::1/64 3::1/64
PC1 PC3
1::2/64 3::2/64
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure IPv6 addresses for interfaces so that devices can communicate with
each other.
2. Configure the IPv6 default gateway on each host, and configure IPv6 static
routes and default routes on each Router so that hosts on different network
segments can communicate with each other.
Procedure
Step 1 Configure IPv6 addresses for interfaces on each Router.
# Configure IPv6 addresses for interfaces on RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] ipv6
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ipv6 enable
[RouterA-GigabitEthernet1/0/0] ipv6 address 10::1/64
[RouterA-GigabitEthernet1/0/0] quit
Destination : :: PrefixLength : 0
NextHop : 10::2 Preference : 60
Cost :0 Protocol : Static
RelayNextHop : :: TunnelID : 0x0
Interface : GigabitEthernet1/0/0 Flags :D
----End
Configuration Files
● Configuration file of RouterA
#
sysname RouterA
#
ipv6
#
interface GigabitEthernet1/0/0
ipv6 enable
ipv6 address 10::1/64
#
interface GigabitEthernet2/0/0
ipv6 enable
ipv6 address 1::1/64
#
ipv6 route-static :: 0 GigabitEthernet1/0/0 10::2
#
return
Networking Requirements
As shown in Figure 2-9, RouterA is connected to RouterB through SwitchC. You
need to configure static routes on RouterA so that RouterA can communicate with
the external network. Link fault detection between RouterA and RouterB must be
at the millisecond level to improve convergence speed.
Figure 2-9 Networking diagram of configuring static BFD for IPv4 static routes
GE1/0/0 GE1/0/0 GE2/0/0
1.1.1.1/24 1.1.1.2/24 2.2.2.2/24
Internet
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure IP addresses for interfaces on each Router.
# Check the IP routing table of RouterA. The command output shows that the
static route exists in the routing table.
[RouterA] display ip routing-table
Route Flags:
R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 1.1.1.2 GigabitEthernet1/0/0
1.1.1.0/24 Direct 0 0 D 1.1.1.1 GigabitEthernet1/0/0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
# Check the IP routing table of RouterA. The command output shows that default
route 0.0.0.0/0 does not exist. This is because the default static route is bound to a
BFD session. When BFD detects a link fault, BFD rapidly notifies that the bound
static route becomes unavailable. If the static route is not bound to a BFD session,
the default route 0.0.0.0/0 will always exist in IP routing table; however, this may
cause traffic loss.
[RouterA] display ip routing-table
Route Flags:
R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Direct 0 0 D 1.1.1.1 GigabitEthernet1/0/0
1.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
1.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
----End
Configuration Files
● Configuration file of RouterA
#
sysname RouterA
#
bfd
#
interface GigabitEthernet1/0/0
ip address 1.1.1.1 255.255.255.0
#
bfd aa bind peer-ip 1.1.1.2
discriminator local 10
discriminator remote 20
commit
#
ip route-static 0.0.0.0 0.0.0.0 1.1.1.2 track bfd-session aa
#
return
● Configuration file of RouterB
sysname RouterB
#
bfd
#
interface GigabitEthernet1/0/0
ip address 1.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 2.2.2.2 255.255.255.0
#
bfd bb bind peer-ip 1.1.1.1
discriminator local 20
discriminator remote 10
commit
#
return
Networking Requirements
As shown in Figure 2-10, multiple static routes are configured on RouterA so that
packets can be forwarded from RouterA to users. To improve link reliability when
access switches do not support BFD, customers require that packets sent from
RouterA be transmitted along the primary link RouterA->RouterB->Switch->User
when the primary link is working properly. When the primary link fails, the packets
can be switched to the backup link RouterA->RouterC->Switch->User for
forwarding.
Figure 2-10 Networking diagram of configuring NQA for IPv4 static routes
RouterA
GE1/0/0 GE2/0/0
172.16.3.1/24 172.16.4.1/24
GE2/0/0 GE2/0/0
172.16.3.2/24 172.16.4.2/24
RouterB RouterC
/ 0 /0
GE1/0/0 GE3 3 4 GE1/0/0
GE .1/2
172.16.1.1/24 172 /0/0 6 . 6 172.16.2.1/24
.16 2.1
.5. 1 7
1/2 17 VLA
4 2.1 NI
6.5 F2
VLANIF10 .2/ 0 VLANIF10
172.16.1.2/24 2 0 4 24
F 2
A NI .6.2/ 172.16.2.2/24
VL 2.16 ......
VALNIF30 17 VLANIF30
172.16.7.1/24 SwitchA SwitchB 172.16.8.1/24
...... ......
Primary link
Backup link
Configuration Roadmap
To improve link reliability, a link detection mechanism needs to be deployed on
the device to detect the link status in real time and then the detected link status is
associated with the route status. Access switches do not support BFD. You can
associate IPv4 static routes with NQA to meet this link reliability requirement. The
configuration roadmap is as follows:
NOTE
When a static route is associated with an NQA test instance, only ICMP test instances are
used to test whether there are reachable routes between the source and destination.
Procedure
Step 1 Configure IP addresses on Routers.
Step 2 Configure static routes from RouterA, RouterB, and RouterC to Client1.
# On RouterA, configure two static routes to Client1 and set the priority of the
static route with next hop RouterC to 100.
[RouterA] ip route-static 172.16.7.0 255.255.255.0 172.16.3.2
[RouterA] ip route-static 172.16.7.0 255.255.255.0 172.16.4.2 preference 100
Step 3 Configure an NQA test instance on RouterA to test the link between RouterA and
SwitchA.
[RouterA] nqa test-instance aa bb
[RouterA-nqa-aa-bb] test-type icmp
[RouterA-nqa-aa-bb] destination-address ipv4 172.16.1.2
[RouterA-nqa-aa-bb] frequency 5
[RouterA-nqa-aa-bb] probe-count 1
[RouterA-nqa-aa-bb] start now
[RouterA-nqa-aa-bb] quit
NOTE
If a link becomes faulty, the NQA test instance detects this fault and then the static routes
associated with the NQA test instance become Down. After the link recovers, the NQA test
instance attempts to send ICMP test packets over the static routes. Because these static
routes are still Down, the NQA test instance still fails to detect link connectivity. Traffic fails
to be forwarded. The nexthop ipv4 ip-address command configures a next hop address for
the NQA test packets, which ensures that the packets are forwarded when the link recovers
from the fault, and the static routes associated with the NQA test instance are Up.
Step 4 On RouterA, associate the static route of which the next hop is RouterB with the
NQA test instance.
[RouterA] ip route-static 172.16.7.0 255.255.255.0 172.16.3.2 track nqa aa bb
# Run the display nqa results command on RouterA to check the NQA test
results. In this example, information "Lost packet ratio: 0 %" is displayed,
indicating that the link works properly.
[RouterA] display nqa results test-instance aa bb
# Check the routing table on RouterA. The routing table contains a static route
with the next hop 172.16.3.2.
[RouterA] display ip routing-table
Route Flags:
R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
The routing table contains a route destined for 172.16.7.0/24 with next hop
172.16.3.2. Therefore, traffic travels along the primary link.
# Check the NQA test results. Information "Lost packet ratio: 100 %" is displayed,
indicating that the link fails.
[RouterA] display nqa results test-instance aa bb
The command output shows that the next hop of the route to destination network
segment 172.16.7.0/24 is 172.16.4.2. After NQA detects that primary link fails,
NQA notifies RouterA that the static route to 172.16.7.0/24 becomes unavailable.
Packets are then switched to the backup link for forwarding.
----End
Configuration Files
● Configuration file of RouterA
#
sysname RouterA
#
interface GigabitEthernet1/0/0
ip address 172.16.3.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.16.4.1 255.255.255.0
#
ip route-static 172.16.7.0 255.255.255.0 172.16.3.2 track nqa aa bb
ip route-static 172.16.7.0 255.255.255.0 172.16.4.2 preference 100
#
nqa test-instance aa bb
test-type icmp
destination-address ipv4 172.16.1.2
frequency 5
probe-count 1
start now
#
return
Networking Requirements
As shown in Figure 2-11:
● Router A is connected to Router B through Switch C.
● It is required that Router A can communicate with other routers and the
network.
● a BFD session is configured between Router A and Router B to detect the link
between the two devices.
Figure 2-11 Networking diagram for configuring BFD for IPv6 static routes
Because the network topology is very simple, static routes can be configured to
make RouterA communicate with other Routers and the network. By binding BFD
sessions to static routes, BFD sessions can detect the link status, which provides
the detection mechanism for static routes.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a BFD session on Router A and Router B to detect the link between
the two devices.
2. Configure a default static route from Router A to the external network and
bind the default static route to a BFD session.
Procedure
Step 1 Configure an IPv6 address for each interface.
The configuration details are not described here.
Step 2 Configure a BFD session between Router A and Router B.
# On Router A, configure a BFD session with Router B.
<RouterA> system-view
[RouterA] bfd
[RouterA-bfd] quit
[RouterA] bfd aa bind peer-ipv6 2001:db8:1::2
[RouterA-bfd-session-aa] discriminator local 10
[RouterA-bfd-session-aa] discriminator remote 20
[RouterA-bfd-session-aa] commit
[RouterA-bfd-session-aa] quit
# After the configuration, run the display bfd session all command on Router A
and Router B. The command output shows that a BFD session has been
established and is in the Up state. Then, run the display current-configuration |
include bfd command in the system view. The command output shows that the
default static route has been bound to the BFD session.
# Check the IP routing table of Router A. The command output shows that the
static route exists in the routing table.
[RouterA] display ipv6 routing-table
Routing Table : Public
Destinations : 5 Routes : 5
Destination : :: PrefixLength : 0
NextHop : 2001:db8:1::2 Preference : 60
Cost :0 Protocol : Static
RelayNextHop : :: TunnelID : 0x0
Interface : GigabitEthernet 1/0/0 Flags : RD
# Check the IP routing table of Router A. The command output shows that default
route 0::0/0 does not exist. This is because the default static route is bound to a
BFD session. When BFD detects a link fault, BFD rapidly notifies that the bound
static route becomes unavailable. If the static route is not bound to a BFD session,
the default route 0.0.0.0/0 will always exist in IP routing table, this may cause
traffic loss.
[RouterA] display ipv6 routing-table
Routing Table : Public
Destinations : 1 Routes : 1
----End
Configuration Files
● Configuration file of Router A
#
sysname RouterA
#
ipv6
#
bfd
#
interface GigabitEthernet 1/0/0
undo shutdown
ipv6 enable
ipv6 address 2001:db8:1::1/64
#
bfd aa bind peer-ipv6 2001:db8:1::2
discriminator local 10
discriminator remote 20
commit
#
ipv6 route-static :: 0 2001:db8:1::2 track bfd-session aa
#
return
2.13.1 Is the Static Route Affected If the BFD for the Static
Route is in AdminDown State?
The static route is not affected. The static route is invalid only when the BFD
detects a link fault.