Routing
Routing

Load-Balancing via interfaces in diff ribs

08.11.17   |  
‎08-11-2017 04:36 AM

Hi there,

 

Can somebody help me :-) So there is case >>>

I have task with configuring redundant scheme, where I have one router, configured two bgp sessions via different interfaces(em0 & em1) but in the same network (eg 20.0.0.0/24).

One interface in master instance, anohter in eg test.

I receive prefix 1.1.1.1/32 from same bgp peer in different instances, and it is presented in my RIBs.

I made route-leaking of bgp-route 1.1.1.1/32 from instance test to master.

So, the question is, how to make load-balancing works via two interfaces - em0 & em1 to this destination -1.1.1.1/32 ? :-)

 

 

 

root# run show route 1.1.1.1/32

inet.0: 3 destinations, 4 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[BGP/170] 01:39:03, MED 0, localpref 100
                      AS path: 65002 I
                    > to 20.0.0.2 via em0.0
                    [BGP/170] 01:39:30, MED 0, localpref 100
                      AS path: 65002 I
                    > to 20.0.0.2 via em1.0

test.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[BGP/170] 01:39:30, MED 0, localpref 100
                      AS path: 65002 I
                    > to 20.0.0.2 via em1.0

 

Attachments

12 REPLIES
Routing

Re: Load-Balancing via interfaces in diff ribs

08.30.17   |  
‎08-30-2017 07:58 AM

Hi,

 

I didn't check your configuration properly so i might be missing something here but just wanted to check if you tried applying export policy in forwarding option?

 

[edit routing-options]
+   forwarding-table {
+       export test;
+   }
[edit policy-options]
+   policy-statement test {
+       term 1 {
+           then {
+               load-balance per-packet;
+           }
+       }
+   }

[edit]

 

commit and check if you see 2 next-hop in "show route forrwarding-table destination 1.1.1.1

 

 

Routing

Re: Load-Balancing via interfaces in diff ribs

[ Edited ]
08.30.17   |  
‎08-30-2017 01:17 PM

Hi, singhh

 

Yep, I did it. It would be too simple just to configure like that and make it works. :-)

 

So, maybe there is another way or I missed something...

Routing

Re: Load-Balancing via interfaces in diff ribs

09.01.17   |  
‎09-01-2017 06:19 AM

I am not sure if it's possible.

 

In case of BGP multipath, I guess both route should be learnt in same table (either global or vrf/routing instance table) and should match the bgp multipath criteria for multipath to work. still i will check and let you know.

 

You can try FBF if you want to load balance the traffic.

 

Also, is there any specific requirement to keep one interface in routing-instance and one in global?

 

 

Routing

Re: Load-Balancing via interfaces in diff ribs

09.04.17   |  
‎09-04-2017 10:45 AM

If you mean under FBF - create instance/es with type forwarding, in this case, I can't run BGP there, but I need it for peering. Or I didn't unerstand you right?

 

No, there is goal to use both inetrfaces at the same time. (LACP can't be used by ISP requirment)

 

Thanks.

Routing

Re: Load-Balancing via interfaces in diff ribs

09.07.17   |  
‎09-07-2017 09:37 AM

ok.

How's your setup looks like? can you explain a bit.

May be i can give an idean of what you can do to make it work. how do you have same subnet coming on 2 interface?

a rough diagram and requirement would be a great if possible.

Routing

Re: Load-Balancing via interfaces in diff ribs

09.22.17   |  
a month ago

Hi singhh,

 

So, there is router connected to traffic Internet Exchange(IX) point, connected by 2x1GB ports.

Main goal is to load both links.

You can say: "Aggregate those links into AE", BUT >>> there is restriction on using LACP, so I can't aggregate those. So I was thinking on making separated RIBs and put this interfaces in one network and make Load-Balancing working, but no.

So here is some scheme of connections.

 

 

Attachments

Routing

Re: Load-Balancing via interfaces in diff ribs

09.22.17   |  
a month ago

Ok.. I got one idea but let me test that first

Routing

Re: Load-Balancing via interfaces in diff ribs

10.02.17   |  
3 weeks ago

Hi singhh,

 

How are you doing there, maybe you have some news? :-)

Routing

Re: Load-Balancing via interfaces in diff ribs

10.03.17   |  
2 weeks ago

Hi,

 

I was thinking about this and I thought of trying to creat bridge-domain, putting both interface in that bridge-domain and assigning ip address to irb but it didn't work. I was able to form BGP neigborship but traffic was going through only one link.

 

Then i used your configuration and made slight changes.. I increased the local prefrence for some of the route recieved in routing-instance.

That way i could install some of the route in routing-table pointing towards exit interface in routing-instance and some in global table.

You can try this but you can only load balance outgoing traffic this way.. for incoming traffic load balancing you can use MED/ As-path prepend if your ISP allow to use that.

 

 

I am not sure if you have already tried this. This is what i could think of and I am not sure if there's any other way to make it work.

 

lets see if somebody else on the forum has an idea and can help us.

 

Regards

Harpreet

 

 

 

Routing

Re: Load-Balancing via interfaces in diff ribs

10.05.17   |  
2 weeks ago

Hi,

 

Could you give your config for fully understanding.

 

Thanks!

Highlighted
Routing

Re: Load-Balancing via interfaces in diff ribs

[ Edited ]
10.06.17   |  
2 weeks ago

Hi,

 

Here's my BGP configuration

 

root@mx480# show routing-instances ecmp
instance-type virtual-router;
interface ge-0/3/9.0;
protocols {
bgp {
group test {
export as-path-prepend-instance;
neighbor 172.16.20.2 {
import lp;
peer-as 100;
}
}
}
}

[edit]
root@mx480#

[edit]
root@mx480# show policy-options policy-statement lp
from {
route-filter 100.200.111.0/24 exact;
route-filter 100.200.110.0/24 exact;
route-filter 100.200.112.0/24 exact;
route-filter 100.200.113.0/24 exact;
}
then {
local-preference 200;
accept;
}

[edit]
root@mx480#

root@mx480# show protocols bgp
group test {
export as-path-prepend-global;
neighbor 172.16.20.2 {
peer-as 100;
}
neighbor 10.0.0.1 {
peer-as 400;
}
}

[edit]
root@mx480#

[edit]
root@mx480# show interfaces ge-0/3/8
unit 0 {
family inet {
address 172.16.20.1/24;
}
}

[edit]
root@mx480# show interfaces ge-0/3/9
unit 0 {
family inet {
address 172.16.20.20/24;
}
}

[edit]
root@mx480#

 

root@NAT-Device-mx480# run show route 100.200.111.0/24

inet.0: 103 destinations, 138 routes (103 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

100.200.111.0/24 *[BGP/170] 3d 08:16:49, localpref 200
AS path: 100 I, validation-state: unverified
> to 172.16.20.2 via ge-0/3/9.0
[BGP/170] 3d 08:26:06, localpref 100
AS path: 100 I, validation-state: unverified
> to 172.16.20.2 via ge-0/3/8.0
100.200.111.1/32 *[BGP/170] 3d 08:26:06, localpref 100
AS path: 100 I, validation-state: unverified
> to 172.16.20.2 via ge-0/3/8.0
[BGP/170] 3d 08:26:06, localpref 100
AS path: 100 I, validation-state: unverified
> to 172.16.20.2 via ge-0/3/9.0

ecmp.inet.0: 80 destinations, 84 routes (80 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

100.200.111.0/24 *[BGP/170] 3d 08:16:49, localpref 200
AS path: 100 I, validation-state: unverified
> to 172.16.20.2 via ge-0/3/9.0

[edit]
root@mx480#

 

You can see route from routing-instance ecmp has been installed in forwarding table because of higher local preference

 

[edit]
root@mx480# run show route forwarding-table destination 100.200.111.0
Routing table: default.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
100.200.111.0/24 user 0 172.16.20.2 ucst 668 39 ge-0/3/9.0

Routing table: __juniper_services__.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 dscd 514 2

Routing table: __pfe_private__.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 dscd 527 2

Routing table: __master.anon__.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 rjct 538 1

Routing table: ecmp.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
100.200.111.0/24 user 0 172.16.20.2 ucst 668 39 ge-0/3/9.0

[edit]
root@mx480#

 

Rest of the routes (whose local preference is default) are installed in forwarding table from default inet.0 

 

labroot@NAT-Device-mx480# run show route forwarding-table destination 100.200.101.0/24
Routing table: default.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
100.200.101.0/24 user 0 172.16.20.2 ucst 549 31 ge-0/3/8.0
root@mx480

 

HTH

Routing

Re: Load-Balancing via interfaces in diff ribs

[ Edited ]
10.09.17   |  
2 weeks ago

Hi singhh,

 

I think you didn't understand me right, thanks for your time & help, but I mean not just install routes from instance to default RIB, but also make them balanced with arleady existed routes in default rib.

 

 

Just for example:

 

show route 1.0.0.0/24

 

1.0.0.0/24         *[BGP/170] 5d 20:27:27, MED 0, localpref 70000, from 10.1.1.1
                             AS path: 65000 65001 I
                             > to 10.253.184.42 via ae0.0 <---- I mean this case|
                                 to 10.253.184.50 via ae1.0 <-----------------------|

 

 

show route forwarding-table destination 1.0.0.0/24

Routing table: default.inet

Internet:

Destination        Type RtRef Next hop           Type Index NhRef Netif

1.0.0.0/24             user     0                                 indr 1049510 399575
                                                                               ulst 1048574     4
                              10.253.184.42      ucst   731     2 ae0.0 <----- Like these
                              10.253.184.50      ucst   732     3 ae1.0 <----------- ones

 

 

 

Examples are from here.