From: "Rob Sterenborg (Lists)" <lists@sterenborg.info>
To: 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 19:39:44 +0100 [thread overview]
Message-ID: <1325788784.2606.18.camel@kushiel.sterenborg.info> (raw)
In-Reply-To: <CAKywjPrGnmOg9Zh4T-VzCJHrhJ52s1jmBJsKq4R=D2viFZHmsA@mail.gmail.com>
On Thu, 2012-01-05 at 09:15 +0100, Anton Melser wrote:
> I was thinking that when the packets *arrive* on the router they could
> be marked for ToS or fwmark from their source IPs. The ToS or fwmark
You could mark them with a TOS value, but since (I understand that) you
want to NAT private subnets using 1600 public IP's, you'd need to be
able to check 1600 different TOS values otherwise I don't see how you
would be able to differentiate. That's not possible as the TOS field is
8 bit according to 'man iptables' (F15's 1.4.10, yes I have to look it
up too :-))..
There's also DSCP; the man page it has superseded TOS, and that there
can be 64 DSCP values (0-63), so that would also be a no-go AFAICS.
IIRC fwmark only exists on the localhost, not in the header of the IP
packet, so if I'm right then keep in mind that you can only use it at
the localhost. The man page says that the mark value is 32bits wide
which would make it usable here.
But I don't think all of this is going to help you.
> could then be used for routing decisions. On the surface of it there
> is no benefit - if you can use source address for routing decisions
> then why bother adding a step for marking? ToS and fwmark looked a
> little simpler in the examples, but I'm a noob, so don't really know!
> In any case, source IP seemed to be the best option, so it looks like
> you are confirming my original suspicions.
Since it seems you want to map private subnets to 1 public IP and do
that 1600 or so times, I don't see a way to do it easier then matching
the source address and SNAT it accordingly.
Yes, that would mean a lot of rules to create and maintain but I just
don't see any other way.
--
Rob
next prev parent reply other threads:[~2012-01-05 18:39 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) [this message]
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)
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=1325788784.2606.18.camel@kushiel.sterenborg.info \
--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).