what is the difference between local preference and med?
Unlike with the local preference and weight, where higher is more preferred, with the MULTI_EXIT_DISC, also known as “metric”, the lowest value is preferred. As an “optional non-transitive” attribute, the MED is only present if a router in the local AS or the neighboring AS sets it.