190
Figure 78
MED attribute
In general, BGP compares MEDs of routes received from the same AS only.
NOTE:
The current implementation supports using the
compare-different-as-med
command to force BGP to
compare MED values of routes received from different ASs.
•
LOCAL_PREF
The LOCAL_PREF attribute is exchanged between IBGP peers only; therefore, it is not advertised to
any other AS. It indicates the priority of a BGP router.
LOCAL_PREF is used to determine the best route for traffic leaving the local AS. When a BGP router
obtains from several IBGP peers multiple routes to the same destination, but with different next
hops, it considers the route with the highest LOCAL_PREF value as the best route. As shown
, traffic from AS 20 to AS 10 travels through Router C that is selected according to
LOCAL_PREF.
Figure 79
LOCAL_PREF attribute
•
COMMUNITY
The COMMUNITY attribute is a group of specific data. A route can carry one or more
COMMUNITY attribute values (each of which is represented by a four-byte integer). The receiving
router processes the route (for example, determining whether to advertise the route and the scope
for advertising the route) based on the COMMUNITY attribute values. This simplifies routing policy
EBGP
Router B
Router A
Router C
Router D
D = 8.0.0.0
Next_hop = 3.1.1.1
Local_pref = 200
IBGP
IBGP
IBGP
EBGP
2.1.1.1
8.0.0.0
Local_pref = 100
Next_hop = 2.1.1.1
Local_pref = 100
Local_pref = 200
3.1.1.1
AS 20
AS 10