All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: netfilter@lists.netfilter.org
Subject: Re: Obtain original address from redirected connection
Date: Thu, 04 May 2006 20:51:24 +0200	[thread overview]
Message-ID: <445A4D2C.1000001@plouf.fr.eu.org> (raw)
In-Reply-To: <20060502025450.73457687.pedro.werneck@terra.com.br>

[Sorry for the late answer, I just subscribed to the list]

Hello,

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,

You can parse /proc/net/ip_conntrack on the NAT box, which contains the 
  list of the connections currently handled by conntrack/NAT. This is 
how Squid retrieves the original destination address when running in 
transparent mode.
Note : on "recent" kernels you need root privileges to read this file.


      parent reply	other threads:[~2006-05-04 18:51 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
2006-05-04 18:51 ` Pascal Hambourg [this message]

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=445A4D2C.1000001@plouf.fr.eu.org \
    --to=pascal.mail@plouf.fr.eu.org \
    --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.