The bestroute med-confederation command enables 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 only.
BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-IPv6 unicast address family view
Usage Scenario
By default, BGP compares only MED values of routes from the same AS, not including sub-ASs in a confederation. To enable BGP to compare MED values of routes in a confederation when selecting the optimal route, run the bestroute med-confederation command.
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 the same confederation. Routes to the same destination are listed 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 65004, med=1
After the bestroute med-confederation command is run, the AS_Path attributes of paths 1, 2, and 3 does not contain the numbers of ASs that belong to other confederations. Therefore, when selecting routes based on MED values, BGP compares the MED values of paths 1, 2, and 3 only. This is because the AS_Path attribute of path 4 contains the number of an AS that does not belong to this confederation.