cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1036
Views
10
Helpful
14
Replies

BGP path attributes

wfqk
Level 5
Level 5

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

1 Accepted Solution

Accepted Solutions

Nagendra Kumar Nainar
Cisco Employee
Cisco Employee

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

View solution in original post

14 Replies 14

Vinit Jain
Cisco Employee
Cisco Employee

Could you please paste the output of the prefix from both the IBGP peers A and B.

Thanks
--Vinit

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

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

Thanks
--Vinit

just realized.. Nagendra has already replied.. 

Thx.

Thanks
--Vinit

One more question: Please see the attached picture. Since routerA already has loopback1 ip address 1.1.1.1, the output of show ip bgp should be r>1.1.1.1/32 instead of *>1.1.1.1/32, do you agree? 

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

Thanks
--Vinit

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..

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

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 

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

Nagendra Kumar Nainar
Cisco Employee
Cisco Employee

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

One more question: Please see the attached picture. Since routerA already has loopback1 ip address 1.1.1.1, the output of show ip bgp should be r>1.1.1.1/32 instead of *>1.1.1.1/32, do you agree? 

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

Great! you are right! Thank you

Review Cisco Networking for a $25 gift card