July 12, 2007, 1:18 PM PDT
But if you did have a BGP router configuration, would you know what to look for? Let’s look at a sample configuration and discuss what you need to know.
If you used the show running-configuration command or the show runn|beg bgp command, would you know what you were looking at in the output? Below is an example of a BGP router configuration from an actual working router. (I’ve changed the passwords, IP addresses, and AS numbers for security purposes.)
TechRepublic-Router# show running-configuration | beg bgp
router bgp 55555
no synchronization
bgp log-neighbor-changes
bgp dampening
network 3.3.3.0
neighbor 1.1.1.1 remote-as 1234
neighbor 1.1.1.1 description Provider1
neighbor 1.1.1.1 password 7 09823490822093482F
neighbor 1.1.1.1 update-source Loopback1
neighbor 1.1.1.1 version 4
neighbor 1.1.1.1 route-map Provider1 out
neighbor 2.2.2.2 remote-as 5678
neighbor 2.2.2.2 description Provider2
neighbor 2.2.2.2 password 7 09823490822093482F
neighbor 2.2.2.2 update-source Loopback2
neighbor 2.2.2.2 version 4
neighbor 2.2.2.2 weight 50
What can we tell from this output? We can tell that this router connects to two ISPs, and it’s probably performing dynamic, shortest AS path routing between the two. In addition, we can tell that passwords exist on each connection, and there are descriptions to help identify each connection.
Now that you have an idea what we’re working with, here are the five most important things you need to know about BGP configuration.
1. What is the AS number?
A very important number in this configuration is the autonomous system (AS) number. In this example, it’s 55555, in the line route bgp 55555.This number uniquely identifies the routing domain under your control that connects to the Internet. BGP is a “path vector” routing protocol. In its most basic sense, BGP’s job is to choose the shortest path through the Internet cloud of autonomous systems.
You can obtain the BGP AS number from the American Registry for Internet Numbers (ARIN). The AS number uniquely identifies you in the BGP cloud of the Internet.
2. What is the minimum needed to configure a BGP neighbor?
The minimum BGP configuration that a router needs to communicate with a BGP peer (i.e., a neighbor) is a neighbor statement and a route to that neighbor. The configuration could be as small as this:router bgp 55555
neighbor 1.1.1.1 remote-as 1234
However, more realistically, you’re also advertising a network. For example:
network 3.3.3.0
With this command, you’re telling BGP neighbors which IP network you’re advertising to them. That way, when you send traffic out, they know how to get the response back to you. In addition, you should configure a password to perform secure MD5 encryption on BGP transactions.
3. Which BGP show commands should I use?
Here are the two most important BGP show commands:- Show ip bgp summary: This command displays the status of your BGP peering relationships.
- Show ip bgp: This command displays all routes received from your BGP peers.
alias exec sib show ip bgp
alias exec sibs show ip bgp summary
Now, I can just type sib or sibs to get this important BGP command output.
4. Which metrics does BGP use?
When using BGP, you need to know how BGP makes its decisions. I mentioned that BGP chooses the shortest AS path through the Internet. While this is true, it also uses a number of other important metrics to make decisions.To find out, read Cisco’s BGP Best Path Selection Algorithm documentation. For example, the metric of “shortest AS path” is actually fourth in the list of metrics used. BGP only uses it if there’s a “tie” when comparing the weight, local preference, and locally originated vs. aggregate addresses.
5. What’s with the no synchronization command?
One of the more confusing BGP commands is the no synchronization command. By default, BGP only advertises routes (i.e., networks) to neighbors if it already has an internal route with that route in the routing table. Many times, this is one of the first things that admins do when configuring BGP — simply because they don’t have a dynamic internal routing protocol running on their Internet router.But there’s a purpose for this command — to only advertise networks that the router can communicate with. However, you can still disable it. Here’s an example:
Router bgp 55555
no synchronization