All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Bätzler" <t.baetzler@bringe.com>
To: netfilter@vger.kernel.org
Subject: Re: Weird nat/conntrack Problem with PASV FTP upload
Date: Fri, 06 Jun 2008 15:56:06 +0200	[thread overview]
Message-ID: <484941F6.9080701@bringe.com> (raw)
In-Reply-To: <4847F14D.5000806@trash.net>

Patrick McHardy wrote:
> I guess you're seeing INVALID packets (from the view of conntrack)
> and they're thus not NATed but delivered locally, causing a RST.
> Does dropping -m state --state INVALID packets in PREROUTING make
> any difference?

I've tried that for a day, to no avail:

(client)

000199 IP myclient.39268 > server.50857: . 3928342114:3928346458(4344) 
ack 716921888 win 46 <nop,nop,timestamp 491865886 41364954>
000197 IP myclient.39268 > server.50857: . 3928346458:3928348623(2165) 
ack 716921888 win 46 <nop,nop,timestamp 491865886 41364954>
214707 IP myclient.39268 > server.50857: . 3928162255:3928163703(1448) 
ack 716921888 win 46 <nop,nop,timestamp 491865908 41364954>
tcpdump: pcap_loop: truncated dump file; tried to read 66 captured 
bytes, only got 62
016181 IP server.50857 > myclient.39268: R 716921888:716921888(0) win 0

(natbox external)

000204 IP natbox.39268 > server.50857: . 3928342114:3928343562(1448) ack 
716921888 win 46 <nop,nop,timestamp 491865886 41364954>
000005 IP natbox.39268 > server.50857: . 3928343562:3928345010(1448) ack 
716921888 win 46 <nop,nop,timestamp 491865886 41364954>
000003 IP natbox.39268 > server.50857: . 3928345010:3928346458(1448) ack 
716921888 win 46 <nop,nop,timestamp 491865886 41364954>
000187 IP natbox.39268 > server.50857: . 3928346458:3928347906(1448) ack 
716921888 win 46 <nop,nop,timestamp 491865886 41364954>
000005 IP natbox.39268 > server.50857: . 3928347906:3928348623(717) ack 
716921888 win 46 <nop,nop,timestamp 491865886 41364954>
007712 IP server.50857 > natbox.39268: . ack 3928162255 win 1456 
<nop,nop,timestamp 41364957 491865884,nop,nop,sack 1 
{3928165151:3928165154}>
000011 IP natbox.39268 > server.50857: R 3928162255:3928162255(0) win 0
206983 IP natbox.39268 > server.50857: . 3928162255:3928163703(1448) ack 
716921888 win 46 <nop,nop,timestamp 491865908 41364954>
016041 IP server.50857 > natbox.39268: R 716921888:716921888(0) win 0

My nat rules currently look like this:

iptables -t nat -A PREROUTING -m state --state INVALID -j LOG
iptables -t nat -A PREROUTING -m state --state INVALID -j DROP
iptables -t nat -A POSTROUTING -s client -d server -p tcp -j SNAT 
--to-source natbox
iptables -t nat -A POSTROUTING -s clientnet/24 -o eth0 -j SNAT 
--to-source natbox-base

natbox is an ifalias on the external interface.

Any further ideas on how I could debug/fix this?

TIA,
Thomas

  reply	other threads:[~2008-06-06 13:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05  9:02 Weird nat/conntrack Problem with PASV FTP upload Thomas Bätzler
2008-06-05 13:59 ` Patrick McHardy
2008-06-06 13:56   ` Thomas Bätzler [this message]
2008-06-06 15:02     ` Patrick McHardy
2008-06-09  9:06       ` Jan Engelhardt
2008-06-09  9:09         ` Patrick McHardy
2008-06-09 12:38           ` Jan Engelhardt
  -- strict thread matches above, loose matches on Subject: below --
2008-06-09  8:58 Thomas Bätzler
2008-06-09  9:14 ` Jozsef Kadlecsik
2008-06-09 10:36 Thomas Bätzler
2008-06-09 11:21 ` Jozsef Kadlecsik
2008-06-09 12:35 Thomas Bätzler
2008-06-09 12:53 ` Jozsef Kadlecsik
2008-06-10  8:28 ` Jozsef Kadlecsik
2008-06-11  8:50   ` Thomas Bätzler
2008-06-23 10:49     ` Jozsef Kadlecsik
2008-06-23 13:46       ` Thomas Bätzler
2008-06-25  9:47       ` Thomas Bätzler
2008-06-25  9:50         ` Jozsef Kadlecsik
2008-06-23 12:50   ` Thomas Bätzler
2008-06-23 13:15     ` Jozsef Kadlecsik

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=484941F6.9080701@bringe.com \
    --to=t.baetzler@bringe.com \
    --cc=netfilter@vger.kernel.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.