06-28-2018 09:59 PM - edited 03-05-2019 10:41 AM
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 ??
06-28-2018 11:53 PM
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
06-29-2018 12:28 AM - edited 06-29-2018 12:31 AM
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.
06-29-2018 12:33 AM - edited 06-29-2018 12:35 AM
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
06-29-2018 12:39 AM - edited 06-29-2018 12:40 AM
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
06-29-2018 12:40 AM - edited 06-29-2018 12:42 AM
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
06-29-2018 10:52 PM
06-30-2018 10:07 PM
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
07-01-2018 02:29 AM
07-08-2018 02:58 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide