bgp deterministic-med
Use this command to compare the Multi Exit Discriminator (MED) variable when choosing among routes advertised by different peers in the same autonomous system. MED is compared after BGP attributes weight, local preference, AS-path and origin have been compared and are equal.
For a correct comparison result, enable this command on all routers in a local AS. After enabling this command, all paths for the same prefix are grouped together and arranged according to their MED value. Based on this comparison, the best path is then chosen. This command compares MED variable when choosing routes advertised by different peers in the same AS, to compare MED, when choosing routes from neighbors in different ASs use the bgp always-compare-med command.
When the bgp deterministic-med command is enabled, routes from the same AS are grouped together, and the best routes of each group are compared. If the BGP table showed:
Route1: as-path 200, med 300, internal
Route2: as-path 400, med 200, internal
Route3: as-path 400, med 250, external
BGP would have a group of Route1 and a second group of Route2 and Route3 (the same ASs). The best of each group is compared. Route1 is the best of its group because it is the only route from AS 200. Route1 is compared to the Route2, the best of group AS 400 (the lower MED). Since the two routes are not from the same AS, the MED is not considered in the comparison. The external BGP route is preferred over the internal BGP route, making Route3 the best route; the preferred route would be different if always-compare-med command is enabled (See always-compare-med command).
Use the no parameter with this command to disallow this setting.
Command Syntax
bgp deterministic-med
no bgp deterministic-med
Parameters
None
Default
By default, bgp deterministic med is disabled
Command Mode
Router mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
#configure terminal
(config)#router bgp 100
(config-router)#bgp deterministic-med
(config)#router bgp 100
(config-router)#no bgp deterministic-med
Last modified date: 08/28/2023