All of lore.kernel.org
 help / color / mirror / Atom feed
* Iptables Match on Direction (IP_CT_IS_REPLY)
@ 2005-02-26 12:43 Peter Lenci
  2005-02-27 20:37 ` Filip Sneppe
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Lenci @ 2005-02-26 12:43 UTC (permalink / raw)
  To: netfilter-devel

Hi there

Is there a possibility to access flag IP_CT_IS_REPLY from an iptables
command?

I have only spotted the "--direction original|reply|both" option from
the connbytes patch
(http://www.netfilter.org/patch-o-matic/pom-extra.html#pom-extra-connbytes)
but then I would prefer not to waste memory by counting bytes.

Regards
Peter

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

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

* Re: Iptables Match on Direction (IP_CT_IS_REPLY)
  2005-02-26 12:43 Iptables Match on Direction (IP_CT_IS_REPLY) Peter Lenci
@ 2005-02-27 20:37 ` Filip Sneppe
  2005-03-04  9:35   ` Peter Lenci
  0 siblings, 1 reply; 4+ messages in thread
From: Filip Sneppe @ 2005-02-27 20:37 UTC (permalink / raw)
  To: Peter Lenci; +Cc: netfilter-devel

Hi Peter,

On Sat, 26 Feb 2005 07:43:03 -0500 (EST), Peter Lenci
<peterlenci@yahoo.ca> wrote:
> Hi there
> 
> Is there a possibility to access flag IP_CT_IS_REPLY from an iptables
> command?
> 
> I have only spotted the "--direction original|reply|both" option from
> the connbytes patch
> (http://www.netfilter.org/patch-o-matic/pom-extra.html#pom-extra-connbytes)
> but then I would prefer not to waste memory by counting bytes.
> 

The "conntrack" match should do what you are looking for. From the help
option:

conntrack match v1.2.11 options:
 [!] --ctstate [INVALID|ESTABLISHED|NEW|RELATED|UNTRACKED|SNAT|DNAT][,...]
				State(s) to match
 [!] --ctproto	proto		Protocol to match; by number or name, eg. `tcp'
     --ctorigsrc  [!] address[/mask]
				Original source specification
     --ctorigdst  [!] address[/mask]
				Original destination specification
     --ctreplsrc  [!] address[/mask]
				Reply source specification
     --ctrepldst  [!] address[/mask]
				Reply destination specification
 [!] --ctstatus [NONE|EXPECTED|SEEN_REPLY|ASSURED|CONFIRMED][,...]
				Status(es) to match
 [!] --ctexpire time[:time]	Match remaining lifetime in seconds against
				value or range of values (inclusive)

Regards,
Filip

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

* Re: Iptables Match on Direction (IP_CT_IS_REPLY)
  2005-02-27 20:37 ` Filip Sneppe
@ 2005-03-04  9:35   ` Peter Lenci
  2005-03-04 23:27     ` Patrick McHardy
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Lenci @ 2005-03-04  9:35 UTC (permalink / raw)
  To: Filip Sneppe; +Cc: netfilter-devel

Hi Filip

 --- Filip Sneppe <filip.sneppe@gmail.com> wrote: 
> On Sat, 26 Feb 2005 07:43:03 -0500 (EST), Peter Lenci
> <peterlenci@yahoo.ca> wrote:
> > Is there a possibility to access flag IP_CT_IS_REPLY from an iptables
> > command?
> > 
> > I have only spotted the "--direction original|reply|both" option from
> > the connbytes patch
> > (http://www.netfilter.org/patch-o-matic/pom-extra.html#pom-extra-connbytes)
> > but then I would prefer not to waste memory by counting bytes.
> > 
> 
> The "conntrack" match should do what you are looking for. From the help
> option:

I studied conntrack but didn't find a way to read the direction
of the packet. In fact I was thinking about writing a patch for that
module to add an option "--direction original|reply|both".

How exactly would you determine the direction with conntrack?

Regards
Peter

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

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

* Re: Iptables Match on Direction (IP_CT_IS_REPLY)
  2005-03-04  9:35   ` Peter Lenci
@ 2005-03-04 23:27     ` Patrick McHardy
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2005-03-04 23:27 UTC (permalink / raw)
  To: Peter Lenci; +Cc: netfilter-devel

Peter Lenci wrote:
> I studied conntrack but didn't find a way to read the direction
> of the packet. In fact I was thinking about writing a patch for that
> module to add an option "--direction original|reply|both".
> 
> How exactly would you determine the direction with conntrack?

CTINFO2DIR(ctinfo) of ctinfo returned by ip_conntrack_get gives you the
direction. If you want to make a patch for ipt_conntrack it should be
similar to Rusty's recent patch "Add bitops to ipt_MARK without breaking
compatbility".

Regards
Patrick

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

end of thread, other threads:[~2005-03-04 23:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-26 12:43 Iptables Match on Direction (IP_CT_IS_REPLY) Peter Lenci
2005-02-27 20:37 ` Filip Sneppe
2005-03-04  9:35   ` Peter Lenci
2005-03-04 23:27     ` Patrick McHardy

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.