cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1030
Views
5
Helpful
9
Replies

BGP multi homing loadbalancing

mhrznamn
Level 1
Level 1

We have BGP peering with two ISP's  (ISP A and ISP B). Both the ISP's are connected on a same border Router on different interface. 

We are receiving  default-routes from both the ISP's. We have advertised our IP prefix to both the ISP's (103.XX.XX.XX/24) . We have configured route-map and called in  bgp neighbor to make ISPA as primary.

 

interface gig 0/0/0

des. ISP A

ip address xxx.xxx.xxx

 

interface gig 0/0/1

des. ISP B

ip address xxx.xxx.xxx

 

router bgp 1xxxx
bgp log-neighbor-changes
network 103.xxx.xxx.0 mask 255.255.255.0

neighbor 110.xxx.xxx description "BGP with ISPB"
neighbor 110.xxx.xxx remote-as 4xxx
neighbor 110.xxx.xxx prefix-list default in
neighbor 110.xxx.xxx prefix-list IP-out out
neighbor 110.xxx.xxx route-map ISPB-in in
neighbor 110.xxx.xxx route-map ISPB-out out

neighbor 202.xxx.xxx.xxx description "BGP with ISPA"
neighbor 202.xxx.xxx.xxx remote-as 1xxx
neighbor 202.xxx.xxx.xxx prefix-list default in
neighbor 202.xxx.xxx.xxx prefix-list IP-out out

 

ip prefix-list default seq 5 permit 0.0.0.0/0

ip prefix-list IP-out seq 5 permit 103.xxx.xxx.0/24

 

route-map ISPB-in permit 10
set local-preference 80

route-map ISPB-out permit 10
set as-path prepend 1xxxx 1xxxx 1xxxx 1xxxx

 

Now i want loadbalance between two ISP's . i want to advertise:

103.xxx.xxx.0/25  and 103.xxx.xxx.0/24 to ISPA

103.xxx.xxx.128/25 and 103.xxx.xxx.0/24 to ISPB

 

how can i do this ??

 

 

9 Replies 9

Pawan Raut
Level 4
Level 4

Break the subnet 103.xxx.xxx.0/24 to 103.xxx.xxx.0/25 and 103.xxx.xxx.128/25 and Advertised  these two subnet in BGP

 

router bgp 1xxxx
bgp log-neighbor-changes
network 103.xxx.xxx.0 mask 255.255.255.128

network 103.xxx.xxx.128 mask 255.255.255.128

!

Create two prefix-list 

ip prefix-list ISPA-out seq 5 permit 103.xxx.xxx.0/25

ip prefix-list ISPB-out seq 5 permit 103.xxx.xxx.128/25

!

Create two route-map one for ISP A out and other for B

route-map ISPA-out permit 10

match ip address prefix-list ISPA-out

!

route-map ISPA-out permit 20

match ip address prefix-list ISPB-out
set as-path prepend 1xxxx 1xxxx 1xxxx 1xxxx

!

 

route-map ISPB-out permit 10

match ip address prefix-list ISPB-out

!

route-map ISPB-out permit 20

match ip address prefix-list ISPA-out
set as-path prepend 1xxxx 1xxxx 1xxxx 1xxxx

!

 

Assigned this route-map to ISP peer.

router bgp 1xxxx

neighbor 110.xxx.xxx route-map ISPB-out out

neighbor 202.xxx.xxx.xxx route-map ISPA-out out

!

 

Kindly rate for useful Post

 

Pawan, Thank you 

 

what about the outgoing traffic from 103.xxx.xxx.0/25 and 103.xxx.xxx.128/25  IP's ,which path they will follow.

 

making again two 2 more rule for both isp to increase local pref. will work.

 

Firstly you need to check with your ISPs as they may not advertise any less than a /24. 

 

Secondly you cannot just add network statements because there has to be matching routes in the IP routing table or BGP will not advertise the subnets so you would need static routes for those /25s. 

 

And outbound traffic would use the IP routing table so if you wanted the traffic to be symmetric both ways you would need to use PBR. 

 

Jon

Hi Jon,

 

I also think my ISP's will not advertise /25 . 

 

What will be effect if my router advertises  /25 to both ISP (one to each ISP) ,and both the ISP advertising /24 instead of /25

 

Not sure what you are asking. 

 

ISPs generally will not accept any less than a /24 so they may just drop your advertisement. 

 

If they did accept them but did not advertise them on then you won't really achieve what you want to.

 

Jon

r.maharjan
Level 1
Level 1
Hi Aman,

If you have /23 public ip block, try to advertise /23 on both ISPs and one /24 on ISP A and another remaining /24 on another ISP B. Try to equally load balance traffic on each /24 internally to achieve as per your requirement. As Jon explained, for outgoing traffic you may need to do PBR for balancing traffic. Take some considerations before you do PBR.

When we talk about load balancing traffic with ISPs using BGP there are two aspects to the issue: balancing outbound traffic and balancing inbound traffic. The responses so far have dealt with inbound traffic by altering what is advertised. So let me make a suggestion about controlling outbound traffic. The original post was clear that each ISP advertises a default route. So no load balancing there. To achieve load balancing of traffic we send out I suggest implementing PBR. Divide the customer network in two parts, as suggested in previous posts, and use PBR to send traffic from the first half to ISP1 and traffic from the second half to ISP2. 

 

Jon has pointed out a valid concern that advertising a /25 to the ISP may not be acceptable. So perhaps load balancing for this customer may not be feasible. 

 

HTH

 

Rick

HTH

Rick

can i do same as u told if i have two /24 prefix from different range and cannot aggregate those prefix into /23.

if yes i can buy one more /24 and do load balancing

The suggestion to aggregate into a /23, to advertise the /23 to both ISP, and to advertise a single /24 to each ISP achieves load balancing and has the added advantage of achieving failover if one of the ISP is having a problem. If you have 2 /24 but can not aggregate them then you can certainly advertise a single /24 to each ISP and achieve load balancing for inbound traffic. This would not provide failover. To provide failover in this case you would need to do something like conditional advertisement.

 

HTH

 

Rick

HTH

Rick
Review Cisco Networking products for a $25 gift card