BFD for BGP configuration

2021-05-21 22:45:44 Published
  • 0 Followed
  • 0Collected ,1416Browsed

Network Topology

Network requirements

As shown in Figure, configure OSPF as the IGP in AS 200.

·           Establish two IBGP connections between Switch A and Switch C. When both paths operate correctly, Switch C uses the path Switch A<—>Switch B<—>Switch C to exchange packets with network 1.1.1.0/24.

·           Configure BFD over the path. When the path fails, BFD can quickly detect the failure and notify it to BGP. Then, the path Switch A<—>Switch D<—>Switch C takes effect immediately.


Device

interface

IP

Device

interface

IP

Switch A

Vlan-int100

3.0.1.1/24

Switch C

Vlan-int101

3.0.2.2/24

 

Vlan-int200

2.0.1.1/24

 

Vlan-int201

2.0.2.2/24

 

Loopback0

1.1.1.1/24

 

Loopback0

5.5.5.5/24

Switch B

Vlan-int100

3.0.1.2/24

Switch D

Vlan-int200

2.0.1.2/24

 

Vlan-int101

3.0.2.1/24

 

Vlan-int201

2.0.2.1/24

Configuration Steps

Configuration procedure

1. Swithc A

#

ospf 1

 area 0.0.0.0

  network 2.0.1.0 0.0.0.255

  network 3.0.1.0 0.0.0.255

#

acl number 2000

 rule 0 permit source 1.1.1.0 0.0.0.255

#

route-policy apply_med_100 permit node 10

 if-match ip address acl 2000

 apply cost 100

#

route-policy apply_med_50 permit node 10

 if-match ip address acl 2000

 apply cost 50

#

#

bgp 200

 peer 2.0.2.2 as-number 200

 peer 3.0.2.2 as-number 200

 peer 3.0.2.2 bfd

 #

 address-family ipv4 unicast

  network 1.1.1.0 255.255.255.0

  peer 2.0.2.2 enable

  peer 2.0.2.2 route-policy apply_med_100 export

  peer 3.0.2.2 enable

  peer 3.0.2.2 route-policy apply_med_50 export

#

 

2. Swithc C

#

ospf 1

 area 0.0.0.0

  network 2.0.2.0 0.0.0.255

  network 3.0.2.0 0.0.0.255

#

acl number 2000

 rule 0 permit source 5.5.5.0 0.0.0.255

#

route-policy apply_med_100 permit node 10

 if-match ip address acl 2000

 apply cost 100

#

route-policy apply_med_50 permit node 10

 if-match ip address acl 2000

 apply cost 50

#

bgp 200

 peer 2.0.1.1 as-number 200

 peer 3.0.1.1 as-number 200

 peer 3.0.1.1 bfd

 #

 address-family ipv4 unicast

  network 5.5.5.0 255.255.255.0

  peer 2.0.1.1 enable

  peer 2.0.1.1 route-policy apply_med_100 export

  peer 3.0.1.1 enable

  peer 3.0.1.1 route-policy apply_med_50 export

#

3. Swithc B

#

ospf 1

 area 0.0.0.0

  network 3.0.1.0 0.0.0.255

  network 3.0.2.0 0.0.0.255

#

 ip route-static 1.1.1.0 24 3.0.1.1

 ip route-static 5.5.5.0 24 3.0.2.2

#

4. Swithc D

 

#

ospf 1

 area 0.0.0.0

  network 2.0.1.0 0.0.0.255

  network 2.0.2.0 0.0.0.255

#

ip route-static 1.1.1.0 24 2.0.1.1

 ip route-static 5.5.5.0 24 2.0.2.2

#

 

Verifying the configuration

 

1. # Display detailed BFD session information on Switch C.

 [SwitchC]dis bfd session verbose

 Total Session Num: 1     Up Session Num: 1     Init Mode: Active

 

 IPv4 session working in control packet mode:

       Local Discr: 129                  Remote Discr: 129

         Source IP: 3.0.2.2            Destination IP: 3.0.1.1

     Session State: Up                      Interface: N/A

      Min Tx Inter: 400ms                Act Tx Inter: 400ms

      Min Rx Inter: 400ms                Detect Inter: 2000ms

          Rx Count: 2                        Tx Count: 6

      Connect Type: Indirect           Running Up for: 00:16:04

         Hold Time: 1600ms                  Auth mode: None

       Detect Mode: Async                        Slot: 1

          Protocol: BGP

           Version: 1

         Diag Info: No Diagnostic

The output shows that a BFD session has been established between Switch A and Switch C

 

[SwitchC]dis bgp peer ipv4

 

 BGP local router ID: 10.3.1.1

 Local AS number: 200

 Total number of peers: 2                 Peers in established state: 2

 

  * - Dynamically created peer

  ^ - Peer created through link-local address

  Peer                    AS  MsgRcvd  MsgSent OutQ PrefRcv Up/Down  State

 

  2.0.1.1                200      101      101    0       1 01:21:30 Established

  3.0.1.1                200       11       11    0       1 00:06:39 Established

 

The output shows that Switch C has established two BGP connections with Switch A, and both connections are in Established state

 

[SwitchC]ping -a 5.5.5.5 1.1.1.1

Ping 1.1.1.1 (1.1.1.1) from 5.5.5.5: 56 data bytes, press CTRL+C to break

56 bytes from 1.1.1.1: icmp_seq=0 ttl=254 time=2.180 ms

56 bytes from 1.1.1.1: icmp_seq=1 ttl=254 time=6.879 ms

56 bytes from 1.1.1.1: icmp_seq=2 ttl=254 time=1.904 ms

56 bytes from 1.1.1.1: icmp_seq=3 ttl=254 time=1.900 ms

56 bytes from 1.1.1.1: icmp_seq=4 ttl=254 time=1.904 ms

 

2. # Display route 1.1.1.0/24 on Switch C.

[SwitchC]dis ip routing-table 1.1.1.1 verbose

 

Summary count : 1

 

Destination: 1.1.1.0/24

   Protocol: BGP instance default

 Process ID: 0

  SubProtID: 0x1                    Age: 00h17m30s

       Cost: 50              Preference: 255

      IpPre: N/A             QosLocalID: N/A

        Tag: 0                    State: Active Adv

  OrigTblID: 0x0                OrigVrf: default-vrf

    TableID: 0x2                 OrigAs: 0

      NibID: 0x16000001          LastAs: 0

     AttrID: 0x1               Neighbor: 3.0.1.1

      Flags: 0x10060        OrigNextHop: 3.0.1.1

      Label: NULL           RealNextHop: 3.0.2.1

    BkLabel: NULL             BkNextHop: N/A

    SRLabel: NULL             BkSRLabel: NULL

   SIDIndex: NULL               InLabel: NULL

  Tunnel ID: Invalid          Interface: Vlan-interface101

BkTunnel ID: Invalid        BkInterface: N/A

   FtnIndex: 0x0           TrafficIndex: N/A

  Connector: N/A                 PathID: 0x0

   LinkCost: 0               MicroSegID: 0

 

The output shows that Switch C communicates with network 1.1.1.0/24 through the path Switch C<—>Switch B<—>Switch A.

 

3.  # Break down the path Switch C<—>Switch B<—>Switch A and then display route 1.1.1.0/24 on Switch C.

 [Swtich B]interface Ten-GigabitEthernet1/0/1

 [Swtich B-Ten-GigabitEthernet1/0/1]shutdown

 

 [SwitchC]dis ip routing-table 1.1.1.1 verbose

 

Summary count : 1

 

Destination: 1.1.1.0/24

   Protocol: BGP instance default

 Process ID: 0

  SubProtID: 0x1                    Age: 00h00m49s

       Cost: 100             Preference: 255

      IpPre: N/A             QosLocalID: N/A

        Tag: 0                    State: Active Adv

  OrigTblID: 0x0                OrigVrf: default-vrf

    TableID: 0x2                 OrigAs: 0

      NibID: 0x16000002          LastAs: 0

     AttrID: 0x2               Neighbor: 2.0.1.1

      Flags: 0x10060        OrigNextHop: 2.0.1.1

      Label: NULL           RealNextHop: 2.0.2.1

    BkLabel: NULL             BkNextHop: N/A

    SRLabel: NULL             BkSRLabel: NULL

   SIDIndex: NULL               InLabel: NULL

  Tunnel ID: Invalid          Interface: Vlan-interface201

BkTunnel ID: Invalid        BkInterface: N/A

   FtnIndex: 0x0           TrafficIndex: N/A

  Connector: N/A                 PathID: 0x0

   LinkCost: 0               MicroSegID: 0

 

The output shows that Switch C communicates with network 1.1.1.0/24 through the path Switch C<—>Switch D<—>Switch A.

 

Key Configuration

Please rate this case:   
0 Comments

No Comments

Add Comments: