Community discussions

MikroTik App
 
barcos
just joined
Topic Author
Posts: 4
Joined: Sat Oct 14, 2023 1:01 am

Splitting /24 between two BGP peers.

Tue Jan 30, 2024 3:25 am

Hello, I have a ccr2116 and in it, I have two BGP sessions, let's call them BGP1 and BGP2. I also have two IP blocks /24, let's say they are 192.168.1.0/24 and 192.168.2.0/24. The issue is that I want the range 192.168.1.0/24 to use only BGP1, and the range 192.168.2.0/24 to be split in two: one /25 to use BGP1 and the other /25 to use BGP2. To complicate it further, BGP2 uses communities 45622:5487.

I need to create a routing filter rule, and I had something like this in mind, but clearly, it's not correct:

if (dst in 192.168.2.0/25) {set bgp-path = bgp2; set bgp-communities = 45622:5487; accept} else if (dst in 192.168.2.128/25) {set bgp-path = bgp1; accept} else if (dst in 192.168.1.0/24) {set bgp-path = bgp1; accept}

I need help to achieve this.
 
User avatar
TomjNorthIdaho
Forum Guru
Forum Guru
Posts: 1493
Joined: Mon Oct 04, 2010 11:25 pm
Location: North Idaho
Contact:

Re: Splitting /24 between two BGP peers.

Tue Jan 30, 2024 4:41 am

I just worked on this a couple of weeks ago - and got mine running.
I am assuming you are BGP peering to something where both BGP servers ( yours and theirs ) are using private AS numbers.
What you can do to split the load on a /24 BGP network between two remote BGP peers is configure as prepend on your /24 - where - you divide your /24 into two /25 networks. On your first /25 configure it as somewhat normal BGP peering , then on the other /25 half of your /24 , configure the /25 to ap prepend twice. Then repeat the process on your other BGP peering - but this time , configure your AS prepend so that it is on the other /25 network.
The result is on a /24 network ( two /25s ) the lower half of the /24 comes in over one BGP peer and the upper half of the /24 comes in over the other BGP peering sessiong. If one BGP peer session goes down , then the remaining BGP peering session will pickup everything until the failed BGP session starts talking again.

if you have a 3\rd BGP peer for your network - lets say a very slow network , you can add both of your /25s to it and prepend 6 times , so that the result is when both of your normal BGP peers are running , the 3'rd bgp peer does nothing, And when both of your normal BGP peering sessions go down , then your last fall-back slow BGP peering session will then bring up everything until at least one of your two primary BGP peering sessions starts talking again.

As a rule of thumb - slow is better than dead ( thus a 3'rd alternate fall back BGP peer might be considered )
 
barcos
just joined
Topic Author
Posts: 4
Joined: Sat Oct 14, 2023 1:01 am

Re: Splitting /24 between two BGP peers.

Tue Jan 30, 2024 6:47 pm

I understand somewhat what you're trying to convey, but I don't know how to implement it. Additionally, for example, one of the /24 blocks should always use the same BGP2 since I'm not allowed to announce it in BGP1. The other block needs to be divided into two /25s, and each one should be announced in one of the BGP sessions. I tried something like the following, but it clearly didn't work:

chain:test rule: if (dst in 192.168.2.0/25) {set bgp-path = bgp2; set bgp-communities = 45622:5487; accept}

chain:test rule: if (dst in 192.168.2.128/25) {set bgp-path = bgp1; accept}

chain:test rule: if (dst in 192.168.1.0/24) {set bgp-path = bgp1; accept}
 
User avatar
baragoon
Member
Member
Posts: 310
Joined: Thu Jan 05, 2017 10:38 am
Location: Kyiv, UA
Contact:

Re: Splitting /24 between two BGP peers.

Tue Jan 30, 2024 8:11 pm

there is no "set bgp-path" command, you need to create separate filters for eatch upstream and set them in the bgp-connections as input.filter=
at least at latest V7
 
barcos
just joined
Topic Author
Posts: 4
Joined: Sat Oct 14, 2023 1:01 am

Re: Splitting /24 between two BGP peers.

Fri Feb 02, 2024 1:34 am

I still don't know how to do it

Who is online

Users browsing this forum: No registered users and 3 guests