06-15-2016 07:14 PM - edited 03-05-2019 04:14 AM
Hi we know BGP path attribute order is weight, local preference and ..., but I notice one thing: if two routers A and B are connected as iBGP peer.
Both routers advertise the same network, but router B advertises the network with local preference 200. The routerA still prefer its own network as best one. Do you think this is contrary with the normal BGP path attribute order? Thank you
Solved! Go to Solution.
06-15-2016 07:26 PM
Hi,
By default the locally advertised network/prefix will be marked with a weight of 32768. Weight is a local attribute and is not advertised over BGP. So any received prefix from neighbor will be treated with lower weight of value 0 while local one is with 32768.
HTH,
Nagendra
06-15-2016 07:19 PM
Could you please paste the output of the prefix from both the IBGP peers A and B.
06-15-2016 07:27 PM
routerA and B are connected with ip address 12.1.1.1 and 12.1.1.2( as bgp neighbor ip address)
routerB advertises network 1.1.1.1/32 with local preference 200
RouterA(config-router)#do sh ip bgp
BGP table version is 4, local router ID is 2.2.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* i 12.1.1.2 0 200 0 i
06-15-2016 07:50 PM
if you have a triangular topology with R1 having an ebgp peering with R2 and R3 and with R2 and R3 having IBGP peering, then you would be able to see the prefix from R1 as best path learnt via the router setting it with local preference 200.
R2#sh ip bgp 1.1.1.1 <<<<<< prefix advertised from R1
BGP routing table entry for 1.1.1.1/32, version 11
Paths: (2 available, best #1, table default)
Advertised to update-groups:
1
Refresh Epoch 2
200
23.23.23.2 from 23.23.23.2 (23.23.23.2)
Origin IGP, metric 0, localpref 200, valid, internal, best
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 3
200
10.1.12.1 from 10.1.12.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
from what i see in your output, i see 1.1.1.1/32 with next-hop 0.0.0.0 which means that it is locally advertised, so you are not having any EBGP peering with any device
for the locally advertised prefix between the IBGP peers, local-preference will not play any role. here weight will be kicking in as the weight is not advertised.
Hope this helps.
Regards
Vinit
06-15-2016 07:52 PM
just realized.. Nagendra has already replied..
Thx.
06-15-2016 08:17 PM
06-15-2016 08:55 PM
RIB failure is seen for IGP learnt prefixes. having said that, if a link address is advertised by the connected peer and the receiving router has that network as its local address, then it will show RIB-Failure.
check the output of 2.2.2.2 on both R2 and R3 here:
R2#sh ip bgp
*Jun 16 03:46:32.530: %SYS-5-CONFIG_I: Configured from console by console
BGP table version is 14, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.1/32 23.23.23.2 0 200 0 200 i
* 10.1.12.1 0 0 200 i
*> 2.2.2.2/32 0.0.0.0 0 32768 i
r>i 10.1.12.0/24 23.23.23.2 0 200 0 200 ?
R3#sh ip bgp
BGP table version is 6, local router ID is 23.23.23.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 10.1.13.1 0 200 0 200 i
r>i 2.2.2.2/32 23.23.23.1 0 100 0 i
*> 10.1.12.0/24 10.1.13.1 0 200 0 200 ?
r> 10.1.13.0/24 10.1.13.1 0 200 0 200 ?
Hope this answers your question.
Regards
Vinit
06-16-2016 07:59 AM
What i am meaning is that once there is *> in front of 1.1.1.1, the prefix should go into routing table. but it does not go into the routing table..
06-16-2016 07:59 AM
Hi,
Any BGP router will run best path algorithm for all (learnt and locally redistributed) prefixes. The best path will be marked as *>. Now the learnt prefixes (and the locally redistributed) will be checked to see if it should be installed in Routing table. If there exist any otehr better admin distance, the prefix will be marked as r> in the BGP table.
So it is common to not see r> for locally redistributed/advertised prefixes (IOW the one with NextHop as 0.0.0.0)
HTH,
Nagendra
06-16-2016 06:42 PM
Any BGP router will run best path algorithm for all (learnt and locally redistributed) prefixes. The best path will be marked as *>.
I agree the above. but
If there exist any otehr better admin distance, the prefix will be marked as r> in the BGP table.
Now there have been loopback0 1.1.1.1/32 in routing table, which is better than bgp' 1.1.1.1/32. so i think the bgp' 1.1.1.1 should be r>1.1.1.1 when using command -- show ip bgp
06-16-2016 07:22 PM
Hi,
As mentioned in my earlier post, "the learnt prefixes" (IOW, the one received from other neighbors) will be checked if they need to be installed in routing table. In your case, the loopback address 1.1.1.1/32 is not learnt from any neighbors. So it will not be checked to be installed in routing table.
-Nagendra
06-15-2016 07:26 PM
Hi,
By default the locally advertised network/prefix will be marked with a weight of 32768. Weight is a local attribute and is not advertised over BGP. So any received prefix from neighbor will be treated with lower weight of value 0 while local one is with 32768.
HTH,
Nagendra
06-15-2016 08:17 PM
06-16-2016 07:35 AM
Hi,
r>1.1.1.1/32 would mean this route is the best from BGP point of view but failed to get to the RIB for some reason.
But in your case the route is in the RIB (as it is a loopback interface) and was inserted by the
router to its BGP table (either by network command or redistributing connected subnets).
And due to the Weight attribute it is also the best route from BGP point of view.
So *>1.1.1.1/32 is correct here.
BR,
Milan
09-06-2016 05:17 PM
Great! you are right! Thank you
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide