The Border Gateway Protocol (BGP) is the routing protocol of the Internet. However, routers usually only use BGP when there are multiple connections to the Internet.
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
neighbor 18.104.22.168 remote-as 1234
neighbor 22.214.171.124 description Provider1
neighbor 126.96.36.199 password 7 09823490822093482F
neighbor 188.8.131.52 update-source Loopback1
neighbor 184.108.40.206 version 4
neighbor 220.127.116.11 route-map Provider1 out
neighbor 18.104.22.168 remote-as 5678
neighbor 22.214.171.124 description Provider2
neighbor 126.96.36.199 password 7 09823490822093482F
neighbor 188.8.131.52 update-source Loopback2
neighbor 184.108.40.206 version 4
neighbor 220.127.116.11 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 18.104.22.168 remote-as 1234
However, more realistically, you're also advertising a network. For example:
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.
You'll use these commands over and over again when using BGP. In fact, I've used them so much that I created command shortcuts. Here's an example:
alias exec sib show ip bgp
alias exec sibs show ip bgp summaryNow, 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
Get more resources
- "How to use IP and BGP to troubleshoot Internet connectivity"
- "Build effective BGP policies with Cisco IOS"
- Cisco IOS BGP Configuration Guide
David Davis has worked in the IT industry for 12 years and holds several certifications, including CCIE, MCSE+I, CISSP, CCNA, CCDA, and CCNP. He currently manages a group of systems/network administrators for a privately owned retail company and performs networking/systems consulting on a part-time basis.
Want to learn more about router and switch management? Automatically sign up for our free Cisco Routers and Switches newsletter, delivered each Friday!