Thursday, July 15, 2010

BSCI - eBGP multi-hop behaviour

EBGP peers are generally connected via their physical addresses. This is because there wouldn't be any internal routing (eigrp, ospf etc) between the 2 AS's and so the router wouldn't know how to connect to a loopback address located in a different AS.

But what if for resilience purposes you want 2 eBGP peers to establish a neighbor state via their loopback addresses, or for that matter you want to peer with an eBGP that is more than one router away? eBGP peers are usually one hop away. The 'ebgp-multihop' command allows you to extend the number hops an eBGP packet can pass through before the TTL expires. The default TTL is 1 and 1 hop gets you to the physical interface on your eBGP peer, no further.

Take this 2 router example, connecting to loopback interfaces:
  AS100 - lo0 =10.1.1.1/32------(R1)>>>><<<<(R2)--------lo0 = 10.20.20.2/32 - AS200

The first step is to apply a static route on your routers so the router knows where to send traffic for the eBGP peer's loopback address.

R1(config)#ip route 10.20.20.2 255.255.255.255 int s0/0
!
R2(config)#ip route 10.1.1.1 255.255.255.255 int s0/0

Next, you go in to the BGP process and enter the your configuration for the eBGP peer:
R1(config)#router bgp 100
R1(config-router)#neighbor 10.20.20.2 remote-as 200
R1(config-router)#neighbor 10.20.20.2 update-source lo0
R1(config-router)#neighbor 10.20.20.2 ebgp-multihop 5
!
Do likewise on the remote peer:
R2(config)#router bgp 200
R2(config-router)#neighbor 10.1.1.1. remote-as 100
R2(config-router)#neighbor 10.1.1.1 update-source lo0
R2(config-router)#neighbor 10.1.1.1 ebgp-multihop 5
!

In this example you are increasing the TTL to 5 allowing the packet to traverse 5 hops before the packet is dropped. This will in turn allow you get to your peer's loopback address and establish a neighbor state.

For eBGP peers that are more than one router away you still need to apply the 'ebgp-multihop' command on the 2 peer routers but you also need to make sure you have routes for the loopback interfaces of the eBGP peers on the intermedaite routers, otherwise you will end up with a 'black hole' and packets being dropped as there is no vaild route to the peers.

No comments:

Post a Comment