8.8 Issue with Using Private AS  Numbers
8.8.8 Configuration example: MED
Lab Activity
  In this lab, you will learn how to configure the MED attribute to influence routing decisions in another AS.

In the example, AS 100 receives updates regarding network 180.10.0.0 from routers B, C, and D. Routers C and D are in AS 300, and router B is in AS 400.

Since, by default, BGP only compares the MED attributes of routes coming from neighbors in the same external AS (such as AS 300 in the example), Router A can only compare the MED attribute coming from router C (120) to the MED attribute coming from router D (200) Even though the update coming from router B has the lowest MED value, Router A will choose router C as the best path for reaching network 180.10.0.0. To force router A to include updates for network 180.10.0.0 from router B in the comparison, use the bgp always-compare-med router configuration command.

Router A will choose router B as the best next hop for reaching network 180.10.0.0 (assuming that all other attributes are the same). You can also set the MED attribute when you configure the redistribution of routes into BGP. For example, on router B you can inject the static route into BGP with a MED of 50. The preceding configuration causes router B to send out updates for 180.10.0.0 with a MED attribute of 50.