Routing
Highlighted
Routing

BGP Load Balacing

‎07-16-2019 01:46 PM

I'm trying to figure out the best way to load balance outbound traffic over two ISP links with BGP. We have two separate MX routers that have a link between them running iBGP.  We have an ISP circuit from the same provider connected to each router running eBGP. On the ISP end the circuits are also connected to different routers. We currently import the default route only on both of our circuits.

 

Currently, we prefer one circuit for all inbound/outbound traffic, however, we are close to hitting capacity and need to start thinking about load-sharing over both circuits. For inbound traffic I can tweak the prepends for some prefixes to achieve this but for the outbound traffic, I'm not sure how to achieve this. My understanding is BGP multipath is not going to work in this scenario because the circuits are connected to two different routers.  Is it possible to do this? 

 

6 REPLIES 6
Routing

Re: BGP Load Balacing

‎07-16-2019 05:34 PM

You could ask the seconday bgp connection to change the export policy to send you partial tables instead of just the default. 

 

Then you will get a mix of more specific routes on this peering that will steer the carrier local traffic only out the secondary peer taking that partial load off the primary default route.

 

Steve Puluka BSEET - Juniper Ambassador
IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
http://puluka.com/home
Routing

Re: BGP Load Balacing

‎07-16-2019 08:02 PM

Hello,

 

If you don't have BGP ECMP, multipath wouldn't help to load balance the traffic.

https://www.juniper.net/documentation/en_US/junos/topics/example/routing-selecting-multiple-equal-co...


Another way to alter the behavior of outbound traffic is to use the local-preference in an import-policy. Default local-preference of a route is 100 and if same route is learned from two peers and one has higher local-preference, say 150, it will preferred over other route.

You can increase the local preference of some prefixes on one router and for other prefixes on other router. It will make sure that traffic is distributed on two routers. Key is to increase the local-preference of some routes on router which is under utilized.

You can match any parameter (AS, particular subnet, community) to increase the local-preference of corresponding prefixes.

Please mark my response as solution if it solves your problem!

Thanks
Vishal

Routing

Re: BGP Load Balacing

[ Edited ]
‎07-17-2019 03:34 AM

Hello,

 


@EMS03 wrote:

. We currently import the default route only on both of our circuits.

<skip>

. My understanding is BGP multipath is not going to work in this scenario because the circuits are connected to two different routers.  Is it possible to do this? 

 


 

 

Yes of course.

if You are receiving only 0/0 then it is highly likely that 0/0 is generated by ISPs themselves.

As such You need to :

1/ speak to Your ISPs to ensure they do NOT prepend this 0/0 with anything

2/ strip any MED inbound, if MED is present and different

3/ rewrite Origin inbound if ISPs use different Origin value

4/ in Your own router, use "multipath multiple-as"

https://www.juniper.net/documentation/en_US/junos/topics/topic-map/bgp-multipath.html

HTH

Thx

Alex

 

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Routing

Re: BGP Load Balacing

[ Edited ]
‎07-20-2019 03:43 PM

Hey,

 

let me try to help you out here:

 

Let's assume you have the following topology:

 

ISP A --- MX1 -- Endsystems

                   | 

ISP B --- MX2 -- Endsystems

 

You're running iBGP between MX1 and MX2 presumably to cope uplink outages. So both default routes are present in both routers - however just one is active. You're right that BGP multipath probably isn't going to solve all your issue - however you could still use it on the router with the higher load like this:

set policy-options policy-statement LB-UPLINK term 0 then load-balance per packet 

set routing-options forwarding-table export LB-UPLINK 

set protocols bgp group UPLINK multipath multiple-as 

set protocols bgp group iBGP multipath multiple-as 

 

! Do not configure this on both routers. It'll cause some nasty routing loops. Trust me - I've been there before ! 

Now you have offloaded some traffic off to the iBGP link.

 

But maybe there is a nicer way. Could you share more information about your network topology?

 

Routing

Re: BGP Load Balacing

[ Edited ]
‎07-20-2019 09:17 PM

Hello,

 


@Nytaso wrote:

However this is still not enough, since the AS path of the iBGP group will be longer.

 


 

No, it won't.

iBGP does not prepend own ASN when advertising to other iBGP neighbor.

To wit, the BGP path selection will stop at step 9 and MX1/MX2 won't LB between eBGP and iBGP. Sorry Smiley Wink

https://www.juniper.net/documentation/en_US/junos/topics/reference/general/routing-protocols-address...

HTH

Thx

Alex

_____________________________________________________________________

Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements

+++++++++++++++++++++++++++++++++++++++++++++

Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Routing

Re: BGP Load Balacing

[ Edited ]
‎07-21-2019 05:10 AM

Hey Alex, 

Whoops - you're right. Not the best to write technical stuff in the middle of the night. iBGP does not prepend it's own ASN.

 


@aarseniev wrote:

iBGP does not prepend own ASN when advertising to other iBGP neighbor.

To wit, the BGP path selection will stop at step 9 and MX1/MX2 won't LB between eBGP and iBGP. Sorry Smiley Wink

https://www.juniper.net/documentation/en_US/junos/topics/reference/general/routing-protocols-address...


 

However load balancing between iBGP and eBGP ist still possible Smiley Wink.

 

Have you thought about putting all your internet routing into a vrf? 

That way you could use the following:

 

 

set routing-options forwarding-table export LB-UPLINK
set policy-options policy-statement LB-UPLINK then load-balance per-packet

set routing-instances INTERNET instance-type virtual-router
set routing-instances INTERNET interface xy-MX1
set routing-instances INTERNET interface xy-UPLINK
set routing-instances INTERNET routing-options multipath vpn-unequal-cost equal-external-internal
set routing-instances INTERNET protocols bgp group MX1 type internal
set routing-instances INTERNET protocols bgp group MX1 peer-as 11111
set routing-instances INTERNET protocols bgp group MX1 multipath multiple-as
set routing-instances INTERNET protocols bgp group MX1 neighbor 10.10.10.4
set routing-instances INTERNET protocols bgp group UPLINK peer-as 12346 set routing-instances INTERNET protocols bgp group UPLINK multipath multiple-as set routing-instances INTERNET protocols bgp group UPLINK neighbor 10.10.10.3

 

 

"multipath vpn-unequal-cost equal-external-internal" is currently only available in VRFs. But the result will be the following:

 

root@MX2> show route table INTERNET.inet.0 

INTERNET.inet.0: 6 destinations, 9 routes (6 active, 0 holddown, 0 hidden)
@ = Routing Use Only, # = Forwarding Use Only
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          @[BGP/170] 00:00:08, localpref 100
                      AS path: 12346 I
                    > to 10.10.10.3 via xy-UPLINK
                    [BGP/170] 00:00:28, localpref 100
                      AS path: 12345 I
                    > to 10.10.10.4 via xy-MX1 
                   #[Multipath/255] 00:00:08
                      to 10.10.10.4 via xy-MX1
                    > to 10.10.10.3 via xy-UPLINK

 

Hope that'll help Smiley Happy.