cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11254
Views
5
Helpful
7
Replies

IGP metric copied to BGP MED.

Ullas Upendran
Cisco Employee
Cisco Employee

Hi all

I have an issue of BGP inheriting the Metric value from my IGP into its MED attribute  .I have an EBGP peering with my client . I send only specific routers to my ebgp peer using the network commands in BGP.i recieve those prefixes through  ospf in in my route table.i dont redistribute those routes to bgp, but use network command to advertise in BGP.

My issue is when these prefixes are send out to my EBGP peer it takes the IGP metric value and attach it as MED value .This is affecting the route selection of my client who is in an MPLS cloud. Is this a normal behaviour ... or how can i stop BGP to send this MED value out.

Kind regards

Ullas

1 Accepted Solution

Accepted Solutions

Discovering that you are actually sending MEDs to an eBGP neighbor, although you never intended to, can come as a surprise, but it does happen. If the route injected into BGP (either using 'network' or 'redistribute' command) comes from an IGP, the MED is derived from the IGP metric, and the route is advertised to an eBGP neighbor with this MED. Guiseppe has already provided a solution for your problem. Another option is to inject routes into BGP using the 'aggregate-address' command, in which case the MED is not set. I personally prefer the 'network' command configuration combined with the solution that Guiseppe suggested.

View solution in original post

7 Replies 7

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Ullas,

if you need to set a metric value for all your routes to be sent to neighbor you can do the following:

route-map set_metric permit 10

! matching criteria for route filtering here if needed

set metric

router bgp yourASN

neigh ebgp.neigh.ipaddress route-map set_metric out

see

http://www.cisco.com/en/US/docs/ios/iproute/command/reference/irp_pi2.html#wp1013228

Hope to help

Giuseppe

HI

     I dont want to set any med value to those prefixes i am advertising. I want to stop BGP from inheriting the IGP metric value to its MED attribute.

Kind regards

Ullas

Discovering that you are actually sending MEDs to an eBGP neighbor, although you never intended to, can come as a surprise, but it does happen. If the route injected into BGP (either using 'network' or 'redistribute' command) comes from an IGP, the MED is derived from the IGP metric, and the route is advertised to an eBGP neighbor with this MED. Guiseppe has already provided a solution for your problem. Another option is to inject routes into BGP using the 'aggregate-address' command, in which case the MED is not set. I personally prefer the 'network' command configuration combined with the solution that Guiseppe suggested.

Maria,

Can you please point me to a Cisco document that says "the MED is derived from the IGP metric, and the route is advertised to an eBGP neighbor with this MED" ?

Thanks,

Mohamad

As I have said in thread : https://supportforums.cisco.com/message/1319951#1319951 , I have seen this issue in action. What I didn't say there is the reason I remember it. We had a very strong disagreement within our team about what was going on. I could see our IGP metrics being passed to the upstream provider MED values when using the upstream's looking glass, and there was no way they could have known our IGP metrics to set the MEDs accordingly. At the time I could not find any source documenting this behavior, and still don't know of a document in CCO that does. I have seen this behavior documented later only in the book "BGP Design and Implementation" by cisco press (page 19).

Thanks, Maria. I have seen the issue in action too, but I couldn't find any Cisco document

to verify that.

I am currently implementing a solution in which I want to use the OSPF metric to  be used by a bgp peer to select the best path. My test bed does verify that the OSPF metric is being copied to BGP MED.

Please consult the following document:

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

It does show that OSPF metric is distributed to BGP peer, but doesn't say it.

Thanks,

Mohamad

This document talks about redistribution of OSPF into BGP. The fun part occurs when you are not redistributing anything into BGP, but rather use network command to originate the routes on a border router, as was the case in this thread.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card