netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rob Sterenborg (lists)" <lists@sterenborg.info>
To: netfilter <netfilter@vger.kernel.org>
Subject: Re: Advice on best way to set up multi-route NAT for lots of IPs
Date: Thu, 05 Jan 2012 14:17:36 +0100	[thread overview]
Message-ID: <1325769456.2910.42.camel@ns014530.dcyb.net> (raw)
In-Reply-To: <CAKywjPpBW-KMfS72n_fpLk10gTvZm=iDV5PjGJgPvja6sQN6NQ@mail.gmail.com>

On Thu, 2012-01-05 at 12:59 +0100, Anton Melser wrote:
> > So, I think I understand that you want to SNAT a complete private subnet
> > to a corresponding public subnet. Is the NETMAP target usable for you,
> > or am I misunderstanding you completely?
> > Something like:
> >
> > iptables -t nat -A POSTROUTING -s ${private_subnet} -j NETMAP --to
> > ${public_subnet}
> 
> Thanks for the suggestion. It appears that NETMAP does 1:1 and both
> SNAT and DNAT. I need to do many:1 lots of times (so (many:1)*n), and
> I don't need (or want actually) DNAT. Is it possible to use NETMAP to
> do this?

According to this article, NETMAP does SNAT when used in POSTROUTING and
DNAT in PREROUTING, which sounds logical to me.
https://capcorne.wordpress.com/2009/03/24/natting-a-network-range-with-netmapiptables/

If you want to do many:1 NAT then that's SNAT, and when reading your
original email again that seems to be what you want (on a large scale).

>> So, I have around 1600 public IPs in 4 blocks (3 x /23 + /25 on
>> different ISPs).

>> So say for each external IP I would have a /24,
>> giving me up to 250-odd potential internal machines

So, each public IP services a /24 subnet and you have 1600 public IP's.
That would be a lot of rules to create because for each public IP you'd
need an SNAT rule, each matching a private subnet. Sorry, I don't know
of an easier solution for what you want.


--
Rob



  reply	other threads:[~2012-01-05 13:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-01 16:10 Advice on best way to set up multi-route NAT for lots of IPs Anton Melser
2012-01-01 20:24 ` Lloyd Standish
2012-01-01 20:41   ` Anton Melser
2012-01-01 21:36     ` Anton Melser
2012-01-01 22:11     ` Lloyd Standish
2012-01-02  9:00       ` Anton Melser
2012-01-02 16:10         ` Lloyd Standish
2012-01-02 22:14           ` Anton Melser
2012-01-03  0:46             ` Lloyd Standish
2012-01-03  8:56               ` Anton Melser
2012-01-04 15:15                 ` Anton Melser
2012-01-05  7:37             ` Andrew Beverley
2012-01-02 18:01       ` Pete
2012-01-02 21:14         ` Anton Melser
2012-01-02 12:38 ` Ed W
2012-01-02 13:17   ` Anton Melser
2012-01-27 23:54     ` Ed W
2012-01-05  7:35 ` Andrew Beverley
2012-01-05  8:15   ` Anton Melser
2012-01-05 17:06     ` Andrew Beverley
2012-01-05 18:39     ` Rob Sterenborg (Lists)
2012-01-06  5:15       ` Anton Melser
2012-01-06  7:28         ` Andrew Beverley
2012-01-05  8:59 ` Rob Sterenborg (lists)
2012-01-05 11:59   ` Anton Melser
2012-01-05 13:17     ` Rob Sterenborg (lists) [this message]
2012-01-05 16:59     ` Andrew Beverley
2012-01-05 17:08       ` Rob Sterenborg (lists)
2012-01-05 17:14         ` Andrew Beverley

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=1325769456.2910.42.camel@ns014530.dcyb.net \
    --to=lists@sterenborg.info \
    --cc=netfilter@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).