Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Marius Mertens" <marius.mertens@gmx.de>
To: netfilter@lists.netfilter.org
Subject: Packets that should have been DNATted appearing in INPUT table
Date: Wed, 5 Jan 2005 19:00:40 +0100	[thread overview]
Message-ID: <000901c4f350$7b3d1370$4206a8c0@loki> (raw)

Hi everybody,

first of all, please cc me in your answer as I am not a subscriber of this 
list.
I have a problem in understanding how the packet flow really works, as my 
setup is not completely working as expected.
I want to redirect all traffic coming from the internet to (for example) 
port 4664 to the same port on a box in my LAN and I use the following rule 
to accomplish this:
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 4664 -j DNAT --to 
192.168.6.10
From what I read, I thought that with this rule packets go to PREROUTING, 
get their new destination and then through FORWARD and POSTROUTING right to 
eth0 and out to my LAN.
The only thing I have in my POSTROUTING is
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.6.0/24 -j MASQUERADE
What I find really weird is that the packet counter of
iptables -A INPUT -i ppp0 -p tcp --dport 4664 -j DROP
is not zero, in fact the value is growing and about 10% of the number of 
packets successfully redirected to the other box in my LAN.
An example of a packet which should have been redirected but was logged in 
the INPUT chain is
IN=ppp0 OUT= MAC= SRC=217.30.133.213 DST=217.225.50.178 LEN=40 TOS=0x00 
PREC=0x00 TTL=120 ID=5272 DF PROTO=TCP SPT=2214 DPT=4664 WINDOW=10094 
RES=0x00 ACK FIN URGP=0
DST correctly shows my internet IP, but I thought that it should have been 
replaced with 192.168.6.10 in PREROUTING...
Now my questions are: Is there something I misunderstood with packet flow? 
Or should it be OK in theory and I screwed something up during 
implementation?
And finally: How do I get it to work in a way, that really every single 
packet coming in for a specific port on a specific interface is redirected 
to another host?

Thank you very much,

Marius 



             reply	other threads:[~2005-01-05 18:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-05 18:00 Marius Mertens [this message]
2005-01-06 15:55 ` Packets that should have been DNATted appearing in INPUT table 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
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='000901c4f350$7b3d1370$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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox