PT. Hawk Teknologi Solusi

Silahkan Cari Disini

Selasa, 15 April 2008

BGP quick tips

There are three most important keywords which we should have in mind while setting up BGP neighbor relationship. Even sometimes when we have successful BGP relationship, we are not able to see routes in the routing table. Following are the three important keywords.

1)ebgp-multihop :- In EBGP, neighbor relationships are only formed if we have directly connected networks. We would require to use ebgp-multihop keyword with neighbor statement so that neighbors which are not directly connected can form relationship with each other. We need to specify a number with ebgp-multihop keyword, number can be between 1-255. This number represents how many hop counts is the router away.

2)update-source. We need to specify the interface which will be used to update neighbor table incase routers are not directly connected. Without update-source we will not be able to form BGP neighbor relationships. update-source keyword will update the interface which will be used to form neighbor relationship. see configuration example below for better understanding.

3) next-hop-self:- When ebgp relation replicates , next hop always changes.IBGP routers only connected with other ibgp routers in same AS will not be able to talk with routers outside the AS, if they are not directly connected with each other. We would require a next-hop-self keyword in the ibgp router which is directly connected with ebgp neighbor so that other router in same AS (IBGP) can talk with ebgp routers. Refer to configuration examples below:-

Lets assume that we have three routers and we have to setup a ebgp relationship in between them. Router A ( AS :- 34 Serial0 , loopback0 , RouterB ( AS 34, loopback0 , Serial0 , Serial1, RouterC ( AS 400 , loopback0, Serial0

Lets start configuring Router A

router BGP 34 –> As soon as we type 34 BGP process will start in the background
neighbor remote-as 34 –> Bgp will know that this is IBGP looking at AS

Router B

router BGP 34
neighbor remote-as 34
neighbor remote-as 400 –> neighbor relationship with ebgp peer.
neighbor remote-as 400
neighbor ebgp-multihop 255 –> 255 is number of hops that neighbor is away. we can use any number from 1-255, it can be more specific by using 1 or 2 but my personal fav is 255 as it avoids confusion.
neighbor update-source loopback 0 –> Here is the idea, when its sourcing the packets its sourcing it from serial interface, we need to inform the otherside that source interface is not serial interface, it is looback interface so that it cann match ip ip’s with the right interface and form neighbor relationship.

we would require to do similar configuration on router c

router bgp 400
neighbor remote-as 34
neighbor remote-as 34
neighbor ebgp-multihop 255
neighbor update-source loopback 0

Now after forming the neighbro relationships we’ll use network commands to add neighbors in routing table. Network command in BGP is bit different then Network command in other routing protocols. we ‘ll need to define mask keywork with network command in order to advertise clasless network where as if it is using a default mask we can ignore the same.


Router C

router bgp 400
neighbor mask
note:- i cannot use network command without mask keyword as it will treat this as class B network. For any customised subnetting scheme we ‘ll need to specify subnet mask with mask keyword in network command.

Even after configuring above, Router A will not be able to talk with Router C. If we will use show ip bgp command on Router A. we’ll see that it has a valid route for Router C but it will not be able to ping router c. This is because next hop will be which is not directly connected with Router A. . First thing which will come in our mind is that rule of synchronisation has taken in to effect but even after disabling synchronisation between router a and router B, Router C will not be reachable. we would need a special command on Router B so that all IBGP peers of AS 34 can talk with AS 400

To troubleshoot this we can use “debug ip bgp updates” but before using this debug we should use ” clear ip bgp *” command. We’ll see that it will show us that there is no valid path for networks in Router C. Next hop should be Router B but in the updates it will show next hp as router c. to avoid the we will use next-hop self keyword in Router B.

Router B

router bgp 34

neighbor next-hop-self

When Router B is sending an update to Router A it is sending the update without changging its next hop so router A will receive next hop as Router C which is not directly connected. To avoid this we will use next-hop-self command in Router B so that router A should receve valid route.

bgp case study:

Tidak ada komentar: