8.3 Configuring BGP 
8.3.4 EBGP multihop
These example configurations have shown how to configure EBGP and IBGP. However, what's the difference between the configuration types? The figure presents some of the important characteristics between these BGP session types.

RTZ and RTY have established an EBGP session. EBGP peers are normally directly connected, but there are certain exceptions to this requirement. In contrast, IBGP peers merely require TCP/IP connectivity within the same AS. As long as RTY can communicate with RTW using TCP, both routers can establish an IBGP session. If needed, an IGP such as OSPF can provide IBGP peers with routes to each other.

In a typical configuration, an IBGP router maintains IBGP sessions with all other IBGP routers in the AS, forming a logical full mesh. This is necessary because IBGP routers do not advertise routes learned via IBGP to other IBGP peers (to prevent routing loops). In other words, if you want your IBGP routers to exchange BGP routes with each other, you should configure a full mesh. An alternative to this approach is configuring a route reflector, which is discussed in Chapter 9, Scaling BGP.

As noted, EBGP neighbors must be directly connected to establish an EBGP session. However, look again at RTW and RTU in the figure. These routers can maintain an EBGP session even though a non-BGP box, RTV, separates them. In this situation, EBGP is running across a non-BGP router using a configurable option called EBGP multihop. EBGP multihop is a Cisco IOS option that allows RTW and RTU to be logically connected in an EBGP session, despite the fact that RTV does not support BGP. The EBGP multihop option is configured on each peer with the following command:

Router(config-router)#neighbor ip-address ebgp-multihop [hops]

This command enables you to specify how many hops (up to 255) separate the EBGP peers. The following commands could be applied to the routers in the example:

RTW(config)#router bgp 200
RTW(config-router)#neighbor 1.1.1.2 remote-as 300
RTW(config-router)#neighbor 1.1.1.2 ebgp-multihop 2
RTU(config)#router bgp 300
RTU(config-router)#neighbor 2.2.2.1 remote-as 200
RTU(config-router)#neighbor 2.2.2.1 ebgp-multihop 2