BGP Multi Exit Discriminator (MED) & Configuration
Multi Exit Discriminator (MED) also called metric. MED is optional and non transitive attribute, MED allows an autonomous system to tell a neighboring autonomous system the best way to forward packets into the first autonomous system. MED is used to advertise by one autonomous system into another, propagated inside the autonomous system, but not sent to any other autonomous systems. A smaller MED value means more preferred, by default 0 and range is 0 through 4,294,967,295. MED originally worked for a dual-homed design.
MED is used in the route selection process only if all the paths come the same Autonomous system. BGP use the bgp always-compare-med command to force the router to compare the MED even if the paths come from different autonomous systems. If you are enabling this option then enable it entire autonomous system otherwise loops can be occur.
Let see the configuration :
Topology:
Goal:https://www.internetworks.in/2018/12/bgp-multi-exit-discriminator-med.html
- configure the topology as per the diagram.
- configure iBGP and EBGP and advertise the interface as per the topology
- configure the autonomous system (65222) to exit via router 1 - router 4 (AS 65444).
- configure autonomous system 65111 return traffic from 65222 also should use the same path ( R2-R3-R4) as exit.
- use MED