Thursday 4 March 2010

Setting up basic BGP relationships

BGP is an interesting protocol. The basic setup is quite straight forward and very similar to a number of other protocols but it has more tuning options than any protocol I've ever dealt with (even IS-IS).

The key difference at first glance compared to most other protocols is rather than setting up the process and having it go out and seek other adjacencies, you have to tell BGP who to go and talk to.

Label Switching, EIGRP, OSPF (et al) will all use set criteria to speak out of all interfaces to find other routers using the correct credentials.

BGP uses fixed unicast neighbor relationships, defined by the user on the router.



To setup the BGP process and enter the sub configuration menu use :

router bgp (AS number)

The AS number is the identity for the routes being advertised but unlike other protocols, the AS numbers don't need to match between routers to build tables (as long as the neighbours are properly configured).

If they are external internet facing devices, you will need to be formally allocated an AS by IANA/RIPE/etc

If you are using BGP internally, there are some AS's reserved for internal use , see http://www.iana.org/assignments/as-numbers/as-numbers.xml

Setting up the basic neighbor relationship in the BGP sub menu use :

neighbor (ip address) remote-as (remote devices AS number)



At this point I must mention that if the AS number listed, doesn't match the AS number of the device you are setting up the relationship with, that Neighbor relationship will not come up.

Assuming both parties have the correct information the BGP relationship will come "up" and the routers will start sharing routing information.

Depending on how the BGP is configured will depend how routes are exchanged, how often, how many, metrics , etc.

The most basic way of advertising routes is by entering "network" statements in the BGP.

In order for the route to be physically advertised by the BGP that network MUST exist in the routers FIB.

An example config therefore would be :

router bgp 64512
neighbor 192.168.1.1 remote-as 64513
network 10.0.0.0 mask 255.255.255.0

interface fa0/0
ip address 10.0.0.1 255.255.255.0



To validate the BGP use :

show ip bgp summary - to see the various neighbors and their status
show ip bgp - show the full BGP route table
show ip bgp neighbor (neighbour IP) - show information about that neighbor

1 comment:

  1. Just to clarify, AS's for internal use are 64512-65534.

    Nice article, thank you :)

    ReplyDelete