Linux Netfilter discussions
 help / color / mirror / Atom feed
From: David Cannings <lists@edeca.net>
To: netfilter@lists.netfilter.org
Subject: Re: iptables dnat to loopback
Date: Sat, 7 Aug 2004 11:15:31 +0100	[thread overview]
Message-ID: <200408071115.31300.lists@edeca.net> (raw)
In-Reply-To: <D5C9032B2B09C64EA2409D6214E91AC905124D@asimail2.alphanumeric.com>

On Friday 06 August 2004 18:13, Jason Opperisano wrote:
> however, after some further testing--your original DNAT *should*
> work--the problem is probably somewhere in your filter rules.  i just
> tested this with a machine that has sendmail bound only to 127.0.0.1:
[..]
> note the inbound interface is "lo" and both the src and dst IP's are
> 127.0.0.1.  if you need to filter this kind of connection--make sure
> you specify a "-s x.x.x.x" in your DNAT rule.

Apologies if I am taking your mail seriously out of context, I missed the 
original mail.  In short, DNAT to 127/8 wont work unless both source and 
destination IPs are 127/8.  This is correct and is to do with the way the 
kernel filters "martians".

If you want to DNAT from an external interface to loopback, bind a private 
(RFC1918) address to loopback, then DNAT to that address.

For more, I posted the following a while back:

http://www.linuxarkivet.se/mlists/netfilter/0403/msg00770.html

The idea of binding an RFC1918 address to loopback to solve the issue was 
provided as a follow-up to that mail by somebody else.

David


  reply	other threads:[~2004-08-07 10:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-06 17:13 iptables dnat to loopback Jason Opperisano
2004-08-07 10:15 ` David Cannings [this message]
2004-08-08  6:17 ` Damian Gatabria
2004-08-08  8:41   ` David Cannings
2004-08-08 17:50     ` Alistair Tonner
2004-08-09 14:40       ` Damian Gatabria
2004-08-10  1:29         ` Damian Gatabria
  -- strict thread matches above, loose matches on Subject: below --
2004-08-06 12:48 Jason Opperisano
2004-08-06 11:38 Damian Gatabria
2004-08-06 11:54 ` Klemen Kecman

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=200408071115.31300.lists@edeca.net \
    --to=lists@edeca.net \
    --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