The peer transit-med-to-ebgp command enables a device to transmit MED attributes to an EBGP peer group.
The undo peer transit-med-to-ebgp command disables a device from transmitting MED attributes to an EBGP peer group.
By default, a device does not forcibly transmit MED attributes to an EBGP peer group.
Usage Scenario
The MED attribute is optional non-transitive. When an EBGP EVPN peer relationship is established between devices in two data centers in different BGP ASs, the devices do not transmit the MED attributes of EVPN routes to each other by default. The MED attribute needs to be transmitted to an EBGP EVPN peer in a scenario, for example, after you change a cost value to switch service flows between the active and standby gateways within a data center. You can run the peer transit-med-to-ebgp command to configure the local gateway to transmit the MED attributes of the received EVPN routes to the peer EBGP EVPN peer.
Precautions
MED attributes can be transmitted within an AS by default. Therefore, if you set an intra-AS peer address in this command, this command does not make sense.
[*HUAWEI] bgp 100 [*HUAWEI-bgp] group gp1 [*HUAWEI-bgp] peer 10.1.1.2 as-number 200 [*HUAWEI-bgp] l2vpn-family evpn [*HUAWEI-bgp-af-evpn] peer 10.1.1.2 enable [*HUAWEI-bgp-af-evpn] peer gp1 enable [*HUAWEI-bgp-af-evpn] peer 10.1.1.2 group gp1 [*HUAWEI-bgp-af-evpn] peer gp1 transit-med-to-ebgp