N
N
Nicholas Secret2019-08-03 13:22:35
Mikrotik
Nicholas Secret, 2019-08-03 13:22:35

How to distribute the load on the servers for mikrotik?

A few days of googling gives only how to load balance from different WANs with masquerading, but I need it the other way around.
There are two web servers on the tick network, with static content, for example, there are several more services that run on different servers and synchronization between them is not needed, only fault tolerance and balancing are needed.
So if I do it on tick

add action=dst-nat chain=dstnat  \
    dst-address=1.1.1.1 dst-port=80 per-connection-classifier=\
    both-addresses-and-ports:2/0 protocol=tcp to-addresses=192.168.0.101
add action=dst-nat chain=dstnat  \
    dst-address=1.1.1.1 dst-port=80 per-connection-classifier=\
    both-addresses-and-ports:2/1 protocol=tcp to-addresses=192.168.0.102

Will balancing between servers work for me?
And if one turns off the Mikrotik will understand this or will it still shoot packets at it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan Fedoseev, 2019-08-04
@Ncla

Mikrotik will not understand, it will not check anything.
Maximum - you can write a script on it, run it once a minute, let's say, in which to check the availability of servers, and, if necessary, edit the rules of masquerading.
This task is not the task of the router. You are correctly advised above - put haproxy on a dedicated server, assign it as a balancer and do not torment the poor Mikrotik .....

P
poisons, 2019-08-03
@poisons

Let's see? There are dozens of normally working options for solving this problem, but why is it so pulling to drag Mikrotik into a bunch? it is a router, it routes traffic.
If you just want to do it on the router like this, well, pour dd-wrt / open-wrt into it, on top of haproxy. Idiocy,
That's right - haproxy inside the perimeter. One balancer is not enough, and suddenly it falls down - the second haproxy is nearby, we buy an external address from the provider, we push it into the second one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question