Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: netfilter@vger.kernel.org
Subject: Re: simple port translation on the localhost / local loopback
Date: Sat, 29 Mar 2008 16:27:30 +0100	[thread overview]
Message-ID: <47EE5FE2.8070409@plouf.fr.eu.org> (raw)
In-Reply-To: <20080328141541.6BD98B850@sem.mel.teaser.net>

Noino a écrit :
> Pascal Hambourg wrote :
> 
>> I confirm. On 2.6 kernels < 2.6.11 and 2.4 kernels < 2.4.29 this 
>> option must be enabled in order to do local NAT on loopback.

Oops, dunno why I added "on loopback". Please ignore it.

> Merci, Pascal; that would explain why I had so little success...
> Stll, is there a way to achieve local port redirection without that 
> option set, maybe by combining DNAT, SNAT, REDIRECT in some astute way ?

AFAIK, not with Netfilter NAT. SNAT won't work on return packets.
But this is possible with userland relay daemons such as stone or socat, 
if the original port (i.e. UDP 53 here) is not used by another process. 
The drawback of this method is that it hides the original client address 
from the final server, but this is not an issue for loopback use.

> Does it make things easier if I arrange for Tor to listen on the IP 
> associated with the ethernet adapter rather than localhost ? Or even 
> listen on 0.0.0.0 ?

Not sure what you mean. Changing the address won't fix the UDP port 
reverse-translation issue.

      reply	other threads:[~2008-03-29 15:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27 21:16 simple port translation on the localhost / local loopback Noino
2008-03-27 23:17 ` Ryan Kruse
2008-03-28 10:21   ` Noino
2008-03-28 10:35 ` Pascal Hambourg
2008-03-28 14:15   ` Noino
2008-03-29 15:27     ` 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=47EE5FE2.8070409@plouf.fr.eu.org \
    --to=pascal.mail@plouf.fr.eu.org \
    --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