ECMP Load Balancing

Hello Members,
Need help with load balancing.

I have setup ECMP:
WAN 1 - 2.2.2.2
WAN 2 - 3.3.3.3

LAN 1 -

  1. USER 1 - 192.168.1.10
  2. USER 2 - 172.16.1.11
  3. USER 3 - 172.16.1.12
  4. USER 4 - 172.16.1.13
  5. USER 5 - 192.168.1.14

What I want to achieve is USER 1 & USER 5 to always reach WAN 1 as these USERS have been assigned static IP’s where as the other user are on dynamic.

How do I go about this?

Please help.

Thank you.

Sent from my SAMSUNG-SM-G935A using Tapatalk

You need to use policy based routing, either by using policy rules:

/ip route rule add src-address=172.16.1.11 action=lookup table=ISP01_OUT

or via the mangle facility in the firewall:

/ip firewall address-list add list=ISP1_CLIENTS address=172.16.1.11
/ip firewall mangle add chain=prerouting action=mark-routing new-routing-mark=ISP01_OUT src-address-list=ISP1_CLIENTS

Either way you’d need to add 2 separate default routes into 2 other routing tables.

/ip route add gateway=ISP01 routing-mark=ISP01_OUT

This is just a basic stanza, there are other ways to accomplish this that take into account your current setup.

Read this for more info:
https://wiki.mikrotik.com/wiki/Policy_Base_Routing

Thanks Shao for the help..