I have a BGP session with a transit provider in two different cities. We are both using the same AS at both locations. I am expecting them to be sending me MED's for me to use for routing decisions of outbound traffic. (ie. so I can send traffic to the router that is nearest my destination, other customers in the same city)

How can I verify that I am really receiving those MED's?

I have Brocade XMR's.

If I do a show ip bgp routes, I see the following:

Total number of BGP Routes: 445744
       Prefix             Next Hop        MED        LocPrf     Weight Status
2         4.53.x.x     0          100        0      BE
         AS_PATH: 3356 15169
3         4.53.x.x     0          100        0      BE
         AS_PATH: 3356 3549 6939 6939 7545 56203

Browsing through several pages of the output, the MED always shows 0. I don't want to manually check all 1/2 million routes.


Removing previous answer as I misunderstood the question, and my previous answer was actually incorrect - MED is exchanged between peer ASN's but is not propagated beyond that (meaning it won't transit an AS to propagate to another AS). However it's still an optional attribute, so it's not required of an implementation to pass on the MED between eBGP/iBGP speakers. MED is typically only evaluated in the best path selection process if there are multiple paths coming from the same AS (relevant in your scenario).

If you've got the same provider at both locations it's likely that they'd set a MED on all of the prefixes rather than a subset, and if you don't see that in your output, it's likely that they're not sending you MED's. However it's also a possibility that they're only setting MEDs on aggregates that the provider actually owns rather than peer/customer prefixes. This doesn't mean that you can't set the MED yourself as part of your inbound policy for your iBGP routers to pay attention to however. Also consider sending MEDs to your provider to force them to do cold-potato routing towards you.

Edit: to also include @MikePennington's good and relevant info and depending on your design, your IGP will also solve this problem for you without the need to worry about setting MEDs or LP values.

To answer your question, you could create a route-map with a match clause that matches a given MED value, and then do show ip bgp routes route-map [route-map-name]. For this I'd recommend something like:

route-map ONLY-MED deny 10
    match metric 0
route-map ONLY-MED permit 20

# show ip bgp routes route-map ONLY-MED

This should show you all the prefixes that don't have a MED of 0 set.

  • My understanding was that it IS communicated between neighboring AS's, but not beyond the neighbors.
    – zevlag
    Jun 4 '13 at 19:36
  • 3
    FYI for the OP, BGP automagically considers the IGP metric to the BGP next-hop as part of the path selection process, as long as the candidate BGP paths are tied... so MEDs / local-pref might not be required, if he can differentiate with IGP metrics
    – This
    Jun 4 '13 at 19:37
  • I can easily set the MED/LocalPref on my side if needed, but I'd prefer not to. I really want to be getting MED from my transit provider. POP A is 500 miles from POP B, and I sit right in the middle, with a 10 GigE to both, this makes everything equal until I get down to Step 14: Prefer the route that comes from the lowest BGP4 neighbor address brocade.com/downloads/documents/html_product_manuals/…
    – zevlag
    Jun 4 '13 at 19:48
  • @zevlag, I'm talking about Step 9 of Brocade's path selection process; thus it doesn't explicitly require you to set MED / local-pref if your IGP costs to the next hops are not the same between the POPs in question
    – This
    Jun 4 '13 at 20:15
  • @zevlag - you're correct, and I've edited my answer. Sorry about that. Check out my revised answer for a solution to your problem re: filtering prefixes that don't have a MED set. Jun 4 '13 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.