Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Paweł Staszewski" <pstaszewski@artcom.pl>
To: "John A. Sullivan III" <john.sullivan@nexusmgmt.com>,
	netfilter@lists.netfilter.org
Subject: Re: Rounf-Robin NAT
Date: Tue, 16 Mar 2004 14:13:25 -0500	[thread overview]
Message-ID: <1079464404.7056.9.camel@localhost> (raw)
In-Reply-To: <1079438239.2012.1.camel@localhost>

On Tue, 2004-03-16 at 06:57, John A. Sullivan III wrote:
> On Tue, 2004-03-16 at 06:15, AFShin wrote:
> > Dear Friends,
> > Can iptables do the real Round-Robin SNAT --to ?
> > Is there any patch or it is available ?
> > Thank you all in advance,
> > AFShin A.
> I do not know the actual code but somewhere in the back of my mind I
> recall something about iptables using a rudimentary load balancing
> algorithm, i.e., rather than strict round robin, it distributes the next
> NAT to the least used address.  Can anyone confirm that? - John

Hello
Try this...
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -m nth --counter 4 --every
4 --packet 0 -j SNAT --to xxx.xxx.xxx.xx1
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -m nth --counter 4 --every
4 --packet 1 -j SNAT --to xxx.xxx.xxx.xx2
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -m nth --counter 4 --every
4 --packet 2 -j SNAT --to xxx.xxx.xxx.xx3
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -m nth --counter 4 --every
4 --packet 3 -j SNAT --to xxx.xxx.xxx.xx4

that is good round-robin nat, but some services may not work (like https
or other where is "smart" firewall (anti spoof)) 




  reply	other threads:[~2004-03-16 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 11:15 Rounf-Robin NAT AFShin
2004-03-16 11:57 ` John A. Sullivan III
2004-03-16 19:13   ` Paweł Staszewski [this message]
2004-03-16 13:23     ` Fabiano Reis
2004-03-16 17:00       ` Gaël Le Mignot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1079464404.7056.9.camel@localhost \
    --to=pstaszewski@artcom.pl \
    --cc=john.sullivan@nexusmgmt.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox