Does mikrotik support HAProxy style loadbalancing? we have WWW server and i want to do load sharing between them like F5. How to do that?
Guys any idea?
You should be able to use PCC to mark each connection in turn, and then add multiple dstnat rules, each using a connection mark.
The per-connection-classifier keeps each client talking to the same server, but you can choose different methods.
Note that this does not test to make sure that the servers are up !
I’ve not tested the example here, but is should give you the idea.
First mark the connections
/ip firewall mangle add chain=prerouting dst-port=80 action=mark-connection \
new-connection-mark=1st_conn per-connection-classifier=src-address:3/0
/ip firewall mangle add chain=prerouting dst-port=80 action=mark-connection \
new-connection-mark=2nd_conn per-connection-classifier=src-address:3/1
/ip firewall mangle add chain=prerouting dst-port=80 action=mark-connection \
new-connection-mark=3rd_conn per-connection-classifier=src-address:3/2
Then use separate NAT rules, assuming your servers are on the 3 internal addresses
/ip firewall nat
add chain=dstnat connection-mark=1st_conn action dst-nat dst-address=192.168.88.10
add chain=dstnat connection-mark=2nd_conn action dst-nat dst-address=192.168.88.20
add chain=dstnat connection-mark=3rd_conn action dst-nat dst-address=192.168.88.30
Nick