09-24-2009 10:24 PM - edited 03-04-2019 06:09 AM
Hi guys! here again with some questions:
While using BGP, I've read that prefixes have a default MED of 0 if no value is present in the updates of a EBGP peer.
My questions is, why some times the MED is present and some others it does not? I mean in the output of the " show ip bgp" I was trying to figure it out, and at first i tought that it displayed a 0 if the prefix was originated in the contiguous AS, but i found other prefixes originated many AS hops away that also displayed a 0 in the "show ip bgp". So what's the rule here? I know for example, that Local Preference defaults to 100 on prefixes from IBGP peers, but for EBGP prefixes it displays nothing, but for MED?
Thanks in advance!!
09-25-2009 01:45 AM
Hello Omar.
Can you paste us your 'show ip bgp' ?
Thanks
Simon.
09-25-2009 03:57 AM
Hello Omar,
the key point is that BGP allows to advertise prefixes without a MED attribute so there is not a single rule that everyone follows.
The presence of MED or not depends also on the way the prefix is injected in the BGP table on BGP originator node.
it is possible to mark a missing MED as worst using
bgp bestpath med missing-as-worst
see
http://www.cisco.com/en/US/partner/docs/ios/iproute/command/reference/irp_bgp1.html#wp1012195
or
http://www.cisco.com/en/US/docs/ios/iproute/command/reference/irp_bgp1.html#wp1012195
Hope to help
Giuseppe
09-25-2009 07:52 AM
Here is a printscrint of the output, sorry for the screenshot, It's from a PDF and can't copy it.
And yes :P I did it in a rack so it's not a missprint haha, in real devices it does the same thing.
What I'm looking for is some kind of rules as to when does it put a 0. For example, in the output the 67.7 router is a EBGP peer, but ive seen the same think (no MED, or at least not showed) from IBGP peers.
thanks in advance!
09-25-2009 10:58 AM
Hello Omar,
by looking at your sh ip bgp example we can make some notes:
advertisements with MED=0 are the result of the usage of network command on originating router.
We can notice the origin code i (rightmost character in the line).
instead the lines that refer to advertisements with a missing MED attribute have origin code ? so they are the result of redistribution into BGP of another routing protocol (or connected or static).
Here best paths are chosen based on the shortest AS path (> symbol).
Hope to help
Giuseppe
09-25-2009 11:21 AM
09-25-2009 11:35 AM
Hello Omar,
I wonder if a route-map setting origin to i has been used to create the eBGP routes with origin i and missing MED.
This is technically possible (set origin igp in route-map config).
But it looks like we cannot say anything definitive here.
I can say that MED can miss on a great quota of BGP routes in a real BGP table.
So, you cannot be sure that MED is present in a line of a sh ip bgp.
Hope to help
Giuseppe
09-26-2009 09:27 AM
I solved this trough trial&error, made some scenarios and here is the resulting rules:
1.- If the prefix is comming from a iBGP peer and the metric is not set, the "show ip bgp" shows MED = 0.
2.- If the prefix is comming from a eBGP peer, the metric is not set, and that eBGP peer is the originator of the prefix (by means of redistribution or network statement), the "show ip bgp" shows MED = 0
3-. If the metric has been modified, then for every prefix from (iBGP and eBGP) the MED is shown.
3.- Else, MED = null
Thanks for the help!
04-22-2010 08:39 AM
The problem with a MED value of zero is that it wins in most cases, which may not necessarily result in the best path (or preferred path). That is because if MED is inserted into BGP updates from external peers, the number is more often than not >0
I question why iBGP updates even contain a MED value at all. Its purpose it to hint to external neighbors about preferred inbound paths.
Ajaz
04-22-2010 10:00 PM
Hi Ajay,
I question why iBGP updates even contain a MED value at all. Its purpose it to hint to external neighbors about preferred inbound paths.
---->1 use for this is when you are using Multihoming with single ISP,since MED vlaue do not cross the AS others router in the
AS come to know about the exit point for the destination network ( customer ) through that MED which is used by IBGP ,you could also use AS prepend to acheive this but when you have multihoming with single ISP MED is a better option since the memory and processing required for AS prepend routes are more.
Chao
Vishwa
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: