dslreports logo

Suggested prerequisite reading
»Cisco Forum FAQ »Redundant Link Graceful Internet Load Balance/Failover

Prepending Your AS to setup automatic BGP failover mechanism on remote router via iBGP

One of the BGP feature is AS prepending, done by utilizing the BGP AS_PATH attribute. Let's say your organization edge routers are running BGP with your ISP. There are multiple links connecting your edge routers to ISP routers. One link has larger bandwidth than another.

You would then prefer that incoming traffic from your ISP to your organization via your edge routers would consider link with larger bandwidth as primary path over another link. In other words, other link would be the secondary or backup link in case the primary link goes down.

By prepending your AS on the edge routers' secondary link and no AS prepend on the primary link, your ISP would see that it takes longer path to reach your organization via the secondary link over the primary link. Therefore your ISP would prefer to use the primary link for incoming traffic from the Internet to your organization.

Following is a sample configuration



Assumption

* Your Public AS number is 100
* You have two Internet edge routers, R1 and R2
* R1 is BGP peering with ISP A, and R2 is BGP peering with ISP B
* ISP A Public AS number is 300 and ISP B Public AS number is 400
* Hosts, R1 Ethernet, and R2 Ethernet interfaces are within 192.168.21.0/24 subnet
* R1 and ISP-A Serial interfaces are within 192.168.31.0/30
* R2 and ISP-B Serial interfaces are within 192.168.42.0/30
* You prefer to have inbound traffic over ISP A instead of ISP B
* You also prefer to have outbound traffic over ISP A instead of ISP B
* To have such inbound traffic condition, you prepend your AS number once on R2
* To have such outbound traffic condition, you set R1 local preference higher than the R2 default local preference (which is 100)

R1



R2



In a real network, prepending your AS number on R2 more than once might be required to achieve the desired result. In addition, R1 and R2 might be running HSRP or similar redundancy technique. Check out the following link of HSRP-BGP Combination sample configuration.

How to Use HSRP to Provide Redundancy in a Multihomed BGP Network

Reality Insight

In BGP theory, there are several options to setup automatic failover mechanism. Some of them are AS prepending, MED, and BGP Community utilization.

When you manage the entire BGP network (that have multiple AS numbers within a single network administration), you can use any techniques to control the failover mechanism. This applies usually when you run internal BGP network within your organization.

Managing external BGP network with multiple providers (ISP) would be different story. Not all ISP honor MED. AS prepend on your own AS number (or the ISP AS number) may not affect the inbound traffic from the Internet where transit provider still see particular ISP as the most actractive connection.

Discussion

»[Info] Asymmetric BGP/WAN Routing Implications and Traffic Engineering
»[OT] BGP Ooopsies This Weekend
»Looking Glass question...
»[Info] iBGP Physical Redundancy
»[CCNA] Redistribution: OSPF into BPG
»Connecting Edge networks?
»[HELP] Multi homed with one BGP and one non BGP link
»BGP Help
»[HELP] BGP with same ASN from two different locations
»BGP Multihoming default-originate only setup
»BGP Question
»BGP
»[HELP] BGP at 2 location
»[HELP] BGP over MPLS
»[Config] Redistributing EIGRP into BGP - best path
»EIGRP question
»Routing - is there something blocking this?
»Route distribution for dual WAN
»[Info] ISP BGP Peering
»BGP and advertising routes

BGP Community utilization should be the best approach to control inbound and outbound traffic over multiple AS (including over multiple providers in external BGP network). When your ISPs provide decent BGP Community string, you will have a good automatic failover mechanism.

In addition, Cisco provide BGP Conditional Subnet Advertisement feature that might be useful as workaround when MED, AS prepend, and BGP Community do not fulfill your expectation. However this feature looks like still in a stage phase since there is still unresolved Cisco Bug ID relating to "uncooperative" subnet advertisement problem.

Additional Sample Configuration

»Cisco Forum FAQ »Various Network Design using Routers, Layer-3 Switches, and more

BGP Security

»[OT] ARTEMIS bgp hijack detection

Discussions

»[Config] Unable to ping through OSPF neighbor router


Feedback received on this FAQ entry:
  • googd explanation

    2009-11-13 02:12:31



Expand got feedback?

by aryoba See Profile
last modified: 2018-01-16 10:56:52