All of lore.kernel.org
 help / color / mirror / Atom feed
* Basic dummy iptables SNAT multiple IPs algorithm question
@ 2012-02-10 14:46 Mihai Tanasescu
  0 siblings, 0 replies; only message in thread
From: Mihai Tanasescu @ 2012-02-10 14:46 UTC (permalink / raw)
  To: netfilter

Hi guys,

I've been using iptables and some of the modules it comes with for a
while now but only recently as I stumbled into a big NAT444 setup, did I
reach the point at which I'd like to find an answer to a theoretical
question.

I wanted to ask:
If I have a rule that says:
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/16 -j SNAT --to
20.20.20.1-20.20.20.22.254

Then how are the IPs from the private pool distributed to the ones from
the public pool in the two following cases:
- with persistent
- with random

Is it a simple mathematical thing like:
if private pool has X IPs ( 65536 in this case) and public Pool (Y) has
let's say 766 IPs in theory =>  X / Y = aprox 85 private IPs per public
IP and then:
- 192.168.0.0-84 =>  20.20.20.1
- 192.168.0.85-169 =>  20.20.20.2
and so on ?
or does this depend on the number of IPs which are online and the
algorithm is a bit more complex ?

Also, what happens in case random is being used to the same algorithm ?

Hope I'm not troubling you too much with theory related questions.

Thanks,
Mihai


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-10 14:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-10 14:46 Basic dummy iptables SNAT multiple IPs algorithm question Mihai Tanasescu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.