All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marius Mertens" <marius.mertens@gmx.de>
To: netfilter@lists.netfilter.org
Subject: Re: Packets that should have been DNATted appearing in INPUT table
Date: Tue, 11 Jan 2005 19:15:27 +0100	[thread overview]
Message-ID: <008901c4f809$87cd7680$4206a8c0@loki> (raw)
In-Reply-To: 20050111162914.GA14045@bender.817west.com

On Tuesday, January 11, 2005 5:29 PM,
Jason Opperisano wrote:

> all the packets that were part of the established connections in step
> 2 will no longer have a conntrack entry that ties them to the DNAT,
> and they will end up in INPUT and get dropped.

Thats a very interesting theory! I would never have thought of that myself. 
And you are right, I actually do restart my firewall quite often during 
testing phase. There are just 2 things still preventing me from being 
completely happy:
1) The drops still happen after running the firewall for several hours. Its 
just a feeling, but isn't that a very long time for a tcp connection?
2) When I take a look at /proc/net/ip_conntrack it does not empty when 
restarting the firewall, so I thought, existing connections should go 
unharmed.

Maybe I looked in the wrong places, but are there detailed information about 
how DNAT works internally (apart from reading the sources ;-))?

Something I could also imagine, is that those 
somehow-not-handled-as-i-expected-packets are just bogus packets not 
belonging to any connection. In that case, namely that these packages are of 
no use anyhow (and that they would have been dropped at the target box, 
because of not belonging to any existing connection or initialising a new 
connection themselves), it would be perfectly correct to drop them at the 
router.
But there are still things, I do not understand, if thats the case:
Reverting to my mostly favourite game (comparing counters) I noticed the 
following:

Chain PREROUTING (policy ACCEPT 646K packets, 32M bytes)
 pkts bytes target     prot opt in     out     source 
destination
    0     0 LOG        tcp  --  ppp0   *       0.0.0.0/0 
0.0.0.0/0           tcp dpt:4664 state INVALID LOG flags 0 level 6 prefix 
`SUSPICIOUS: '
  582 31900 LOG        tcp  --  ppp0   *       0.0.0.0/0 
0.0.0.0/0           tcp dpt:4664 LOG flags 0 level 6 prefix `NORMAL: '
  582 31900 DNAT       tcp  --  ppp0   *       0.0.0.0/0 
0.0.0.0/0           tcp dpt:4664 to:192.168.6.10
    0     0 LOG        tcp  --  ppp0   *       0.0.0.0/0 
0.0.0.0/0           tcp dpt:4664 LOG flags 0 level 6 prefix `SUSPICIOUS: '

For me it looks perfectly normal and like should-be-working. But in INPUT 
the drops are still there:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source 
destination
   22  1096 DROP       tcp  --  ppp0   *       0.0.0.0/0 
0.0.0.0/0           tcp dpt:4664

I also noticed that the LOG rule in nat PREROUTING has far less matches 
counted than the same LOG rule in mangle PREROUTING.

Perhaps you can tell me, whether I am right if i think that either
1) The critical packets have matched DNAT but somehow DNAT thought that it 
should not alter the destination and rather direct it to INPUT
2) The critical packets have never even entered nat PREROUTING (seems 
probable, but I have no proof)

Unfortunately, even if either of the two cases really happens, I still don't 
have any explanation, why it does...

Thank you very much,

Marius 



  reply	other threads:[~2005-01-11 18:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-05 18:00 Packets that should have been DNATted appearing in INPUT table Marius Mertens
2005-01-06 15:55 ` Jason Opperisano
2005-01-06 16:49   ` Marius Mertens
2005-01-07 20:08     ` Michael Gale
2005-01-08  0:43       ` Marius Mertens
2005-01-11  0:27         ` R. DuFresne
2005-01-11 15:03           ` Marius Mertens
2005-01-11 16:29             ` Jason Opperisano
2005-01-11 18:15               ` Marius Mertens [this message]
2005-01-11 18:16               ` R. DuFresne
2005-01-11 18:33                 ` Marius Mertens

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='008901c4f809$87cd7680$4206a8c0@loki' \
    --to=marius.mertens@gmx.de \
    --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.