All of lore.kernel.org
 help / color / mirror / Atom feed
* It seems I've found why conntrack blocks some packets
@ 2006-03-29 13:45 Carlos Pastorino
  2006-03-29 13:52 ` Steven M Campbell
  0 siblings, 1 reply; 16+ messages in thread
From: Carlos Pastorino @ 2006-03-29 13:45 UTC (permalink / raw)
  To: netfilter

Hi everyone,

I always wondered why conntrack blocked some packets that were
supposed to pass through my ESTABLISHED,RELATED rule. Now it seems
that I've found the answer.

Bear with me, because there will be questions in the end.

So, what happens is: from time to time, I see my firewall blocking a
packet like this:

Mar 28 14:48:21 SRVA kernel: FORWARD blocked: IN=eth1 OUT=eth0
SRC=webserverip DST=customerip LEN=48 TOS=0x00 PREC=0x00 TTL=63 ID=0
DF PROTO=TCP SPT=80 DPT=10458 WINDOW=5840 RES=0x00 ACK SYN URGP=0

Well, it does call my attention because it's a blocked packet FROM my
webserver. In any case, it shouldn't be blocked, because the
connection is not even 2 minutes old.

But, on the webserver, I was running tcpdump this time, so I could see
what really happened:

14:46:47.573738 customerip.10458 > webserverip.80: S [tcp sum ok]
23512000:23512000(0) win 65535 <mss 1460,nop,nop,sackOK> (DF) (ttl
120, id 41065, len 48)
14:46:47.573747 webserverip.80 > customerip.10458: S [tcp sum ok]
4131634297:4131634297(0) ack 23512001 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:46:51.327629 webserverip.80 > customerip.10458: S [tcp sum ok]
4131634297:4131634297(0) ack 23512001 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:46:57.327623 webserverip.80 > customerip.10458: S [tcp sum ok]
4131634297:4131634297(0) ack 23512001 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:47:09.327609 webserverip.80 > customerip.10458: S [tcp sum ok]
4131634297:4131634297(0) ack 23512001 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:47:33.527575 webserverip.80 > customerip.10458: S [tcp sum ok]
4131634297:4131634297(0) ack 23512001 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:47:34.216642 customerip.10458 > webserverip.80: R [tcp sum ok]
0:0(0) ack 0 win 0 (ttl 26, id 1, len 40)
14:48:21.727515 webserverip.80 > customerip.10458: S [tcp sum ok]
4131634297:4131634297(0) ack 23512001 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)

As you can see, the customer connected with a SYN packet, and my
webserver responded with 6 ACK/SYN packets. BUT, before the 6th
ACK/SYN response, the customer sent an ACK/RST packet, resetting the
connection, and thus the 6th ACK/SYN packet was blocked by the
firewall because the connection was no longer in the conntrack. Yes,
clocks in the firewall and webserver are synchronized.

Questions are:

1) Does anyone have seen this happening too?

2) How can I silently drop that package, without compromising the on
going connections? I would like to get rid of those "false positives".

Thanks,

Carlos


^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: It seems I've found why conntrack blocks some packets
@ 2006-03-30  5:13 Gary W. Smith
  2006-03-30 14:01 ` Carlos Pastorino
  0 siblings, 1 reply; 16+ messages in thread
From: Gary W. Smith @ 2006-03-30  5:13 UTC (permalink / raw)
  To: Carlos Pastorino, Steven M Campbell; +Cc: netfilter

Are you by chance doing any rate limiting actions in your firewall or on
your box?  Is there any type of balanced connection in place?  Port
rewrites, etc?


-----Original Message-----
From: netfilter-bounces@lists.netfilter.org
[mailto:netfilter-bounces@lists.netfilter.org] On Behalf Of Carlos
Pastorino
Sent: Wednesday, March 29, 2006 9:06 PM
To: Steven M Campbell
Cc: netfilter@lists.netfilter.org
Subject: Re: It seems I've found why conntrack blocks some packets


The test showed that blocking pop-ups does not generate the desired
behavior, because the 3-way handshake completes normally, even for the
blocked pop-up.

So I dug a little deeper. I checked other connections from the same
customer, that were also around the same time. They didn't caught my
attention before because there were no packets blocked FROM the
webserver. The problem is, this shows that the problem can be in my
firewall after all. Here are the connections.

First, the blocked packets on the firewall:

Mar 28 14:46:50 SRVA kernel: FORWARD blocked: IN=eth0 OUT=eth1
SRC=customerip DST=webserverip LEN=40 TOS=0x00 PREC=0x00 TTL=26 ID=1
PROTO=TCP SPT=2184 DPT=80 WINDOW=0 RES=0x00 ACK URGP=0
Mar 28 14:46:56 SRVA kernel: FORWARD blocked: IN=eth0 OUT=eth1
SRC=customerip DST=webserverip LEN=40 TOS=0x00 PREC=0x00 TTL=26 ID=1
PROTO=TCP SPT=2184 DPT=80 WINDOW=0 RES=0x00 ACK URGP=0
Mar 28 14:47:08 SRVA kernel: FORWARD blocked: IN=eth0 OUT=eth1
SRC=customerip DST=webserverip LEN=40 TOS=0x00 PREC=0x00 TTL=26 ID=1
PROTO=TCP SPT=2184 DPT=80 WINDOW=0 RES=0x00 ACK URGP=0
Mar 28 14:47:32 SRVA kernel: FORWARD blocked: IN=eth0 OUT=eth1
SRC=customerip DST=webserverip LEN=40 TOS=0x00 PREC=0x00 TTL=26 ID=1
PROTO=TCP SPT=2184 DPT=80 WINDOW=0 RES=0x00 ACK URGP=0
Mar 28 14:48:20 SRVA kernel: FORWARD blocked: IN=eth0 OUT=eth1
SRC=customerip DST=webserverip LEN=40 TOS=0x00 PREC=0x00 TTL=26 ID=1
PROTO=TCP SPT=2184 DPT=80 WINDOW=0 RES=0x00 ACK URGP=0
Mar 28 14:57:34 SRVA kernel: FORWARD blocked: IN=eth0 OUT=eth1
SRC=customerip DST=webserverip LEN=40 TOS=0x00 PREC=0x00 TTL=26 ID=1
PROTO=TCP SPT=2184 DPT=80 WINDOW=0 RES=0x00 ACK RST URGP=0

and now the tcpdump on the webserver:

14:46:46.153552 customerip.2184 > webserverip.80: S [tcp sum ok]
290916053:290916053(0) win 65535 <mss 1460,nop,nop,sackOK> (DF) (ttl
120, id 41051, len 48)
14:46:46.153561 webserverip.80 > customerip.2184: S [tcp sum ok]
4139392508:4139392508(0) ack 290916054 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:46:50.527630 webserverip.80 > customerip.2184: S [tcp sum ok]
4139392508:4139392508(0) ack 290916054 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:46:56.527621 webserverip.80 > customerip.2184: S [tcp sum ok]
4139392508:4139392508(0) ack 290916054 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:47:08.527607 webserverip.80 > customerip.2184: S [tcp sum ok]
4139392508:4139392508(0) ack 290916054 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:47:32.727574 webserverip.80 > customerip.2184: S [tcp sum ok]
4139392508:4139392508(0) ack 290916054 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)
14:48:20.927521 webserverip.80 > customerip.2184: S [tcp sum ok]
4139392508:4139392508(0) ack 290916054 win 5840 <mss
1460,nop,nop,sackOK> (DF) (ttl 64, id 0, len 48)

As you can see, here even the ACKs that were supposed to complete the
3-way handshake are getting blocked.

What could possibly be the reason for this?

Regards,

Carlos



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

end of thread, other threads:[~2006-04-06 18:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-29 13:45 It seems I've found why conntrack blocks some packets Carlos Pastorino
2006-03-29 13:52 ` Steven M Campbell
2006-03-29 15:11   ` Roger Hamilton
2006-03-29 15:17     ` Steven M Campbell
2006-03-29 18:04       ` Carlos Pastorino
2006-03-30  5:05         ` Carlos Pastorino
  -- strict thread matches above, loose matches on Subject: below --
2006-03-30  5:13 Gary W. Smith
2006-03-30 14:01 ` Carlos Pastorino
2006-03-31 13:20   ` Steven M Campbell
2006-03-31 13:43     ` Steven M Campbell
2006-04-01 20:59       ` Carlos Pastorino
2006-04-02  4:08         ` Steven M Campbell
2006-04-04 12:36           ` Carlos Pastorino
2006-04-05 14:55             ` Steven M Campbell
2006-04-06 18:33               ` Carlos Pastorino
2006-04-01 20:46     ` Carlos Pastorino

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.