Showing posts with label BGP. Show all posts
Showing posts with label BGP. Show all posts

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

Monday, 22 February 2010

BGP Route Redistribution

Hello again :)

This post was due to be later down the BGP chain, but it has been requested so I'll do it now for those who don't need the real basics and add the tag so those looking out of sequence at a particular subject matter can read it in sequence.


So- You have a basic BGP network configured, say you have 3 or 4 remote nodes/networks hanging off some routers you administer and you wish to use BGP to ensure all those networks can all see each other.

In many respects, re-distribution is not recommended as BGP historically has been a wholly public facing system and most internal routing processes will use private addressing, but lets say for this instance you're either fully public or on an MPLS network or similar.


(picture to follow)

In those instances, rather than manually add each network via Network statements and updating each of those any time a route or network changes you can redistribute the internal process you are running (the igp).

Once the process has been redistributed it becomes a BGP route in its own right so you could in theory redistribute different Igp's over from different sites. (ie EIGRP on one, OSPF on the other).

We'll assume at this point then that you've read the other parts of the BGP series and know how to setup neighbor relationships and have your external AS up and running to all the nodes on the network.

In order to redistribute the internal routing, login to the AS using the normal router bgp [as number] command then add :


redistribute protocol [process-id] {level-1 | level-1-2 | level-2} [as-number] [metric {metric-value | transparent}] [metric-type type-value] [match {internal | external 1 | external 2}]
[tag tag-value] [route-map map-tag] [subnets]


Let me break that down a little.

redistribute - speaks for itself.
Protocol - Choose from connected, bgp, eigrp, ospf, rip, mobile, isis or static
Process ID - this is the AS number/process ID etc for the IGP
Level (x) - Relates to ISIS redistribution, uncommon so we'll cover later.
AS-Number - the AS number for the redistributed routes (in the case of multi=as environment)
route-map - This will apply the listed route-map to the redistribution process if you want to restrict what networks are advertised.

the rest of the flags are specific for the IGPs with many of them applying to the OSPF protocol (like Match for which set of routes you wish to re-advertise).

For the most part, you will end up doing either a basic redistribute command and then applying some sort of filter via route-map.


I'll follow up with some examples shortly, I'm currently working on uploading some config videos to youtube or similar and embedding them to the blog.

Monday, 15 February 2010

An introduction to BGP.

In this update I want to start one of the protocol/technology tracks that I will continue over time, hopefully building into a library of topics on what is really quite a big subject.

I've started with BGP rather than some of the simpler or more familiar protocols because to me, its a crucial protocol to learn.

BGP is effectively what ties the Internet together and what stops it being a loose association of networks and (combined with things like the DNS process) allows traffic to get from your machine to wherever it needs to go.

It allows service providers to not only run their network but also to allow you tell the world where your address space is and how to find theirs.

The other reason I've decided to start with this is that it is a fundamental importance in MPLS VPNs via VPNV4 address schemes. (it is worth noting at this point that all my documents are in the IPV4 world and IPV6 versions will come in due course). Label switching itself is an independent process but in order to get true MPLS VPN's to work, you need to overcome a few functions with BGP allows (this will be covered cross topics on this and the MPLS sections).

BGP is very similar to some of the more basic LAN routing protocols but comes from a LAN heritage (the IGP function) and is the effective merger of IGP and EGP.

Whilst many service providers over the years used IS-IS to cover their domain in some cases or OSPF in others, BGP has become the front runner for more than just the network edge. It is also possible to use BGP to merge different networks together which use alternative routing protocols.

The plan is to break down BGP into a number of smaller bits, Once this loose introduction is complete we'll start with BGP101: The basics. In that segment i'll cover the basic formation of BGP and how it sets up its relationships with other devices, how it holds its information.

Next I'll cover BGP Neighbor relationships, in which we'll look at what to do once a basic relationship is setup, how to do so, how to leverage information from it etc.

I also want to cover modules on BGP Route tables, BGP traffic shaping, VPNV4 addressing for BGP, BGP troubleshooting and general BGP CLI corner.

As ever if you have any questions, either add them in the comments or email me.