The bestroute med-confederation command configures BGP to compare the Multi_Exit Discriminator (MED) values of routes in a confederation when BGP selects the optimal route.
The undo bestroute med-confederation command restores the default settings.
By default, BGP compares the MED values of the routes that are from the same AS.
Usage Scenario
BGP AS_Path records the number of each AS from the local router to the destination according to a certain order. After the bestroute med-confederation command is configured, BGP compares MED values only when AS_Path does not contain the external AS (AS that is not in the confederation) number. Otherwise, BGP does not compare MED values.
For example, ASs 65000, 65001, 65002, and 65004 belong to the same confederation. The rules for selecting the optimal route from the four routes are as follows:
path1: AS_Path=65000 65004, med=2
path2: AS_Path=65001 65004, med=3
path3: AS_Path=65002 65004, med=4
path4: AS_Path=65003 1, med=1
After the bestroute med-confederation command is used, BGP selects path1. Although the MED value of path4 is smaller, the MED value cannot be compared. This is because AS_Path contains the external AS number.