Internet access is becoming more and more critical for handling everyday business. To ensure Internet redundancy and optimum performance, organizations may want to consider implementing BGP multihoming to different ISPs.
Configuring a redundant link to the Internet has given my company improved service and has reduced outages and related costs. This strategy also offers network administrators peace of mind as a bonus. Here is how to use Border Gateway Protocol (BGP) to produce similar results for your company.
With the proliferation of VPNs, e-commerce, and a multitude of other crucial Internet applications, access to the Internet has become mission critical for many organizations, and Internet connection redundancy is vital to ensuring the availability of these applications. Assisting in the justification for Internet connection redundancy is the decreasing cost of corporate Internet access.
BGP is one of the key tools for achieving Internet connection redundancy. When you connect your location to two different Internet service providers, it is called multihoming. When you multihome your network to two different ISPs, BGP runs on your Internet router(s) and provides redundancy and network optimization by selecting which ISP offers the best path to a resource.
If you are unfamiliar with BGP, I highly recommend the book Internet Routing Architectures by Sam Halabi, considered by most to be the bible of BGP.
How to make BGP work
BGP is a path-vector routing protocol. Just as Routing Information Protocol (RIP) selects the best route based on hop count, BGP selects the best path based on the shortest Autonomous System (AS) path. BGP routing domains are identified by an autonomous system number (ASN). ASNs are regulated by the same entity that regulates IP addresses, the
American Registry for Internet Numbers, better known as ARIN.
Once you understand the basics of BGP and its terminology, the configuration required to multihome your network to the Internet is fairly straightforward. Let’s assume that you already have your primary Internet connection up and running. The general steps for implementing BPG multihoming are:
If you lose the connection to one of your Internet service providers, BGP’s keep alive packets will time out, and that BGP neighbor (from that ISP) will become down. Those routes will be removed from the BGP table, and thus, from your router’s routing table. Then, with only one set of routes in your BGP table, that provider’s routes (the secondary/redundant provider) are marked as “best” and placed in your routing table.
Normally, there will be some paths from one provider that are shorter than the other ISP, and vice versa. So your traffic will be distributed to the provider with the best AS path for whatever networks are advertised. However, if you are sending more traffic to a certain network (through one provider) than your link to that provider can handle, the extra traffic will not be distributed onto your second link. Using BGP metrics, you can attempt to do different forms of load distribution, but there is no real form of BGP load balancing.
Configuring BGP in the Cisco IOS
Now, assuming that you already have one provider, you have your ASN, you know what your block of IP addresses are, and you either own them or have permission to advertise them, here is a configuration example, using the specific Cisco IOS commands.
Let’s say that you have the following interface configuration on your Cisco router. (For explanation, note the comments and descriptions after the “!” symbol.)
interface Loopback0
description Loopback Adapter Used as BGP Neighbor Interface
ip address X.X.X.254 255.255.255.0
!
interface FastEthernet0/0
description Backup ISP Connection
ip address Z.Z.Z.1 255.255.255.252
interface Serial1/0
description Primary ISP Connection
ip address Y.Y.Y.1 255.255.255.252
Your BGP configuration might look like this.
router bgp 99999 ! Your ASNumber
no synchronization
no auto-summary
bgp router-id X.X.X.254
network X.X.X.0 mask 255.255.255.0 ! This is your block of IP Addresses
that you are advertising to the World
neighbor 456.456.456.456 remote-as 77777 ! Primary ISP AS number
neighbor 456.456.456.456 description Primary ISP Connection
neighbor 456.456.456.456 ebgp-multihop 2
neighbor 456.456.456.456 update-source Loopback0
neighbor 789.789.789.789 remote-as 88888 ! Backup ISP AS Number
neighbor 789.789.789.789 description Backup ISP Connection
neighbor 789.789.789.789 ebgp-multihop 2
neighbor 789.789.789.789 update-source Loopback0
To make sure that your BGP process is communicating with the correct BGP neighbor, over its appropriate link, you will need a couple of static routes. These static routes tell your BGP process to communicate with each of your BGP neighbor routers over their respective links.
ip route 456.456.456.456 255.255.255.255 Serial1/0
ip route 789.789.789.789 255.255.255.255 FastEthernet0/0
For explanations of what each command does, refer to Cisco’s documentation on Configuring BGP and the command reference for BGP.
Using BGP: Words of caution
Before looking at a sample Cisco IOS configuration of BGP, let me say a few words of caution about using BGP:
BGP resources online
Since BGP is the routing protocol of the Internet, there are some great resources on the Internet, including the following: