Using eBGP Multihop

Problem

You want to use BGP to exchange routes with an external peer router that is more than one hop away because the router at the edge of the network doesn’t support BGP.

Solution

Cisco provides a useful option called eBGP Multihop, which allows you to establish eBGP peer relationships between routers that aren’t directly connected to one another:

Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#ip route 172.20.1.2 255.255.255.255 192.168.1.5 2
Router1(config)#router bgp 65500
Router1(config-router)#neighbor 172.20.1.2 remote-as 65530
Router1(config-router)#neighbor 172.20.1.2 update-source Loopback0
Router1(config-router)#neighbor 172.20.1.2 ebgp-multihop 3
Router1(config-router)#exit
Router1(config)#end 
Router1#

Discussion

In this example, we have shown the configuration for only one of the routers, although you will need to configure the ebgp-multihop keyword for the corresponding peer device as well.

This feature isn’t a standard part of the BGP protocol, but several router vendors implement it. The standard behavior requires eBGP routers to be adjacent to one another.

You might want to use this feature, for example, if the router at the edge of either your AS or the AS you are connecting to doesn’t support BGP. The router will also need to have a route to the destination device because it is not directly connected. We have included a static route for this purpose.

The ebgp-multihop keyword takes an optional ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.