2. Configure Area 1 as an NSSA (run the nssa command on all routers in Area 1), and check the OSPF routing information and LSDB of RouterC
3.16.7 Example for Configuring BFD for OSPF
return
Configuration file of RouterD
#
sysname RouterD
#
router-id 4.4.4.4
#
interface GigabitEthernet1/0/1 ip address 3.4.1.4 255.255.255.0 ospf cost 55
# ospf 1 area 0.0.0.1
network 3.4.1.0 0.0.0.255
# return
3.16.7 Example for Configuring BFD for OSPF
Networking Requirements
As shown in Figure 3-16-7, it is required as follows:
Run OSPF between RouterA, RouterB, and RouterC.
Enable BFD of the OSPF process on RouterA, RouterB, and RouterC.
Traffic is transmitted on the active link RouterA → RouterB. The link RouterA → RouterC → RouterB acts as the standby link.
BFD of the interface is configured on the link between RouterA and RouterB. When a fault occurs on the link, BFD can quickly detect the fault and notify OSPF of the fault; therefore, the traffic is transmitted on the standby link.
2016-1-11 Huawei Confidential Page 182 of 1210 Figure 3-16-7 Networking diagram for configuring BFD for OSPF
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable the basic OSPF functions on each router.
2. Enable global BFD.
3. Enable the detection mechanism on RouterA and RouterB.
Procedure
1. Assign an IP address to each router interface.
The detailed configuration is not mentioned here.
2. Configure the basic OSPF functions.
# Configure RouterA.
[RouterA] router id 1.1.1.1 [RouterA] ospf
[RouterA-ospf-1] area 0
[RouterA-ospf-1-area-0.0.0.0] network 1.1.1.0 0.0.0.255 [RouterA-ospf-1-area-0.0.0.0] network 3.3.3.0 0.0.0.255 [RouterA-ospf-1-area-0.0.0.0] quit
[RouterA-ospf-1] quit
# Configure RouterB.
[RouterB] router id 2.2.2.2
[RouterB] ospf
[RouterB-ospf-1] area 0
[RouterB-ospf-1-area-0.0.0.0] network 2.2.2.0 0.0.0.255 [RouterB-ospf-1-area-0.0.0.0] network 3.3.3.0 0.0.0.255 [RouterB-ospf-1-area-0.0.0.0] network 172.16.1.0 0.0.0.255 [RouterB-ospf-1-area-0.0.0.0] quit
[RouterB-ospf-1] quit
# Configure RouterC.
[RouterC] router id 3.3.3.3 [RouterC] ospf
[RouterC-ospf-1] area 0
[RouterC-ospf-1-area-0.0.0.0] network 1.1.1.0 0.0.0.255 [RouterC-ospf-1-area-0.0.0.0] network 2.2.2.0 0.0.0.255 [RouterC-ospf-1-area-0.0.0.0] quit
[RouterC-ospf-1] quit
# After the preceding configurations are complete, run the display ospf peer command. You can view that the neighboring relationship is set up between RouterA, RouterB, and RouterC.
Take the display of RouterA as an example:
<RouterA> display ospf peer
OSPF Process 1 with Router ID 1.1.1.1 Neighbors
Area 0.0.0.0 interface 1.1.1.1(GigabitEthernet1/0/0)'s neighbors Router ID: 3.3.3.3 Address: 1.1.1.2 State: Full Mode:Nbr is Master Priority: 1
DR: 1.1.1.1 BDR: 1.1.1.2 MTU: 0 Dead timer due in 38 sec
Retrans timer interval: 5 Neighbor is up for 00:00:15 Authentication Sequence: [ 0 ] Neighbors
Area 0.0.0.0 interface 3.3.3.1(GigabitEthernet2/0/0)'s neighbors Router ID: 2.2.2.2 Address: 3.3.3.2 State: Full Mode:Nbr is Master Priority: 1
DR: 3.3.3.1 BDR: 3.3.3.2 MTU: 0 Dead timer due in 25 sec
Retrans timer interval: 5 Neighbor is up for 00:00:59 Authentication Sequence: [ 0 ]
2016-1-11 Huawei Confidential Page 184 of 1210
# Display the information in the OSPF routing table on RouterA. You can view the routing entries to RouterB and RouterC. The next hop address of the route to 172.16.1.0/24 is 3.3.3.2 and traffic is transmitted on the active link RouterA → RouterB.
<RouterA> display ospf routing
OSPF Process 1 with Router ID 1.1.1.1 Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area 172.16.1.0/24 2 Transit 3.3.3.2 2.2.2.2 0.0.0.0 3.3.3.0/24 1 Transit 3.3.3.1 1.1.1.1 0.0.0.0 2.2.2.0/24 2 Transit 3.3.3.2 2.2.2.2 0.0.0.0 2.2.2.0/24 2 Transit 1.1.1.2 2.2.2.2 0.0.0.0 1.1.1.0/24 1 Transit 1.1.1.1 1.1.1.1 0.0.0.0 Total Nets: 5
Intra Area: 5 Inter Area: 0 ASE: 0 NSSA: 0 3. Configure OSPF BFD.
# Enable global BFD on RouterA.
[RouterA] bfd [RouterA-bfd] quit [RouterA] ospf
[RouterA-ospf-1] bfd all-interfaces enable [RouterA-ospf-1] quit
# Enable global BFD on RouterB.
[RouterB] bfd [RouterB-bfd] quit [RouterB] ospf
[RouterB-ospf-1] bfd all-interfaces enable [RouterB-ospf-1] quit
# Enable global BFD on RouterC.
[RouterC] bfd [RouterC-bfd] quit [RouterC] ospf
[RouterC-ospf-1] bfd all-interfaces enable [RouterC-ospf-1] quit
# After the preceding configurations are complete, run the display ospf bfd session all command on RouterA or RouterB. You can view that the status of the BFD session is Up.
Take the display of RouterA as an example:
[RouterA] display ospf bfd session all
OSPF Process 1 with Router ID 1.1.1.1
Area 0.0.0.0 interface 1.1.1.1(GigabitEthernet1/0/0)'s BFD Sessions
NeighborId:3.3.3.3 AreaId:0.0.0.0 Interface:GigabitEthernet1/0/0 BFDState:up rx :1000 tx :1000
Multiplier:3 BFD Local Dis:8195 LocalIpAdd:1.1.1.1 RemoteIpAdd:1.1.1.2 Diagnostic Info:No diagnostic information Area 0.0.0.0 interface 3.3.3.1(GigabitEthernet2/0/0)'s BFD Sessions
NeighborId:2.2.2.2 AreaId:0.0.0.0 Interface:GigabitEthernet2/0/0 BFDState:up rx :1000 tx :1000
Multiplier:3 BFD Local Dis:8194 LocalIpAdd:3.3.3.1 RemoteIpAdd:3.3.3.2 Diagnostic Info:No diagnostic information 4. Configure BFD of the interface.
# Configure BFD on GE 2/0/0 of RouterA, set the minimum interval for sending the packets and the minimum interval for receiving the packets to 500 ms, and set the local detection time multiple to 4.
[RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] ospf bfd enable
[RouterA-GigabitEthernet2/0/0] ospf bfd min-tx-interval 500 min-rx-interval 500 detect-multiplier 4
[RouterA-GigabitEthernet2/0/0] quit
# Configure BFD on GE 2/0/0 of RouterB, set the minimum interval for sending the packets and the minimum interval for receiving the packets to 500 ms, and set the local detection time multiple to 4.
[RouterB] interface gigabitethernet 2/0/0 [RouterB-GigabitEthernet2/0/0] ospf bfd enable
[RouterB-GigabitEthernet2/0/0] ospf bfd min-tx-interval 500 min-rx-interval 500 detect-multiplier 4
[RouterB-GigabitEthernet2/0/0] quit
# After the preceding configurations are complete, run the display ospf bfd session all command on RouterA or RouterB. You can view that the status of the BFD session is Up.
Take the display of RouterB as an example:
[RouterB] display ospf bfd session all
OSPF Process 1 with Router ID 2.2.2.2
Area 0.0.0.0 interface 3.3.3.2(GigabitEthernet2/0/0)'s BFD Sessions
NeighborId:1.1.1.1 AreaId:0.0.0.0 Interface: GigabitEthernet2/0/0 BFDState:up rx :500 tx :500
2016-1-11 Huawei Confidential Page 186 of 1210 Multiplier:4 BFD Local Dis:8198 LocalIpAdd:3.3.3.2
RemoteIpAdd:3.3.3.1 Diagnostic Info:No diagnostic information 5. Verify the configuration.
# Run the shutdown command on GE 2/0/0 of RouterB to simulate the active link failure.
[RouterB] interface gigabitethernet 2/0/0 [RouterB-GigabitEthernet2/0/0] shutdown
# Display the routing table on RouterA. The standby link RouterA → RouterC → RouterB takes effect after the active link fails. The next hop address of the route to 172.16.1.0/24 becomes 1.1.1.2.
<RouterA> display ospf routing
OSPF Process 1 with Router ID 1.1.1.1 Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area 172.16.1.0/24 3 Transit 1.1.1.2 2.2.2.2 0.0.0.0 3.3.3.0/24 1 Transit 3.3.3.1 1.1.1.1 0.0.0.0 2.2.2.0/24 2 Transit 1.1.1.2 2.2.2.2 0.0.0.0 1.1.1.0/24 1 Transit 1.1.1.1 1.1.1.1 0.0.0.0 Total Nets: 4
Intra Area: 4 Inter Area: 0 ASE: 0 NSSA: 0
Configuration Files
Configuration file of RouterA
#
sysname RouterA
#
router id 1.1.1.1
# bfd
#
interface GigabitEthernet1/0/0 ip address 1.1.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0 ip address 3.3.3.1 255.255.255.0 ospf bfd enable
ospf bfd min-tx-interval 500 min-rx-interval 500 detect-multiplier 4
# ospf 1
bfd all-interface enable area 0.0.0.0
network 3.3.3.0 0.0.0.255 network 1.1.1.0 0.0.0.255
# return
Configuration file of RouterB
#
sysname RouterB
#
router id 2.2.2.2
# bfd
#
interface GigabitEthernet1/0/0 ip address 2.2.2.2 255.255.255.0
#
interface GigabitEthernet2/0/0 ip address 3.3.3.2 255.255.255.0 ospf bfd enable
ospf bfd min-tx-interval 500 min-rx-interval 500 detect-multiplier 4
#
interface GigabitEthernet3/0/0 ip address 172.16.1.1 255.255.255.0
# ospf 1
bfd all-interface enable area 0.0.0.0
network 3.3.3.0 0.0.0.255 network 2.2.2.0 0.0.0.255 network 172.16.1.0 0.0.0.255
# return
Configuration file of RouterC
#
sysname RouterC
2016-1-11 Huawei Confidential Page 188 of 1210
#
router id 3.3.3.3
# bfd
#
interface GigabitEthernet1/0/0 ip address 1.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0 ip address 2.2.2.1 255.255.255.0 #
ospf 1
bfd all-interface enable area 0.0.0.0
network 1.1.1.0 0.0.0.255 network 2.2.2.0 0.0.0.255
# return