LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-08-2002, 03:42 PM   #1
ryanstrayer
Member
 
Registered: Jan 2002
Location: Kansas City
Distribution: RedHat 7.2 Kernel 2.4.17
Posts: 250

Rep: Reputation: 30
Exclamation IPTables 1.2.5 Problem


I seem to be having a problem with the command line or program. I'm using iptables v1.2.5. I'm trying to use stateful packet insepection on outgoing packets. For example, if I tried to create a rule for port 80 outbound, here is an *example* what I've been entering:

iptables -m state -A OUTPUT -j ACCEPT -p tcp -s 0.0.0.0/0 -d 0.0.0.0/0 --dport 80 --state ESTABLISHED

My problem is, it doesn't seem to be opening the same ports for return traffic. I've tried not only ESTABLISHED, but NEW and RELATED, both seperate and in combinations, with the same result.

I have all the appropriate kernel modules configured and they are loading (e.g., ip_tables, ip_conntrack, ipt_state, etc.) It doesn't work for any port than I can find... DNS, HTTP, FTP .. nothing.

Can anyone give me an idea as to why this doesn't work?


Last edited by ryanstrayer; 02-08-2002 at 08:41 PM.
 
Old 02-13-2002, 10:44 AM   #2
raz
Member
 
Registered: Apr 2001
Location: London
Posts: 408

Rep: Reputation: 31
Try:


/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
iptables -A INPUT -p tcp -m state --state ESTABLISHED -s 0/0 --sport 80 -d your_firewalls_ip --dport 1024:65535 -j ACCEPT
iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -s 0/0 --sport 1024:65535 -d 0/0 --sport 80 -j ACCEPT
iptables -A INPUT -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p udp -m state --state NEW -j ACCEPT

from manpage:

--state state
Where state is a comma separated list of the connection states to match. Possible states are INVALID meaning that the packet is associated with no known connection, ESTABLISHED meaning that the packet is associated with a connection which has seen packets in both directions, NEW meaning that the packet has started a new con*nection, or otherwise associated with a connection which has not seen packets in both directions, and RELATED meaning that the packet is starting a new connection, but is associated with an existing connection, such as an FTP data transfer, or an ICMP error.


/raz
 
  


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
An error occured getting IPtables status from the command /etc/rc.d/init.d/iptables s CrazyMAzeY Linux - Newbie 10 08-12-2010 05:25 AM
iptables command/iptables GUI? basketkase999 Linux - Security 5 04-12-2005 02:43 PM
Is iptables/netfilter stateful inspection firewall ? newbieA Linux - Security 3 02-11-2005 08:32 PM
Is router plus stateful firewall enough? jxi Linux - Security 3 10-04-2003 08:22 AM
stateful packet inspection estranged0877 Linux - Security 1 01-28-2003 06:05 PM

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

All times are GMT -5. The time now is 02:12 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