Can iptables be used to load balance incoming traffic b/w L4 ports?
Hello Guys,
We have an application that can be initialized to listen for incoming udp traffic at any L4 port like 9997 or 9998 etc. We are receiving traffic at the server side (hosting the instances of the application) on port 9996 however if we run a single instance of the application listening on port 9996 to handle all this traffic we run into stability issues, we require to divide incoming traffic on port 9996 among ports 9997, 9998 and 9999 etc (a separate instance of the application will be listening on these ports) equally. I was wondering if we can use iptables as a L4 load-balancer for achieving this? Any help in this regard would be much appreciated. PFB iptable config at server side: Chain PREROUTING (policy ACCEPT) num target prot opt source destination Chain INPUT (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination Chain POSTROUTING (policy ACCEPT) num target prot opt source destination Regards, aaa847 |
I am not sure if iptables supports the logic to do this intelligently. Take a look at this page using Nginx as a load balancer to get some ideas.
https://docs.nginx.com/nginx/admin-g...load-balancer/ |
I don't think iptables is suitable for this purpose. You can look into HAProxy - Apache and Nginx can also serve to load balance when configured as reverse proxy servers.
Best |
All times are GMT -5. The time now is 06:42 PM. |