Community discussions

MikroTik App
 
satish143
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Jan 22, 2016 9:54 pm

Does mikrotik support HAProxy style load balancing?

Sat Feb 20, 2016 11:41 pm

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?
 
satish143
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Jan 22, 2016 9:54 pm

Re: Does mikrotik support HAProxy style load balancing?

Sun Feb 21, 2016 5:32 pm

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?
 
User avatar
nickshore
Long time Member
Long time Member
Posts: 521
Joined: Thu Mar 03, 2005 4:14 pm
Location: Suffolk, UK.
Contact:

Re: Does mikrotik support HAProxy style load balancing?

Sun Feb 21, 2016 7:13 pm

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

Who is online

Users browsing this forum: Bing [Bot] and 176 guests