Loadbalancing traffic of a service between multiple LAN hosts in OpenWrt

Hi, I can find plenty of posts/info about load balancing multiple networks (ie primary and backup internet connections).

What I would like to do is load balance multiple hosts within a network.
EG two web servers running on port 8080 with ip addresses and OpenWrt router with address listens on port 8080 and forwards connections to whichever webserver is available.
Is this possible in OpenWrt, I can seem to find anything but I thought it might be a common thing.

load balance based on what ?

bandwidth ? connections ? .... ?

check out https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3

Thanks for the response. Primarily loadbalancing was meant to be based on availability (ie is the server accepting connections on the given port, if both are up and accepting connections then balance based on connections). This is just for some home stuff and very low volume use, really the point was to be able to move containers/shutdown servers without disruption.
I had already looked at the page you linked to but that seems to talk more about loadbalancing two networks (which is not what I need).

I think this might be what you’re looking for:

The answer I was looking for (which was certainly not obvious) was to install the haproxy app. Real simple to install and configure and provides HTTP and TCP load balancing. Initial test looks good, fingers crossed it covers everything I need.
Thanks for the suggestions.


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.