Peer Type
When IBGP routes (routes learned from IBGP peers) and EBGP routes (routes learned from EBGP peers) are available, BGP preferentially selects EBGP routes.
When one EBGP route and multiple IBGP routes are available, BGP selects the optimal route based on the peer type. If no EBGP route is available or multiple EBGP routes are available, BGP is unable to select the optimal route based on the peer type.
When multiple egress devices reside on a carrier network and receive routes from the Internet, the egress devices select the optimal route based on the peer type in most cases. In
Figure 1, all devices reside in the same AS, Device A and Device B function as egress devices and are IBGP peers of all devices in the AS. In addition,
Device A and
Device B receive routes from the Internet and advertise EBGP routes to all their IBGP peers. Therefore,
Device A and
Device B have an IBGP route and an EBGP route, and the two routes have the same AS_Path. In this situation,
Device A and
Device B select the EBGP route as the optimal route.
Figure 1 Peer type application networking
The EBGP route is selected as the optimal route, which prevents the traffic that leaves Device A or Device B for the Internet from being forwarded to the other egress device.
For more peer type-based route selection examples, see Local_Pref.