Community discussions

MikroTik App
 
Ostik
just joined
Topic Author
Posts: 4
Joined: Tue Jan 18, 2022 9:57 am

BGP Prepend Load Balance

Thu May 12, 2022 1:57 pm

Real IP addresses removed.
viewtopic.php?p=773760&hilit=bgp+load+b ... rs#p773760 did not help since Mikrotik does not use two default routes.
viewtopic.php?p=503195&hilit=bgp+load+b ... rs#p503195 did not help since Mikrotik does not use two default routes.
viewtopic.php?p=614446&hilit=bgp+load+b ... rs#p614446 din not help.
viewtopic.php?p=852467&hilit=bgp+load+b ... rs#p852467 did not help.


Attached Network Diagrams:

1) DIAGRAM OF CURRENT PROBLEM
Current Problem BGP Load Balance.png


2)DIAGRAM OF REQUIRED SOLUTION.
Wanted Solution BGP Load Balance.png


I have two edge routers each with a BGP session to a different upstream provider, see diagram 1.

Upstream1 sends 0.0.0.0/0 to my IPE1.
I gave the route a local pref of 110.

IPE1 advertises the following to Upstream1:
10.10.0.0/22
10.10.1.0/24
10.10.2.0/24 Prepend 2
10.10.3.0/24 Prepend 2

Upstream2 sends 0.0.0.0/0 to my IPE2.
I gave the route a local pref of 100.

IPE2 advertises the following to Upstream2:
10.10.0.0/22
10.10.1.0/24 Prepend 2
10.10.2.0/24
10.10.3.0/24


Upstream1 is used for all outgoing traffick. (Higher Local Pref)
Upstream1 is used for incoming traffic for 10.10.1.0/24.
Upstream2 is used for incoming traffic for 10.10.2.0/24 and 10.10.3.0/24.

I am seeing two problems with incoming taffic for 10.10.2.0/24 and 10.10.3.0/24.
1) Traffic for 10.10.2.0/24 and 10.10.3.0/24. is coming in via upstream1/IPE1 and upstream2/IPE2 instead of upstream2/IPE2 only.
2) The bulk (say 80%) of the incoming traffic for 10.10.2.0/24 and 10.10.3.0/24 comes in via upstream1/IPE1.

10.10.1.0/24 Traffic is doing exactly what I want it to do, it uses upstream1/IPE1 for both outbound and inbound; and does not touch upstream2/IPE2 at all.

I am aware that since upstream1 is the default route for outgoing traffic, the "reply" traffic for 10.10.2.0/24 and 10.10.3.0/24, might return via upstream1.

Questions.
1) Any ideas why the inbound traffic for 10.10.2.0/24 and 10.10.3.0/24 comes in via both upstreams?
2) Does the reply traffic ignore the prepend and come back via the same interface/path it left out of?

NB!! Externally originated/initiated traffic destined to 10.10.2.0/24 and 10.10.3.0/24 correctly comes in via upstream2/IPE2.
Looking glasses and traceoutes show the correct information.
You do not have the required permissions to view the files attached to this post.
 
terintamel
Frequent Visitor
Frequent Visitor
Posts: 99
Joined: Sun Sep 05, 2010 3:09 am

Re: BGP Prepend Load Balance

Fri May 13, 2022 11:18 pm

Not sure if this answers your questions but I have two BGP feeds that I manually load balance using BGP advertisements (for incoming traffic) and routing filter Local Pref for outgoing traffic. I do not use prepending at all. I have had this in place for years with no issues.

I have a /20 IP block so I advertise my whole IP block (/20) out both upstreams and then my lower half (/21) out Upstream 1 and upper half (/21) out Upstream 2. In your example I would do the following.

For Upstream1 advertise the following.
10.10.0.0/22
10.10.1.0/24

For Upstream2 advertise the following
10.10.0.0/22
10.10.2.0/24
10.10.3.0/24

As routing uses the more specific route by default incoming traffic for 10.10.2.x and 10.10.3.x would come in Upstream 2. Should upstream 2 fail then that traffic will instead come in via Upstream 1 because of the broader 10.10.0.0/22 route you have in place that covers the 10.10.2.x and 10.10.3.x subnets.

The reverse would also work should Upstream 1 fail as traffic for 10.10.1.x would move to Upstream 2 due to the /22 that covers this subnet being advertised out upstream 2
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: BGP Prepend Load Balance

Fri May 13, 2022 11:50 pm

Many ASNs will ignore prepends in the DFZ these days because they set a default localpref or modify the localpref based on the peer the routes were learned on.This is likely why your prepending solution isn't working as expected.

Either advertise more specific routes as someone mentioned or use traffic engineering BGP communities if your upstream peer supports them.
 
Ostik
just joined
Topic Author
Posts: 4
Joined: Tue Jan 18, 2022 9:57 am

Re: BGP Prepend Load Balance

Wed May 18, 2022 1:49 pm

Input much appreciated, thanks.
I'll try the solutions out to see which one works best.

Who is online

Users browsing this forum: No registered users and 17 guests