Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Adam Rosi-Kessel <adam@rosi-kessel.org>
To: "curby ." <curby.public@gmail.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Transparent proxy where source IP address remains unchanged -- possible?
Date: Fri, 12 Aug 2005 14:52:18 -0400	[thread overview]
Message-ID: <42FCEFE2.2030509@rosi-kessel.org> (raw)
In-Reply-To: <5d2f379105081211357e8d558a@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]

Thanks for your response:

curby . wrote:
>> iptables -t nat -A PREROUTING -i eth0 -s 10.1.1.2 -d 10.1.1.3 \
>>         -p tcp --dport ssh -j DNAT --to 192.168.98.4
> In your hypothetical above, all three hosts were on the same subnet. 
> If in fact your realtarget is on another subnet (as it is in this
> command), then all you need is DNAT and your source address/port will
> be kept.  If all three hosts are on the same network, or the source
> and realtarget are on the same network, then you will need a SNAT rule
> as shown here:

In reality, userbox, faketarget, and realtarget, are all on different
subnets.

> A single line to DNAT is all that should be necessary for DNAT between
> different subnets (as long as your FORWARD chain allows it).  SNAT is
> definitely not required to get it to work.  If it doesn't work, likely
> you have a bad setup somewhere.  HOWTO might help:

Based on other messages in this thread, it appears that the problem is
that reply packets are going directly back to userbox rather than
through faketarget and thus are being dropped.  I guess the proxy needs
to go both ways, but also be invisible. This is what I'm having trouble
figuring out.

>> Is this possible?  Am I asking the wrong question?
> You didn't say why you're doing this, or what else your firewall setup
> has.  If it's for auditing/eavesdropping, there are certainly other
> ways to do it.  If all three hosts are on the same network, the client
> could simply go directly to realserver.

The main purpose is to facility relocation of a server to a new subnet
with zero downtime while DNS changes propagate. Any client that is still
getting the old IP address should be transparently routed to the new one.
-- 
Adam Rosi-Kessel
http://adam.rosi-kessel.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2005-08-12 18:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-10 15:22 Transparent proxy where source IP address remains unchanged -- possible? Adam Rosi-Kessel
2005-08-12 18:35 ` curby .
2005-08-12 18:52   ` Adam Rosi-Kessel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-08-12 15:21 Gielen, Casper
2005-08-09  1:29 Adam Rosi-Kessel
2005-08-11  5:42 ` Jan Engelhardt
2005-08-11 13:07   ` Adam Rosi-Kessel
2005-08-11 19:17     ` Jan Engelhardt
2005-08-11 20:47       ` Adam Rosi-Kessel
2005-08-12  5:02         ` Grant Taylor
2005-08-12 13:07           ` Adam Rosi-Kessel
2005-08-13  6:40             ` Grant Taylor
2005-08-13 13:12               ` Adam Rosi-Kessel
2005-08-15  6:51                 ` Grant Taylor
2005-08-15 14:33                   ` Adam Rosi-Kessel
2005-08-15 14:39                     ` Taylor, Grant
2005-08-17 21:07     ` Ray Van Dolson
2005-08-19  3:16       ` Adam Rosi-Kessel

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=42FCEFE2.2030509@rosi-kessel.org \
    --to=adam@rosi-kessel.org \
    --cc=curby.public@gmail.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