All of lore.kernel.org
 help / color / mirror / Atom feed
* Packets that should have been DNATted appearing in INPUT table
@ 2005-01-05 18:00 Marius Mertens
  2005-01-06 15:55 ` Jason Opperisano
  0 siblings, 1 reply; 11+ messages in thread
From: Marius Mertens @ 2005-01-05 18:00 UTC (permalink / raw)
  To: netfilter

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 



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-01-11 18:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2005-01-11 18:16               ` R. DuFresne
2005-01-11 18:33                 ` Marius Mertens

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.