All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: to use or not to use stateful capabilities
@ 2004-04-05 10:59 __ Radien__
  2004-04-05 11:06 ` Antony Stone
  0 siblings, 1 reply; 9+ messages in thread
From: __ Radien__ @ 2004-04-05 10:59 UTC (permalink / raw)
  To: netfilter

here is just the table and may not be viewed well in my last post:

Conn.State   -s         -d         --proto   -sport  -dport   SYN   ACK

New          out        web_server  tcp       <1024  80       Yes   No
Established  web_server out         tcp       80     <1024    Yes   No
Established  out        web_server  tcp       <1024  80       No    Yes
Established  web_server out         tcp       80     <1024    No    Yes


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: to use or not to use stateful capabilities
@ 2004-04-07  6:27 __ Radien__
  0 siblings, 0 replies; 9+ messages in thread
From: __ Radien__ @ 2004-04-07  6:27 UTC (permalink / raw)
  To: netfilter

Thx Cedric

and this is my experience
---------------------------------------

#!/bin/bash
#

#Interfaces
IF0='192.168.0.67'
IF1='192.168.10.67'

#LAN's
LAN0='192.168.0.0/24'
LAN1='192.168.10.0/24'

###############################################
#Flush all the tables
service iptables stop

#or this one
#iptables -F OUTPUT
#iptables -F FORWARD
#iptables -F INPUT

#allow everything go through
iptables -P INPUT DROP
iptables -P OUTPUT DROP

#suite 1  //Does not worksfor data connection
#iptables -t filter -A FORWARD -i eth0 -o eth1 -p tcp -m state --state
RELATED,ESTABLISHED -j ACCEPT
#iptables -t filter -A FORWARD -i eth1 -o eth0 -p tcp --dport 21 -j
ACCEPT

#suite 2 //works for passive and active data connection 
#iptables -t filter -A INPUT -i eth0 -p tcp -m state --state
RELATED,ESTABLISHED -j ACCEPT
#iptables -t filter -A OUTPUT -o eth0 -p tcp -m state --state
RELATED,ESTABLISHED -j ACCEPT
#iptables -t filter -A INPUT -i eth0 -p tcp --dport 21 -j ACCEPT

#suite 3  //Does not worksfor data connection
#iptables -t filter -A INPUT -i eth0 -p tcp -m state --state
NEW,RELATED,ESTABLISHED --dport 21 -j ACCEPT

#suite 4  //works for active data connections
#iptables -t filter -A INPUT -i eth0 -p tcp -m state --state
RELATED,ESTABLISHED -j ACCEPT
#iptables -t filter -A OUTPUT -o eth0 -p tcp -m state --state
ESTABLISHED -j ACCEPT
#iptables -t filter -A INPUT -i eth0 -p tcp --dport 21 -j ACCEPT

#suite 5  //works for passive data connections
iptables -t filter -A INPUT -i eth0 -p tcp -m state --state ESTABLISHED
-j ACCEPT
iptables -t filter -A OUTPUT -o eth0 -p tcp -m state --state
RELATED,ESTABLISHED -j ACCEPT
iptables -t filter -A INPUT -i eth0 -p tcp --dport 21 -j ACCEPT


Cedric Blancher <blancher@cartel-securite.fr> wrote:
> 
> Le mar 06/04/2004 à 09:01, __ Radien__ a écrit :
> > ByTheWay, about ftp service, do u mean that w/ iptables I can set such
> > rules that can detect and pass the data connection corresponding to
> > existing control-connection further than ordinary accepting
> > control-conneciton to fwd.
> > Does RELATED state match such cases?
> 
> Yes.
> For FTP, the date connection first packet will have RELATED state, for
> it complies to informations that were gathered within control connection
> by ip_conntrack_ftp module, allowing you to match and accept it.
> 
> -- 
> http://www.netexit.com/~sid/
> PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
> >> Hi! I'm your friendly neighbourhood signature virus.
> >> Copy me to your signature file and help me spread!
> 



But, what does RELATED state good for other services? what is it's
application?

Regards
__Radien__


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: to use or not to use stateful capabilities
@ 2004-04-06  7:01 __ Radien__
  2004-04-06  7:26 ` Cedric Blancher
  0 siblings, 1 reply; 9+ messages in thread
From: __ Radien__ @ 2004-04-06  7:01 UTC (permalink / raw)
  To: netfilter


Thanks Antony, you did fine.

ByTheWay, about ftp service, do u mean that w/ iptables I can set such
rules that can detect and pass the data connection corresponding to
existing control-connection further than ordinary accepting
control-conneciton to fwd.

Does RELATED state match such cases?

Regards
__Radien__
  


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: to use or not to use stateful capabilities
@ 2004-04-05 12:53 __ Radien__
  2004-04-05 13:19 ` Antony Stone
  0 siblings, 1 reply; 9+ messages in thread
From: __ Radien__ @ 2004-04-05 12:53 UTC (permalink / raw)
  To: netfilter

Antony, I made mistake in specifying the port greater than 1024, and I
meant  >1024.
----
Anyway, for a more complex configuration same as example you wrote,
can you tell me what is the benefit?
If I just accept packets w/ ACK flag that is of the conneciton has a
established state in the state table, rather than accepting every
packets that seems to be of a connection in established state. I mean
plz explain more :) , and give examples of disclosure if I don't use
stateful feature.

I wrote those rules, set of 4 rules. I can't underestand it's necessity,
yet.

Regards
__Radien__


^ permalink raw reply	[flat|nested] 9+ messages in thread
* to use or not to use stateful capabilities
@ 2004-04-05 10:49 __ Radien__
  2004-04-05 11:02 ` Antony Stone
  0 siblings, 1 reply; 9+ messages in thread
From: __ Radien__ @ 2004-04-05 10:49 UTC (permalink / raw)
  To: netfilter

Dear All

  For letting outside clients to access the webserver behind the
firewall:

  I want to know, what is the difference
1.   if I use connection states in rules tp accept for forwarding in the
firewall rulset:

Conn. State             -s                     -d                --proto
  -sport        -dport      SYN   ACK

New               outside_client    web_server         tcp       <1024  
       80     Yes   No
Established   web_server       outside_client      tcp       80         
     <1024 Yes   No
Established   outside_client    web_server         tcp       <1024      
   80     No   Yes
Established   web_server        outside_client     tcp       80         
     <1024 No   Yes


2.   or simple fwd rules:

iptables -t filter -A FORWARD -p tcp -s $WEBSERVER --sport 80 -d $OUT -j
ACCEPT
iptables -t filter -A FORWARD -p tcp -d $WEBSERVER --dport 80 -s $OUT -j
ACCEPT


I have a little knowledge about statefulness of the firewall, and can
not underestand what is the deference in such a case. I mean
practically.

Regards
__Radien__


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

end of thread, other threads:[~2004-04-07  6:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-05 10:59 to use or not to use stateful capabilities __ Radien__
2004-04-05 11:06 ` Antony Stone
  -- strict thread matches above, loose matches on Subject: below --
2004-04-07  6:27 __ Radien__
2004-04-06  7:01 __ Radien__
2004-04-06  7:26 ` Cedric Blancher
2004-04-05 12:53 __ Radien__
2004-04-05 13:19 ` Antony Stone
2004-04-05 10:49 __ Radien__
2004-04-05 11:02 ` Antony Stone

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.