Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Taner Halicioglu <taner@taner.net>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: netfilter@lists.netfilter.org
Subject: Re: Bug?  ICMPs sent by REJECT are not getting SNAT'd...
Date: Fri, 11 Apr 2003 09:48:01 -0700	[thread overview]
Message-ID: <20030411164801.GF5912@boom.net> (raw)
In-Reply-To: <Pine.LNX.4.33.0304110951310.31394-100000@blackhole.kfki.hu>

On Fri, Apr 11, 2003 at 09:55:49AM +0200, Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> wrote:

> > Hi, I have a somewhat convoluted setup, so I'll try to describe it.
> >
> > DSL provider gave me a /29 for my machines
> > 	(say, 200.1.1.0/29)
> > DSL provider also supplied a /30 to go between DSL modem and the DSLAM.
> > 	(say, 201.1.1.0/30 - irrelevant here, really)
> > I am using a random /30 to go between the DSL modem and my firewall
> > 	(say, 10.1.1.0/30)
> > [...]
> > I soon realised that since I'm using a non-routed address for the "outside"
> > interface of the firewall, I run into issues trying to initiate any
> > connection from the fw machine, so I added:
> >
> >  iptables -t nat -A POSTROUTING -o eth1 -s 10.1.1.1 -j SNAT --to-source 200.1.1.1
> >
> > This works for 99% of the traffic sourced on the firewall machine, it seems.
> >
> > One thing it DOES NOT work for, is the ICMP (and probably RST - didn't try)
> > packets that are generated by the REJECT target.  These get sourced from the
> > unroutable address, and since my ISP wisely filters things like that, the
> > ICMP never makes it to the sender.
> 
> If I understand your setup and the problem correctly, you mean that you
> REJECT requests targeted to the firewall itself and the reject packets
> contain the private address of the firewall as source address.
> 
> But how packets can reach the private address of your firewall?

No, the problem is that when the firewall machine REJECTs any packets in a
FORWARD chain (ie, anything I am blocking that is destined to the network
behind it), the source IP of the ICMP UNREACH (or evn the RST packets) is
that of the *outside* interface - the unroutable address.  It seems the
POSTROUTING is not performed on the ICMPs that are created by the actual
host.

Is there any way around this?

	-T


  reply	other threads:[~2003-04-11 16:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-02  8:06 Bug? ICMPs sent by REJECT are not getting SNAT'd Taner Halicioglu
2003-04-02 18:38 ` Taner Halicioglu
2003-04-11  7:55 ` Jozsef Kadlecsik
2003-04-11 16:48   ` Taner Halicioglu [this message]
2003-04-11 18:58     ` Jozsef Kadlecsik
2003-04-11 19:08       ` Taner Halicioglu
2003-04-15 22:37         ` Taner Halicioglu
  -- strict thread matches above, loose matches on Subject: below --
2003-04-02  8:03 Taner Halicioglu

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=20030411164801.GF5912@boom.net \
    --to=taner@taner.net \
    --cc=kadlec@blackhole.kfki.hu \
    --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