LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-11-2008, 01:09 PM   #1
Jinkzer
LQ Newbie
 
Registered: Jun 2003
Location: Stockholm Sweden
Distribution: Gentoo, Slackaware, Flux, KDE
Posts: 20

Rep: Reputation: 0
Iptables is dropping accepted packages


We have run into some strange problem with one of our servers. The server software is listening on TCP port 4100 for connections from other servers sending data. Everything works fine for some time (minutes to hours) but suddenly iptables start blocking packages destinated for port 4100. This generates a great loss of data and corrupt db. Strange thing here is that while one server getting drops another server succesfully connects to the port. Is there something we missing in the configuration?

Server is running RedHat ES 4 (Update 5)
/etc/sysconfig/iptables

Code:
Generated by iptables-save v1.2.11 on Wed Feb  6 10:19:58 2008
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [470:56680]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 4100 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 4200 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 4400 -j ACCEPT
-A RH-Firewall-1-INPUT -m limit --limit 1/sec -j LOG --log-prefix "Dropped by firewall: "
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Wed Feb  6 10:19:58 2008
Code:
/var/log/messages
Mar 11 15:00:42 DBSERV kernel: Dropped by firewall: IN=bond0 OUT= MAC=00:1c:c4:59:09:da:00:30:18:4a:36:5a:08:00 SRC=172.21.221.98 DST=172.21.221.65 LEN=64 TOS=0x00 PREC=0x00 TTL=62 ID=43380 DF PROTO=TCP SPT=32884 DPT=4100 WINDOW=8420 RES=0x00 ACK URGP=0
Mar 11 15:00:43 DBSERV kernel: Dropped by firewall: IN=bond0 OUT= MAC=00:1c:c4:59:09:da:00:30:18:4a:36:5a:08:00 SRC=172.21.221.98 DST=172.21.221.65 LEN=64 TOS=0x00 PREC=0x00 TTL=62 ID=43382 DF PROTO=TCP SPT=32884 DPT=4100 WINDOW=8420 RES=0x00 ACK URGP=0
Mar 11 15:00:44 DBSERV kernel: Dropped by firewall: IN=bond0 OUT= MAC=00:1c:c4:59:09:da:00:30:18:4a:36:5a:08:00 SRC=172.21.221.98 DST=172.21.221.65 LEN=64 TOS=0x00 PREC=0x00 TTL=62 ID=43384 DF PROTO=TCP SPT=32884 DPT=4100 WINDOW=8420 RES=0x00 ACK URGP=0
Mar 11 15:00:45 DBSERV kernel: Dropped by firewall: IN=bond0 OUT= MAC=00:1c:c4:59:09:da:00:30:18:4a:36:5a:08:00 SRC=172.21.221.98 DST=172.21.221.65 LEN=191 TOS=0x00 PREC=0x00 TTL=62 ID=43386 DF PROTO=TCP SPT=32884 DPT=4100 WINDOW=8420 RES=0x00 ACK PSH URGP=0
Mar 11 15:00:45 DBSERV kernel: Dropped by firewall: IN=bond0 OUT= MAC=00:1c:c4:59:09:da:00:30:18:4a:36:5a:08:00 SRC=172.21.221.98 DST=172.21.221.65 LEN=191 TOS=0x00 PREC=0x00 TTL=62 ID=43388 DF PROTO=TCP SPT=32884 DPT=4100 WINDOW=8420 RES=0x00 ACK PSH URGP=0
Mar 11 15:00:45 DBSERV kernel: Dropped by firewall: IN=bond0 OUT= MAC=00:1c:c4:59:09:da:00:30:18:4a:36:5a:08:00 SRC=172.21.221.98 DST=172.21.221.65 LEN=64 TOS=0x00 PREC=0x00 TTL=62 ID=43390 DF PROTO=TCP SPT=32884 DPT=4100 WINDOW=8420 RES=0x00 ACK URGP=0
Mar 11 15:00:46 DBSERV kernel: Dropped by firewall: IN=bond0 OUT= MAC=00:1c:c4:59:09:da:00:30:18:4a:36:5a:08:00 SRC=172.21.221.98 DST=172.21.221.65 LEN=191 TOS=0x00 PREC=0x00 TTL=62 ID=43392 DF PROTO=TCP SPT=32884 DPT=4100 WINDOW=8420 RES=0x00 ACK PSH URGP=0
Mar 11 15:00:47 DBSERV kernel: Dropped by firewall: IN=bond0 OUT= MAC=00:1c:c4:59:09:da:00:30:18:4a:36:5a:08:00 SRC=172.21.221.98 DST=172.21.221.65 LEN=191 TOS=0x00 PREC=0x00 TTL=62 ID=43394 DF PROTO=TCP SPT=32884 DPT=4100 WINDOW=8420 RES=0x00 ACK PSH URGP=0

And so on...
Any ideas are much appriciated.
 
Old 03-11-2008, 02:38 PM   #2
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
Try this

Code:
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW,INVALID -m tcp --dport 4100 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW,INVALID -m tcp --dport 4200 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW,INVALID -m tcp --dport 4400 -j ACCEPT
But that shouldn't have dropped packets from an existing connection state.

Can you try removing the limit for a bit and see if the problem persists
 
Old 03-11-2008, 02:53 PM   #3
Jinkzer
LQ Newbie
 
Registered: Jun 2003
Location: Stockholm Sweden
Distribution: Gentoo, Slackaware, Flux, KDE
Posts: 20

Original Poster
Rep: Reputation: 0
Hi x_terminat_or_3,

I'll give it a shot tomorrow when I have access to the server, Im not sure what state the connection is when we get the drops, from the connecting (or connected) application I get a "connection error" in the log. Not always but the error might come say once or twice a day whith the drops above. In between the errors everything seems to work fine.

In total we have 3 network cards in the server, 2 of them are in a bonding (master/slave) configuration, not sure if this could have something to do with anything, we don't see anything in logs that interfaces have any errors.

Get back tomorrow with the results.
 
Old 03-13-2008, 09:15 AM   #4
Deleriux
Member
 
Registered: Nov 2003
Posts: 89

Rep: Reputation: 17
You might want to consider checking sar around about the same time to see what kind of memory was being used on the server and/or what kind of load the server was using.

Im banking on some packets getting put into INVALID as a state.
 
  


Reply

Tags
iptables



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables dansguardian and squid - dropping URL jlw253 Linux - Security 5 07-22-2007 03:29 PM
iptables command to revert to dropping after an app closes? conn-fused Linux - Security 3 02-24-2007 12:07 AM
iptables - dropping an ip *range* chibi Linux - Security 6 12-17-2005 08:22 PM
Blocked packets that should be accepted by iptables Pastorino Linux - Security 3 09-27-2005 11:06 AM
RH AS 3.2 External Packets Disappear but iptables show accepted jbriner Linux - Security 13 10-13-2004 03:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration