BGP Routes are not updating with Loopback peering

Hello,

Here is my setup,

As per my setup,
I have two OpenWrt routers (D1 and D2) which are directly connected via two links.

As per my requirement, I need to establish BGP session between D1 and D2 via Loopback IP. ---> Its Working.
Now, If I disconnect any one link, my BGP session is active via the other link. ---> Expected behaviour.

Now my concern is that I need to share the local network of each device with each other via BGP.
Initially, the routes are been shared as expected, but after disconnecting one link, the routes are not getting updated to the new link through which the BGP session is established.

Please find the configuration for further understanding

Device 1

BGP Configuration:

router bgp 64644
 bgp router-id 10.181.6.75
 network 192.168.10.0/24
 neighbor 2.2.2.2 remote-as 64644
 neighbor 2.2.2.2 disable-connected-check
 neighbor 2.2.2.2 update-source 1.1.1.1
 distance bgp 20 200 20
!
ip route 2.2.2.2/32 10.10.10.2
ip route 2.2.2.2/32 20.20.20.2
!

Device 2

BGP Configuration:

router bgp 64644
 bgp router-id 10.181.6.76
 network 192.168.11.0/24
 neighbor 1.1.1.1 remote-as 64644
 neighbor 1.1.1.1 disable-connected-check
 neighbor 1.1.1.1 update-source 2.2.2.2
 distance bgp 20 200 20
!
ip route 1.1.1.1/32 10.10.10.1
ip route 1.1.1.1/32 20.20.20.1
!

The BGP session has got established and the routes are shared initially,

BGP router identifier 10.181.6.75, local AS number 64644
RIB entries 3, using 216 bytes of memory
Peers 1, using 4944 bytes of memory

Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4 64644      22      23        0    0    0 00:18:04        1

Total number of neighbors 1

Total num. Established sessions 1
Total num. of routes received     1

BGP table version is 0, local router ID is 10.181.6.75
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
              i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 192.168.10.0     0.0.0.0                  0         32768 i
*>i192.168.11.0     2.2.2.2                  0    100      0 i

Displayed  2 out of 2 total prefixes


Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, A - Babel, N - NHRP,
       > - selected route, * - FIB route

C>* 1.1.1.1/32 is directly connected, lo
S>* 2.2.2.2/32 [1/0] via 10.10.10.2, eth1
  *                  via 20.20.20.2, eth2
C>* 10.10.10.0/24 is directly connected, eth1
C>* 10.171.0.0/24 is directly connected, wg0
K>* 10.171.0.1/32 is directly connected, wg0
C>* 20.20.20.0/24 is directly connected, eth2
C>* 127.0.0.0/8 is directly connected, lo
B>  192.168.11.0/24 [200/0] via 2.2.2.2 (recursive), 00:00:16
  *                           via 10.10.10.2, eth1, 00:00:16
  *                           via 20.20.20.2, eth2, 00:00:16


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
**2.2.2.2         10.10.10.2      255.255.255.255 UGH   20     0        0 eth1**
10.10.10.0      0.0.0.0         255.255.255.0   U     0      0        0 eth1
10.171.0.0      0.0.0.0         255.255.255.0   U     0      0        0 wg0
10.171.0.1      0.0.0.0         255.255.255.255 UH    0      0        0 wg0
20.20.20.0      0.0.0.0         255.255.255.0   U     0      0        0 eth2
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 br-lan
**192.168.11.0    10.10.10.2      255.255.255.0   UG    20     0        0 eth1**

Now the eth1 link is disconnected.


Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, A - Babel, N - NHRP,
       > - selected route, * - FIB route

C>* 1.1.1.1/32 is directly connected, lo
S>* 2.2.2.2/32 [1/0] via 10.10.10.2 inactive
  *                  via 20.20.20.2, eth2
C>* 10.171.0.0/24 is directly connected, wg0
K>* 10.171.0.1/32 is directly connected, wg0
C>* 20.20.20.0/24 is directly connected, eth2
C>* 127.0.0.0/8 is directly connected, lo
B>  192.168.11.0/24 [200/0] via 2.2.2.2 (recursive), 00:02:16
  *                           via 10.10.10.2, 00:02:16
  *                           via 20.20.20.2, eth2, 00:02:16


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
**2.2.2.2         20.20.20.2      255.255.255.255 UGH   20     0        0 eth2**
10.10.10.0      0.0.0.0         255.255.255.0   U     0      0        0 eth1
10.171.0.0      0.0.0.0         255.255.255.0   U     0      0        0 wg0
10.171.0.1      0.0.0.0         255.255.255.255 UH    0      0        0 wg0
20.20.20.0      0.0.0.0         255.255.255.0   U     0      0        0 eth2
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 br-lan
**192.168.11.0    10.10.10.2      255.255.255.0   UG    20     0        0 eth1**

Note: Here the Loopback route is switched to that other link, but the BGP shared route is still via the disconnected link. So in this case I am not able to reach the network.
If I restart the quagga, then the routes are getting updated with the connected WAN.

I am not sure whether this case is expected or not, Coming forward I would like to get some solution from anyone who can figure out what exactly happens out here.

Use an IGP to properly exchange the status of the links and disable route-cache.

Hi @trendy

I have resolved this issue by configuring the loopback static route with metric

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.