cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3674
Views
0
Helpful
5
Replies

BGP Metric in show ip bgp output

zapodeanu.g
Level 1
Level 1

This is a part of the show ip bgp command output:

mfr-3662#sh ip bgp

BGP table version is 23451883, local router ID is x.x.x.x

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

* 6.1.0.0/16 65.121.100.200 26000 0 209 701 668 i

*> 144.228.200.51 11 0 1239 701 668 i

* 6.2.0.0/22 65.121.100.200 26000 0 209 701 668 i

*> 144.228.200.51 11 0 1239 701 668 i

* 6.3.0.0/18 65.121.100.200 26000 0 209 701 668 i

*> 144.228.200.51 11 0 1239 701 668 i

It seems that the path selection decision is made based on the lower "Metric" that Sprint routes have.

What is the "Metric" and how is it calculated?

Thanks,

Gabi

5 Replies 5

rwcrowe
Level 1
Level 1

See the following URL. There is a lot of determining factors that are involved in choosing the best BGP metric to use, depending on IBGP,EBGP, AS_PATH, etc.

http://www.cisco.com/en/US/tech/tk365/tk207/technologies_tech_note09186a0080094823.shtml

I know the BGP path selection is made on the attributes but no information I could found if these attributes are used to calculate the metric or not. In this case the customer did not change the local pref. or the weight and it looks that the path is the same. My question is how is the metric calculated? Does it have any relevance in the routing decision?

Thanks,

Metric means MED in this case; lower MEDs are preferred. If you're receiving non-default (i.e., non-zero) MED values from providers, it's because the providers are calculating them internally somehow and sending them to you along with the routes themselves. You can use an inbound routing policy to zero them out, if you'd like.

Note however that MEDs aren't typically compared from different AS's, which would prevent them from coming into play in your case. (The "bgp always-compare-med" command overrides this.) So it could be router ID that is breaking the tie here.

Thanks for your reply. Is it any way to find out what are the two router Id's for the two providers or see a routing update that comes from both to learn more about why the selection is done in this way? Is it possible to config BGP so it would not look at the router Id's?

Thanks, Gabi

"show ip bgp neighbors " will show you the remote router's router-ID.

See http://www.cisco.com/en/US/tech/tk365/tk80/technologies_tech_note09186a0080094431.shtml for some more information. It turns out that router-ID is ignored by default; I had forgotten about this. The reason the routes from Sprint are preferred in your case may simply be that you're receiving them before you receive the routes from Qwest. I can't recall if there's a command that will spell out for you why a particular route was or wasn't chosen -- someone else here may know. (Juniper makes this easy, but I don't recall having ever done it on a Cisco.) But a "show ip bgp " may make it easier to compare the attributes of received routes.

Review Cisco Networking for a $25 gift card