LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-23-2005, 08:15 AM   #1
Pastorino
Member
 
Registered: Jul 2004
Distribution: RHEL 6.2
Posts: 35

Rep: Reputation: 17
Blocked packets that should be accepted by iptables


Hi everyone,

I noticed that iptables is blocking a few packets that it should accept because they're ESTABLISHED,RELATED packets.

While researching for it, it seems that it is because of connection tracking.

For example: someone opens my web site, and iptables lets it all pass. But the person leaves the browser open for a long time. When he closes the browser, a packet is blocked... sometimes is an ACK FIN packet... sometimes is a FIN packet.... sometimes is a RST packet.

Is this normal? Does it compromise the connection from my customers? How long is the connection tracking timeout? (I mean, after how long does the connection tracking stops seeing the packet as an ESTABLISHED packet).

Thanks.
 
Old 09-23-2005, 09:43 AM   #2
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
Quote:
For example: someone opens my web site
Right there it is going to be a syn packet, initial state, not established. So I don't think the problem is with packet states. If you are hosting a website, it would be best to allow all port 80 packets to your web server, regardless of state.

Mainly you only want to worry about state on connections coming back in from a connection you initialized from your LAN.

I know this doesn't answer the question you asked, just my

Last edited by jonlake; 09-23-2005 at 09:45 AM.
 
Old 09-27-2005, 08:56 AM   #3
Pastorino
Member
 
Registered: Jul 2004
Distribution: RHEL 6.2
Posts: 35

Original Poster
Rep: Reputation: 17
My firewall is configured like this (showing only the important information, so I'm not showing destination, source, and protocol):

IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

IPTABLES -A INPUT --syn --dport http -j ACCEPT

IPTABLES -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

I don't think it's wise to open the port 80 regardless of state. I think it's more secure the way above.

I still need my original question answered, please. Anyone?

Thanks.

Last edited by Pastorino; 09-27-2005 at 08:57 AM.
 
Old 09-27-2005, 11:06 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
IIRC the kernel conntrack table flush is equiv of aprox 3 days (kernel headers), so I don't think there's a problem there. Locally and client-side set values like OS TCP connection timeout, daemon or browser session timeout or keepalives will probably time out much earlier. What you're probably seeing is an attempt by the clients OS to close the connection properly and has no effect on any by then already closed browsing session.
 
  


Reply



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
SMB blocked by iptables swmok Linux - Networking 0 01-06-2005 11:41 PM
How to check if packets/ports are being filtered/blocked mfeoli Linux - Networking 1 11-05-2004 05:27 AM
RH AS 3.2 External Packets Disappear but iptables show accepted jbriner Linux - Security 13 10-13-2004 03:34 PM
iptables permitting blocked traffic z3pp0 Linux - Security 7 08-24-2004 08:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:48 AM.

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