5-7z When a BGP speaker sends a received route to one of its EBGP peer, it sets the NEXT_HOPattribute of the routing information to the address of its interface connecting to the EBGP peer.z When a BGP speaker sends a route received from one of its EBGP peer to one of its IBGPneighbor, it does not change the NEXT_HOP attribute of the routing information. But with loadbalancing enabled, the NEXT_HOP attribute is changed when the BGP route is sent to a IBGPneighbor.Figure 5-7 The NEXT_HOP attribute4) MED (MULTI_EXIT_DISC)The MED attribute is only valid between two neighboring ASs. The AS receiving this attribute will notadvertise this attribute to a third AS.The MED attribute is used to determine the optimal route for traffic flows to enter an AS. It acts the sameas the metrics used in IGP. For multiple routes a BGP router receives from different EBGP peers, if theyhave the same destination address but different next hops, the route with the smallest MED value ischosen as the optimal route provided other conditions are the same. As shown in Figure 5-8, Router Bis chose as the ingress for traffic from AS 10 to AS 20.Figure 5-8 MED attributeD=9.0.0.0NEXT_HOP=2.1.1.1MED=0D=9.0.0.0NEXT_HOP=3.1.1.1MED=100MED=0Router BRouter ARouter CRouter D2.1.1.13.1.1.1MED=100 AS 20AS 109.0.0.0EBGPEBGPIBGPIBGPIBGPNormally, BGP only compares the MED attribute values of the routes received from the same AS.