LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-09-2022, 11:35 AM   #1
aaa847
LQ Newbie
 
Registered: Jan 2022
Posts: 1

Rep: Reputation: 0
Question 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
 
Old 01-10-2022, 08:46 PM   #2
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
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/
 
1 members found this post helpful.
Old 01-12-2022, 02:05 AM   #3
beka
LQ Newbie
 
Registered: Dec 2021
Posts: 21

Rep: Reputation: Disabled
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Load balance network traffic with HAProxy LXer Syndicated Linux News 0 11-11-2020 07:01 PM
Best Red Hat solution for traffic Load Balance without additional hardware yucefrizk Red Hat 15 03-25-2010 06:31 AM
Best solution for traffic Load Balance without additional hardware yucefrizk Linux - Software 2 03-13-2010 06:44 AM
Can LVS be used to load balance MS servers or not? lumix Linux - Networking 1 01-28-2008 04:56 PM
Load balance incoming port 80 using PF mylesridgely *BSD 3 10-07-2003 02:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration