The compare-different-as-med command enables BGP to compare the MEDs in the routes learned from peers in different ASs.
The undo compare-different-as-med command restores the default configuration.
By default, BGP does not compare the MEDs in the routes learned from peers in different ASs.
Usage Scenario
The command is used to change BGP route selection rules. If the compare-different-as-med command is run, BGP will compare the MEDs of the routes learned from peers in different ASs. If there are multiple reachable routes to the same destination, BGP prefers the route with the smallest MED.
Configuration Impact
After the compare-different-as-med command is run, the system compares the MEDs in the routes learned from peers in different ASs.
Precautions
Do not run the compare-different-as-med command unless different ASs use the same IGP and route selection mode.
<HUAWEI> system-view [~HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv4-family [*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpna-af-ipv4] quit [*HUAWEI-vpn-instance-vpna] quit [*HUAWEI] bgp 100 [*HUAWEI-bgp] ipv4-family vpn-instance vpna [*HUAWEI-bgp-vpna] compare-different-as-med <HUAWEI> system-view [~HUAWEI] ip vpn-instance vpna [*HUAWEI-vpn-instance-vpna] ipv4-family [*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1 [*HUAWEI-vpn-instance-vpna-af-ipv4] quit [*HUAWEI-vpn-instance-vpna] quit [*HUAWEI] bgp 100 [*HUAWEI-bgp] vpn-instance vpna [*HUAWEI-bgp-instance-vpna] quit [*HUAWEI-bgp] ipv4-labeled-unicast vpn-instance vpna [*HUAWEI-bgp-labeled-vpna] compare-different-as-med