The deterministic-med command enables the BGP deterministic-med function so that the sequence in which routes are received is irrelevant to the result of route selection.
The undo deterministic-med command restores the default configuration.
By default, the BGP deterministic-med function is disabled.
BGP view, BGP-IPv4 unicast address family view, BGP-VPN instance IPv4 address family view, BGP-IPv6 unicast address family view
Usage Scenario
After the BGP deterministic-med function is enabled, when an optimal route is to be selected from among routes which are received from different Autonomous Systems (ASs) and which carry the same prefix, routes are first grouped according to the leftmost AS in the AS_Path. After comparison in the group, an optimal route is selected. The group optimal route is then compared with optimal routes from other groups to determine the final optimal route. This mode of route selection ensures that the sequence in which routes are received is irrelevant to the result of route selection.
If the BGP deterministic-med function is disabled, routes are compared against each other according to the sequence in which they are received. In this way, the sequence in which routes are received is relevant to the result of route selection.
Route A1: AS(PATH) 12, med 100, igp metric 13, internal, rid 4.4.4.4
Route A2: AS(PATH) 12, med 150, igp metric 11, internal, rid 5.5.5.5
Route B: AS(PATH) 3, med 0, igp metric 12, internal, rid 6.6.6.6
If Route A1, Route A2, and Route B are received in turn, Route A1 and Route A2 are first compared. The leftmost AS of Route A1 is the same as the leftmost AS of Route A2, and therefore Route A1 is selected because its Multi_Exit Discriminator (MED) value is smaller. Then, Route A1 and Route B are compared. Because the leftmost ASs of the two routes are different, the optimal route cannot be selected by comparing the MED values of the two routes unless the compare-different-as-med (BGP) command is configured. As a result, Route B is selected because its IGP Metric is smaller.
If Route A2, Route B, and Route A1 are received in turn, Route A2 and Route B are first compared. Because leftmost AS of Route A2 is different from the leftmost AS of Route B, the optimal route cannot be selected by comparing the MED values of the two routes unless the compare-different-as-med (BGP) command is configured. As a result, Route A2 is selected because its IGP Metric is smaller. Then, Route A2 and Route A1 are compared. The leftmost AS of Route A1 is the same as the leftmost AS of Route A2, and therefore Route A1 is selected because its MED value is smaller.
Judging from the preceding route selection procedure, when the BGP deterministic-med function is disabled, the sequence in which routes are received is relevant to the result of route selection. Whereas after the BGP deterministic-med function is enabled, the sequence in which routes are received is no longer relevant to the result of route selection.