cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
824
Views
0
Helpful
2
Replies

BGP Loadbalancing and traffic shaping.

rodney.chatman
Beginner
Beginner

I have two ISP connections that I'd like to configure failover and loadbalancing between.  Here is what I'm hoping to accomplish:

Example:

I have six IP address blocks.

1.1.1.1/24

2.2.2.2/24

3.3.3.3/24

4.4.4.4/24

5.5.5.5/24

6.6.6.6/24

I would like all 6 blocks to be advertised via both ISP's for failover purposes.  I would like for the first 3 /24 blocks to ingress via ISP A and the last 3 /24 blocks to ingress via ISP B.  Should either ISP A fail, however the first 3 /24 blocks will failover and ingress via ISP A.

AS Prepending would be my prefered method.  For my advertisements to ISP A prepend 3 AS paths to the last 3 /24 blocks and for my advertisements to ISP B prepend 3 AS paths to the first 3 /24 blocks.  Unless of course there is a better best practice to accomplish this.

2 Replies 2

daniel.dib
Rising star
Rising star

Look into if your ISP supports communities. By adding communities you can tell the ISP to prepend for you and to do certain traffic engineering like to set a lower local preference within the ISP network.

The second best method would be to use MED or prepending.

Note that you can never force someone to select a certain path in BGP unless you don't advertise the secondary path until the primary goes down.

Do you need to have symmetrical paths? That could be a concern for your setup. Look into conditional BGP as well.

Daniel Dib
CCIE #37149

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

The paths will be symmetrical as we'll be using route-maps to to set next-hop based on source IP address.  What I'd really like to know is if it's possible to advertise all 6 IP blocks but half with as-prepetion and half without to each ISP?

Would the following configuration accomplish this task:

#########

# ISP A #

#########

!

ip access-list extended bgp

permit ip any any

!        

ip prefix-list prepend seq 1 permit 4.4.4.0/24

ip prefix-list prepend seq 2 permit 5.5.5.0/24

ip prefix-list prepend seq 3 permit 6.6.6.0/24

ip prefix-list prepend seq 100 deny 0.0.0.0/0

!

route-map bgp_out permit 10

match ip address bgp

route-map bgp_out permit 20

match ip address prefix-list prepend

set community 4522:4403

!

router bgp 12345

network 1.1.1.0 mask 255.255.255.0

network 2.2.2.0 mask 255.255.255.0

network 3.3.3.0 mask 255.255.255.0

network 4.4.4.0 mask 255.255.255.0

network 5.5.5.0 mast 255.255.255.0

network 6.6.6.0 mask 255.255.255.0

neighbor 8.8.8.8 remote-as 4522

neighbor 8.8.8.8 send-community

neighbor 8.8.8.8 route-map bgp_out out

!

#########

# ISP B #

#########

!

ip access-list extended bgp

permit ip any any

!        

ip prefix-list prepend seq 1 permit 1.1.1.0/24

ip prefix-list prepend seq 2 permit 2.2.2.0/24

ip prefix-list prepend seq 3 permit 3.3.3.0/24

ip prefix-list prepend seq 100 deny 0.0.0.0/0

!

route-map bgp_out permit 10

match ip address bgp

route-map bgp_out permit 20

match ip address prefix-list prepend

set community 2245:4403

!

router bgp 12345

network 1.1.1.0 mask 255.255.255.0

network 2.2.2.0 mask 255.255.255.0

network 3.3.3.0 mask 255.255.255.0

network 4.4.4.0 mask 255.255.255.0

network 5.5.5.0 mast 255.255.255.0

network 6.6.6.0 mask 255.255.255.0

neighbor 9.9.9.9 remote-as 2245

neighbor 9.9.9.9 send-community

neighbor 9.9.9.9 route-map bgp_out out

!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: