How to configure BGP MED Attribute

MED = Multi-Exit Discriminator

AS Path pre-pending and MED are both ways in which you are trying to influence inbound traffic into your AS–these are really the only two tools available for you for this purpose. So you are right in the sense that they serve the same purpose, but they do so via different BGP attributes (obviously). In reality, almost no-one uses MED, for two reasons: 1) As you point out, MED will only be learned by your directly connected neighboring AS, so it won’t do much for influencing traffic beyond that. AS-Path prepending, however, has a global reach (although if you pre-pend with too long a path, you might get filtered). 2) MED is pretty far down on the BGP best path selection criteria, and BGP rarely gets to the point where MED would be a tie breaker.

For these reasons, everyone does AS-Path prepending for influencing inbound traffic flow.

4 Likes