Hà Nội: NTT03, Line 1, Thống Nhất Complex, 82 Nguyễn Tuân, Thanh Xuân, Hà Nội. ● HCM: Số 31B, Đường 1, Phường An Phú, Quận 2 (Thủ Đức), TP HCM. ===> Đơn Vị Hàng Đầu Trong Lĩnh Vực Cung Cấp Thiết Bị Security - Network - Wifi - CCTV - Conference - Máy chủ Server - Lưu trữ Storge.
Danh mục sản phẩm

Configure OSPF to Coordinate with BFD Example

Network Requirements

  • Configure OSPF for all devices.
  • Enable the BFD detection function on the line between Device1 and Device3. If the line becomes faulty, BFD quickly detects the fault and notify OSPF of the fault. Then, OSPF switches the route to Device2 for communication.

Network Topology

Networking for Configuring OSPF to Coordinate with BFD

Figure 7-10 Networking for Configuring OSPF to Coordinate with BFD

Configuration Steps

Step 1: Create VLANs, and add ports to the required VLANs. (Omitted)

Step 2: Configure IP addresses for the ports. (Omitted)

Step 3: Configure an OSPF process.

#Configure Device1.

Device1#configure terminal
Device1(config)#router ospf 100
Device1(config-ospf)#router-id 1.1.1.1
Device1(config-ospf)#network 10.0.0.0 0.0.0.255 area 0
Device1(config-ospf)#network 20.0.0.0 0.0.0.255 area 0
Device1(config-ospf)#network 200.0.0.0 0.0.0.255 area 0
Device1(config-ospf)#exit

#Configure Device2.

Device2#configure terminal
Device2(config)#router ospf 100
Device2(config-ospf)#router-id 2.2.2.2
Device2(config-ospf)#network 20.0.0.0 0.0.0.255 area 0
Device2(config-ospf)#network 30.0.0.0 0.0.0.255 area 0
Device2(config-ospf)#exit

#Configure Device3.

Device3#configure terminal
Device3(config)#router ospf 100
Device3(config-ospf)#router-id 3.3.3.3
Device3(config-ospf)#network 10.0.0.0 0.0.0.255 area 0
Device3(config-ospf)#network 30.0.0.0 0.0.0.255 area 0
Device3(config-ospf)#network 201.0.0.0 0.0.0.255 area 0
Device3(config-ospf)#exit

Step 4: Configure OSPF to coordinate with BFD.

#Configure Device1.

Device1(config)#bfd fast-detect
Device1(config)#interface vlan2
Device1(config-if-vlan2)#ip ospf bfd
Device1(config-if-vlan2)#exit

#Configure Device3.

Device3(config)#bfd fast-detect
Device3(config)#interface vlan2
Device3(config-if-vlan2)#ip ospf bfd
Device3(config-if-vlan2)#exit

Step 5: Check the result.

#Query the OSPF neighbors and routing table of Device1.

Device1#show ip ospf neighbor 3.3.3.3  
 
OSPF process 100: 
 Neighbor 3.3.3.3, interface address 10.0.0.2 
    In the area 0 via interface vlan2, BFD enabled 
    Neighbor priority is 1, State is Full, 5 state changes 
    DR is 10.0.0.2, BDR is 10.0.0.1 
    Options is 0x42 (-|O|-|-|-|-|E|-) 
    Dead timer due in 00:00:31 
    Neighbor is up for 00:02:46 
    Database Summary List 0 
    Link State Request List 0 
    Link State Retransmission List 0 
    Crypt Sequence Number is 0 
    Graceful restart proxy id is 0x0 
    Thread Inactivity Timer on 
    Thread Database Description Retransmission off, 0 times 
    Thread Link State Request Retransmission off, 0 times 
    Thread Link State Update Retransmission off, 0 times 
 
Device1#show ip route 
Codes: C - connected, S - static, R - RIP, O - OSPF, OE-OSPF External, M - Management 
       D - Redirect, E - IRMP, EX - IRMP external, o - SNSP, B - BGP, i-ISIS  
 
Gateway of last resort is not set 
 
C 10.0.0.0/24 is directly connected, 00:01:09, vlan2 
C 20.0.0.0/24 is directly connected, 00:55:37, vlan3
O 30.0.0.0/24 [110/2] via 20.0.0.2, 00:02:50, vlan3 
              [110/2] via 10.0.0.2, 00:01:30, vlan2
C 127.0.0.0/8 is directly connected, 05:51:09, lo0  
C 200.0.0.0/24 is directly connected, 00:55:12, vlan4
O 201.0.0.0/24 [110/2] via 10.0.0.2, 00:01:30, vlan2 

According to the OSPF neighbor information, BFD has been enabled, and route 201.0.0.0/24 selects the line between Device1 and Device3 with priority for communication.

#Query the BFD session of Device1.

Device1#show bfd session detail Total session number: 1 
OurAddr      NeighAddr   LD/RD   State  Holddown  interface       
10.0.0.1     10.0.0.2    7/14    UP     5000      vlan2 
Type:direct 
Local State:UP Remote State:UP Up for: 0h:2m:37s Number of times UP:1
Send Interval:1000ms Detection time:5000ms(1000ms*5) 
Local Diag:0 Demand mode:0 Poll bit:0
MinTxInt:1000 MinRxInt:1000 Multiplier:5 
Remote MinTxInt:1000 Remote MinRxInt:1000 Remote Multiplier:5
Registered protocols:OSPF

According to the queried information, OSPF has been configured successfully to coordinate with BFD, and the session has been normally set up.

#If the line between Device1 and Device3 becomes faulty, BFD quickly detects the fault and informs OSPF of the fault. OSPF then switch the route to Device2 for communication. Query the routing table of Device1.

%BFD-5-Session [10.0.0.2,10.0.0.1,vlan2,10] DOWN (Detection time expired) 
%OSPF-5-ADJCHG: Process 100 Nbr [vlan2:10.0.0.1-3.3.3.3] from Full to Down,KillNbr: BFD session down 
 
Device1#show ip route 
Codes: C - connected, S - static, R - RIP, O - OSPF, OE-OSPF External, M Management 
       D - Redirect, E - IRMP, EX - IRMP external, o - SNSP, B BGP, i-ISIS 
 
Gateway of last resort is not set 
 
C 10.0.0.0/24 is directly connected, 00:01:59, vlan2 
C 20.0.0.0/24 is directly connected, 00:56:13, vlan3
O 30.0.0.0/24 [110/2] via 20.0.0.2, 00:03:40, vlan3
C 127.0.0.0/8 is directly connected, 05:52:41, lo0 
C 200.0.0.0/24 is directly connected, 00:56:02, vlan4
O 201.0.0.0/24 [110/3] via 20.0.0.2, 00:00:06, vlan3 

The action of Device3 is similar to that of Device1.