All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Pisar <petr.pisar@atlas.cz>
To: netfilter@lists.netfilter.org
Subject: Re: Obtain original address from redirected connection
Date: Tue, 02 May 2006 08:36:35 +0200	[thread overview]
Message-ID: <e36ulj$omu$1@sea.gmane.org> (raw)
In-Reply-To: <20060502025450.73457687.pedro.werneck@terra.com.br>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pedro Werneck wrote:
> I have a daemon, a sort of proxy, written in Python, who receives
> redirected connections with a rule like this:
> 
> iptables -t nat -A PREROUTING -j DNAT -p TCP -s source --to-destination host:port
> 
> The problem is that I need access to the original destination address,
> but I could not find a way to do that when I wrote the daemon.
[...]
> Is it possible to do this with SO_ORIGINAL_DST, or is there any other
> approach for obtaining the original address ?
> 

SO_ORIGINAL_DST works only on local REDIRECT. If you do NAT and run
proxy on the same machine use REDIRECT instead. Otherwise you need an
silly side channel for delivering original address. (Maybe create IP
tunnel betwean NATing machine and proxy machine and then REDIRECT this
traffic on proxy machine.)

- -- Petr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEVv3zuR4f4nEwzHIRArLeAKCAKSVvmKaQCe/pE5HDeHFc/Vw0swCfdy9Q
t8czUPh+btwIf1dEGKlp9/M=
=TbTl
-----END PGP SIGNATURE-----



  reply	other threads:[~2006-05-02  6:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-02  5:54 Obtain original address from redirected connection Pedro Werneck
2006-05-02  6:36 ` Petr Pisar [this message]
2006-05-04 18:51 ` Pascal Hambourg

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='e36ulj$omu$1@sea.gmane.org' \
    --to=petr.pisar@atlas.cz \
    --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 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.