From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: SNAT matching question
Date: Sun, 29 Sep 2002 18:18:02 +0100 [thread overview]
Message-ID: <20020929171804.GPIU2092.mta07-svc.ntlworld.com@there> (raw)
In-Reply-To: <Pine.GSO.4.44L-027.0209291259220.1180-100000@unix4.andrew.cmu.edu>
On Sunday 29 September 2002 6:09 pm, Mohan Khurana wrote:
> On Sun, 29 Sep 2002, Antony Stone wrote:
> > Reply packets should not be a problem unless your ISPs block packets with
> > source addresses which don't match the network range you have from them.
>
> This is also true, but what if they do block? I was hoping there was a
> way to maintain connection tracking such that if there is a machine on the
> internet that connects to an internally hosted server, it would maintain
> the incoming gateway and interface, and then ensure that the equalize
> command would ensure that the outgoing packet going to the right gateway.
I do not know enough about equalise-routing to know how to do this.
> Lets say some internet machine contact my webserver, which happens to be
> at 1.2.3.33. It would come in on 1.2.3.4. Now the webserver needs to
> send IP packets back out to the internet, so it does a routing table
> lookup. Because ISP1 would block ISP2 traffic and vice-versa, if the
> selected gateway (as a result of the equalize statement above) is 5.6.7.8,
> then the only way to get that IP packet out would be to NAT it on an IP
> from ISP2. Post-NAT, this would change the source field of the IP packet,
> and break communication (the machine on the internet wanted a source of
> 1.2.3.33).
Correct. If that happened, the communication would break.
> I think the solution is for incoming packets destined to servers marked as
> state NEW to have their gateway and source address placed in a table.
> When 1.2.3.33 wants to go out, the equalize flag should look up the table,
> see if the destination host is in there, and if it is, it should return
> the proper corresponding gateway.
If you can implement such a table then yes I agree this system should work.
There is an alternative, and that is to run your web server with two private
IP addresses, and have the public address from ISP 1 translate to private IP
1, and the public address from ISP 2 translate to private IP 2. The web
server is configured to provide precisely the same content for either IP
address.
If you do that, then the web server will reply from the same source address
as the original request used for its destination address, and you can use
source-based routing in iproute2 to make sure that replies from private IP 1
always go via ISP 1, and replies from private IP 2 always go via ISP 2.
Antony.
--
Normal people think "if it ain't broke, don't fix it".
Engineers think "if it ain't broke, it doesn't have enough features yet".
next prev parent reply other threads:[~2002-09-29 17:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-29 13:30 SNAT matching question Mohan Khurana
2002-09-29 13:53 ` Antony Stone
2002-09-29 14:15 ` Mohan Khurana
2002-09-29 15:12 ` Antony Stone
2002-09-29 16:26 ` Mohan Khurana
2002-09-29 16:46 ` Antony Stone
2002-09-29 17:09 ` Mohan Khurana
2002-09-29 17:18 ` Antony Stone [this message]
2002-09-29 18:43 ` Mitesh P Choksi
2002-09-30 8:27 ` Nobody can help me ??? :( Hanz F.
2002-09-30 8:49 ` Nick
2002-09-30 9:30 ` Gaël Le Mignot
2002-09-30 15:01 ` Hanz F.
2002-09-30 16:53 ` Gaël Le Mignot
2002-09-30 9:54 ` Michael
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=20020929171804.GPIU2092.mta07-svc.ntlworld.com@there \
--to=antony@soft-solutions.co.uk \
--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