I have a router that is getting routes from two iBGP peers, setting the MED on those routes, and then advertising that route to an eBGP peer. The thing is, the MED isn't being preserved when the routes are advertised to the eBGP peer. There is no MED value sent at all. Is that standard BGP export policy to an eBGP peer, don't send any MED by default? Is there a way to preserve the MED that is attached to a route when you advertise it to an eBGP peer?
I have a router that is getting routes from two iBGP peers, setting the MED on those routes,
Are You setting MED in iBGP import policy? I wonder what exactly are You trying to achieve? You should be using Local Preference inside Your own AS to influence path selection, that's what the LP is for.
MED is optional nontransitive - so router on the edge of the AS removes the attribute prior to sending the route(this is junos default and can be changed through export policy). When MED attribute is received from an EBGP peer it is advertised to all IBGP peers.
The BGP multiple exit discriminator (MED, or MULTI_EXIT_DISC) is a non-transitive attribute, meaning that it is not propagated throughout the Internet, but only to adjacent autonomous systems (ASs). The MED attribute is optional, meaning that it is not always sent with the BGP updates. The purpose of MED is to influence how other ASs enter your AS to reach a certain prefix.
The MED attribute has a value that is referred to as a metric.
Thanks for the replies. I essentially have two routers that have the same EBGP peer. I'd like to use the LP, or the metric, these two routers have assigned to a certain route and use that as the MED that gets advertised to the EBGP peer.
If the route already has MED attribute, you can send MED to the eBGP peer, with preserving the metric value, by configuring "... then metric add 0" on router's export policy configured for the eBGP peer. Here, "0" is the constant value to be added to the existing MED metric in the route.