Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

Query on BGP route distribution

Hello Everyone

In the below scenario (GNS3), IBGP peering enabled between R1-R2, R1-R3, R2-R3 and EBGP peering enabled between R2-R4,R3-R5,R4-R6,R5-R7. OSPF enabled as IGP. Scenario attached for reference.

 

The problem I've observed in R1 is not getting entire BGP routing table for destinations 30.x.x.x/40.x.x.x.

I'm able to see only best routes in R1 BGP routing table, but alternate valid routes are not visible in its topology table.

R1#sh ip bgp
BGP table version is 81, local router ID is 100.100.2.1

*>i30.30.1.0/24     10.10.1.2                0    100      0 200 300 ?
*>i30.30.2.0/24     10.10.1.2                0    100      0 200 300 ?
*>i40.40.1.0/24     10.10.2.2                0    100      0 200 400 i
*>i40.40.2.0/24     10.10.2.2                0    100      0 200 400 i

*> 100.100.1.0/24   0.0.0.0                  0         32768 i
*> 100.100.2.0/24   0.0.0.0                  0         32768 i

 

More confusing part to me is when I disable IBGP peering between R2-R3 or shutdown interface between R2-R3 or else if I disable ospf in R1,R2 & R3 routers , I'm able to see both best route and alternate valid route in BGP topology table.

R1#sh ip bgp

   Network          Next Hop            Metric LocPrf Weight Path
* i30.30.1.0/24     10.10.2.2                0    100      0 200 400 300 ?
*>i                 10.10.1.2                0    100      0 200 300 ?
* i30.30.2.0/24     10.10.2.2                0    100      0 200 400 300 ?
*>i                 10.10.1.2                0    100      0 200 300 ?
* i40.40.1.0/24     10.10.1.2                0    100      0 200 300 400 i
*>i                 10.10.2.2                0    100      0 200 400 i
* i40.40.2.0/24     10.10.1.2                0    100      0 200 300 400 i
*>i                 10.10.2.2                0    100      0 200 400 i
*> 100.100.1.0/24   0.0.0.0                  0         32768 i
*> 100.100.2.0/24   0.0.0.0                  0         32768 I

 please help to explain this behavior.

Config pasted for your reference:

R1#

router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 100.100.1.0 mask 255.255.255.0
 network 100.100.2.0 mask 255.255.255.0
 neighbor 10.10.1.2 remote-as 100
 neighbor 10.10.2.2 remote-as 100
 no auto-summary
!

R2#

router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.10.1.1 remote-as 100
 neighbor 10.10.1.1 next-hop-self
 neighbor 10.10.3.2 remote-as 100
 neighbor 10.10.4.2 remote-as 200
 no auto-summary
 

R3#router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.10.2.1 remote-as 100
 neighbor 10.10.2.1 next-hop-self
 neighbor 10.10.3.1 remote-as 100
 neighbor 10.10.5.2 remote-as 200
 no auto-summary
 

R4#router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.10.4.1 remote-as 100
 neighbor 10.10.6.2 remote-as 300
 no auto-summary
!
R5#router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.10.5.1 remote-as 100
 neighbor 10.10.7.2 remote-as 400
 no auto-summary
 

R6#router bgp 300
 no synchronization
 bgp log-neighbor-changes
 redistribute static
 neighbor 10.10.6.1 remote-as 200
 neighbor 10.10.8.2 remote-as 400
 no auto-summary

ip route 30.30.1.0 255.255.255.0 Loopback0
ip route 30.30.2.0 255.255.255.0 Loopback0
 

R7#router bgp 400
 no synchronization
 bgp log-neighbor-changes
 network 40.40.1.0 mask 255.255.255.0
 network 40.40.2.0 mask 255.255.255.0
 neighbor 10.10.7.1 remote-as 200
 neighbor 10.10.8.1 remote-as 300
 no auto-summary
 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, IMHO: When the line

Hi,



 

IMHO: When the line between R3 and R2 is Up, R3 is getting the best route to 30.30.x.x via R2 (shorter AS_PATH than from R5).

But it does NOT advertise this best route to R1, as a route learnt from one iBGP neighbor is not advertised to other iBGP neighbors (iBGP split horizon rule).

So only R2 is advertising his best route (learnt via eBGP) for 30.30.x.x to R1.

Symmetric situation is for 40.40.x.x - only R3 is advertising his best (eBGP learnt) route to R1, because R2 learnt the best route for 40.40.x.x from R3 via iBGP.


 

When the line between R2 and R3 is down, both routers advertise their best routes learnt via eBGP to R1.


 

Best regards,

Milan

 

5 REPLIES
Cisco Employee

When you have the R2-R3 link

When you have the R2-R3 link enabled, 40.x.x.x prefixes will be preferred by R3 and 30.x.x.x will be preferred by R2 due to AS_PATH.
So R2 will install 40.x.x.x prefixes pointing to R3 and vice versa to 30.x.x.x routes.

I would need to check it to make sure, but let's take 40.x.x.x routes as an example, R2 would install it pointing to R3, it would send it to R1, but although it is the originator, the NH would still be R3 as it is an iBGP.
That's what I think it is happening, what you can do is to enable R2-R3 link and check the advertised routes to R1 "show ip bgp neighbor 10.10.1.1 advertised-routes"
You can also enable in R1 the command "neighbor A.B.C.D soft-reconfiguration inbound" to R2 and then check the received routes with "show ip bgp neighbor x.x.x.x received-routes"


Let me know if you can confirm that on your lab as I just changed my mac and I'm too lazy to install gns3 :-)

If it does not answer your question I'll go ahead and install it.

Hi, IMHO: When the line

Hi,



 

IMHO: When the line between R3 and R2 is Up, R3 is getting the best route to 30.30.x.x via R2 (shorter AS_PATH than from R5).

But it does NOT advertise this best route to R1, as a route learnt from one iBGP neighbor is not advertised to other iBGP neighbors (iBGP split horizon rule).

So only R2 is advertising his best route (learnt via eBGP) for 30.30.x.x to R1.

Symmetric situation is for 40.40.x.x - only R3 is advertising his best (eBGP learnt) route to R1, because R2 learnt the best route for 40.40.x.x from R3 via iBGP.


 

When the line between R2 and R3 is down, both routers advertise their best routes learnt via eBGP to R1.


 

Best regards,

Milan

 

Cisco Employee

Milan is right, did not pay

Milan is right, did not pay attention of them being iBGP :-)

There's you answer.

Community Member

Hi Milin & Renan,Thanks for

Hi Milin & Renan,

Thanks for your replies. To narrow down the problem, I’ve shut down the 40.40.x.x network.

Now between R2-R3, R3 is not advertising 30.30.X.X network to R2, but whereas R2 is advertising 30.30.X.X network to R3. Why R3 is not advertising 30.30.X.X (route via 200 400 300) to R2.

R2#sh ip bgp ( No alternate route)

 Network          Next Hop            Metric LocPrf Weight Path

*> 30.30.1.0/24     10.10.4.2                              0 200 300 ?

*> 30.30.2.0/24     10.10.4.2                              0 200 300 ?

*>i100.100.1.0/24   10.10.1.1                0    100      0 i

*>i100.100.2.0/24   10.10.1.1                0    100      0 i

R2#sh ip bgp summary

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

10.10.1.1       4   100      96      98        5    0    0 01:05:50        2

10.10.3.2       4   100      98     100        5    0    0 01:05:54        0

10.10.4.2       4   200     100      98        5    0    0 01:05:39        2

 

R3#sh ip bgp  ( only in R3 we can see both best route & alternate route)

   Network          Next Hop            Metric LocPrf Weight Path

*>i30.30.1.0/24     10.10.3.1                0    100      0 200 300 ?

*                   10.10.5.2                              0 200 400 300 ?

*>i30.30.2.0/24     10.10.3.1                0    100      0 200 300 ?

*                   10.10.5.2                              0 200 400 300 ?

*>i100.100.1.0/24   10.10.2.1                0    100      0 i

*>i100.100.2.0/24   10.10.2.1                0    100      0 i

 

R3#sh ip bgp summary

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

10.10.2.1       4   100      54      57       19    0    0 00:50:17        2

10.10.3.1       4   100      62      60       19    0    0 00:27:22        2

10.10.5.2       4   200      58      58       19    0    0 00:50:08        2

 

Cisco Employee

BGP only advertises the

BGP only advertises the preferred network, not all the learned ones, so R3 learns 30.30.X.X network through R2 and R5, it chooses R2 because of a shorter AS_PATH, there's no reason to advertise the route back to it's originator, now, if you go to R2 and shut the neighbor to R4, R3 will start advertising the prefix it learned from R5.  

109
Views
5
Helpful
5
Replies
CreatePlease to create content