279
default med
Use default med to specify a default MED value.
Use undo default med to restore the default.
Syntax
default med med-value
undo default med
Default
The default med-value is 0.
Views
BGP IPv4 unicast address family view, BGP-VPN IPv4 unicast address family view, BGP IPv6 unicast
address family view, BGP-VPN IPv6 unicast address family view
Predefined user roles
network-admin
Parameters
med-value: Specifies the default MED value in the range of 0 to 4294967295.
Usage guidelines
BGP selects a MED value in the following order:
1. MED set by the apply cost command.
2. MED set by the med keyword in the import-route command.
3. MED set by the default med command.
4. Original MED of a BGP route, or MED changed from the metric of a redistributed IGP route.
Examples
# In BGP IPv4 unicast address family view, configure the default MED as 25.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] address-family ipv4 unicast
[Sysname-bgp-ipv4] default med 25
# In BGP-VPN IPv6 unicast address family view, configure the default MED as 25.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] ip vpn-instance vpn1
[Sysname-bgp-vpn1] address-family ipv6 unicast
[Sysname-bgp-ipv6-vpn1] default med 25
Related commands
• apply cost
• import-route
• route-policy