I have a silly need. I’m running some AI loads on two hosts and would like to use mikrotik to load balance the traffic from some client machines . Today I manually configure the client machine to point to appropriate ai server based on need.
I would like to setup a pool of ai servers and have mikrotik route the traffic based to the ones that are up. As a bonus it would be nice to be able to set server preference. So if the the with a lot of horsepower is up this one would take on all the traffic.
Is this possible with mikrotik? Or I need something like pfsense, F5? This is for home use.
Thanks in advance.
There are 2 parts to this question ; frontend & backend
In the backend, you could with “Netwatch” tool have a “test” (eg. ping or http-get to backend servers and do things if they reply or not)
So these would be your health-checks to the backend servers and you could enable/disable DNAT’s based on this for example.
However, the problem with Mikrotik is the front-end part. You probably want 1 public IP / entrypoint right ? That’s the part that is not possible.
RouterOS is no reverse proxy.
IF your Mikrotik supports containers, look at nginx,caddy,traeffik and do your thing…
Not sure I follow the back end and front end bits.
I was thinking setting up a route to an ip . If the ping fails on one of the two ips sent to another . Kinda like the gateway setup for wan failover.
I will look into those other containers.
Ok, but you write it as if you want some mechanism of “load balancing”. That is not gonna work.
You can have 1 destination-NAT (so at network level) pointing to some backend (internal) IP and have this changed based if the backend is “up”
For this to work you could have several DNAT’s configured and you enable/disable the one you need through netwacht-script outcome.
With “netwatch” you can do simple “ping” of “http-get” or something, expect a certain reply-code and then take action upon that.