272
peers. The AS_PATH attributes of these routes are 65006 65009, 65007 65009, and 65008 65009,
and the MED values of them are 2, 3, and 1. Because the third route's AS_PATH attribute contains AS
number 65008 that does not belong to the confederation, BGP does not compare it with other routes. As
a result, the first route becomes the optimal route.
Examples
# In BGP IPv4 unicast address family view, enable MED comparison for routes received from
confederation peers.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] address-family ipv4 unicast
[Sysname-bgp-ipv4] bestroute med-confederation
# In BGP-VPN IPv4 unicast address family view, enable MED comparison for routes received from
confederation peers.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] ip vpn-instance vpn1
[Sysname-bgp-vpn1] address-family ipv4 unicast
[Sysname-bgp-ipv4-vpn1] bestroute med-confederation
# In BGP IPv6 unicast address family view, enable MED comparison for routes received from
confederation peers.
<Sysname> system-view
[Sysname] bgp 100
[Sysname-bgp] address-family ipv6 unicast
[Sysname-bgp-ipv6] bestroute med-confederation
bgp
Use bgp to enable BGP and enter BGP view.
Use undo bgp to disable BGP.
Syntax
bgp as-number
undo bgp [ as-number ]
Default
BGP is not enabled.
Views
System view
Predefined user roles
network-admin
Parameters
as-number: Specifies a local AS by its number in the range of 1 to 4294967295.
Usage guidelines
A router can reside in only one AS, so the router can run only one BGP process.