BGP static floating routes ... how it works?

Unanswered Question
Jul 1st, 2008
User Badges:

HI,

I'm studing for BGP exam but I have some doubts on how the redistribution process works, so I would like to discuss about it. Netpro.txt contains the explanation of the issue, and confs.rar the configurations of the small lab I created.


Thanks in advance.


Marco.




  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
purohit_810 Tue, 07/01/2008 - 05:18
User Badges:
  • Silver, 250 points or more

Why are you giving TAG 1000? - Can you remove and check?


Thanks,

Dharmesh Purohit

Marcofbbr Wed, 07/02/2008 - 04:13
User Badges:

Hi Purohit,

router tagging does not influence the routing decisions in this case. I left the tagging since I was doing other "experiments" ;-)


Thanks


Marco

royalblues Wed, 07/02/2008 - 04:27
User Badges:
  • Green, 3000 points or more

The reason for the behavior you are seeing is due to the fact that BGP does not use Administrative distance while choosing the best path.


BGP receives 2 paths one from the neighbor and one via redistribution before it applies the best path algorithm.

As algorithm, a route originated from the router would be preferred which in your case is due to the redistribution.


The Protocol is behaving at it should and is not any IOS bug


HTH

Narayan

Marcofbbr Wed, 07/02/2008 - 15:36
User Badges:

---

BGP receives 2 paths one from the neighbor and one via redistribution before it applies the best path algorithm.

As algorithm, a route originated from the router would be preferred which in your case is due to the redistribution.

---

Hi Narayan,

thank you for your answer


OK, but the IOS has two routes that are in competition for the a "place" in the routing table (after BGP calculates the best path):

1st - the static route (with lower admin distance)

2nd - the BGP redistributed route


If you take a look to the "show ip bgp" command on R4, the algorithm clearly chooses as best path(>)the redistributed route:

* i10.1.2.0/24 10.3.4.1 0 100 0 ?

*> 0.0.0.0 0 32768 ?


Now, all the documentation I've read until now, says that the router with ">" is installed in the forwarding table, but problably, in this case where the IOS have to choose which route to install between a static and a redistributed one, there is an exception and th admin. distance is not taken in account.


If you are sure about that, I trust you , since I didn't find any documentation about that.


Thanks


Marco



royalblues Wed, 07/02/2008 - 16:24
User Badges:
  • Green, 3000 points or more

Marco


When BGP injects a local route into the BGP table, it gives it a weight of 32768, by default. In your case, it is the statuc learned route that is getting injected into BGP with a weight of 32768. The same route is also being learned via EBGP. EBGP routes, by default, will be given a weight of 0 and a local preference of 100. Now, the BGP table will have two routes for the same prefix - which you will see if you enter in 'sh ip bgp '. Since weight is the highest ranked parameter in the BGP best path selection process, the locally-injected route will take preference and will be selected as the best route. Therefore, as far as the routing table is concerned, the best BGP path for that prefix is the locally-injected route (which was learned via statuc). That is why you see that the installed route is a static route.


Since the route learned via static is faster (as it is configured first) and then when you redistribute it into BGP, the best apth algorithm chooses the locally redistributed route. If you had configured the static route at R4 after the BGP configuration, you would have seen the route as being learnt via BGP.


If you want to always prefer the route via BGP, then you would need some kinda route-map


At R4


router bgp 34

redistribute static route-map static2BGP


route-map static2BGP permit 10

match ip address 10

set weight 0

set local-preference 50


access-list 10 permit 10.1.2.0 0.0.0.255


HTH

Narayan


Actions

This Discussion