All of lore.kernel.org
 help / color / mirror / Atom feed
* two negatived parameters
@ 2004-09-06  8:28 Akolinare
  2004-09-06  8:49 ` Alistair Tonner
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Akolinare @ 2004-09-06  8:28 UTC (permalink / raw)
  To: netfilter

Hi,

I have a little question with two negatived parameters in one rule.

I create a rule, which should only match if source and destination are not
the given. I think that it is easy and try the following rule:

iptables -A FORWARD -s ! host1 -d ! host2 -j ACCEPT

But with this rule pakets from host1 to host3 (or from host2 to host3) were
not affected. It seems like the logical combination is OR and not AND unlike
the not negatived rule.
I think that the rule is logical right. Is it a little bug or have I
misunderstood something?

I used the version 1.2.11 with kernel 2.4.26.

  Markus

-- 
NEU: Bis zu 10 GB Speicher für e-mails & Dateien!
1 GB bereits bei GMX FreeMail http://www.gmx.net/de/go/mail



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: two negatived parameters
@ 2004-09-06 11:48 Akolinare
  2004-09-07 16:10 ` Aleksandar Milivojevic
  0 siblings, 1 reply; 8+ messages in thread
From: Akolinare @ 2004-09-06 11:48 UTC (permalink / raw)
  To: netfilter

> I take it to mean that packets from host2 to host 3 were NOT accepted by
this 
> rule? ... What do the counters for the rule say? ( iptables -L -n -v -x 
).

yes, I already look after the counter. A paket from host2 to host3 dont
increase the counter. 

> What other rules exist that might affect said packets? -- I note the above
is  
> an ADD.  Could rules farther up the FORWARD chain have already 
> accepted/denied the said packets?

this was only a example. I tested also on a other pc, with has normal no
rulesset to be sure.

> FYI -- I just tested this by inserting a double negative rule in my
firewall 
> 
> iptables -I tcp_packets -p tcp -s ! {internal_lan} -d ! {internal lan ip} 
> --dport 25 -j allowed 
> 
> and sending myself an email from outside.  The packet counter incremented 
> appropriately.

Sorry, but why are you able to send with this rule a mail from outside to a
mailserver in your internal network? I suppose, that with the "-d !
{internal lan ip}" it ist not possible to send a paket to your mailserver.

> well... my two cents :-)
>
> iptables -A FORWARD -s host1 -d host2 -j DROP

well sorry it is not that easy as it seems. The rule should forward pakets
to a user-chain only if host1 ist not the source and host2 are is not the
destination.

I also tested with the 2.6.7 kernel and 1.2.11, so I can exclude this.

-- 
Supergünstige DSL-Tarife + WLAN-Router für 0,- EUR*
Jetzt zu GMX wechseln und sparen http://www.gmx.net/de/go/dsl



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

end of thread, other threads:[~2004-09-07 16:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-06  8:28 two negatived parameters Akolinare
2004-09-06  8:49 ` Alistair Tonner
2004-09-06  9:00 ` Cedric Blancher
2004-09-06 20:16 ` Jason Opperisano
2004-09-07 15:43 ` Aleksandar Milivojevic
2004-09-07 16:36 ` Jason Opperisano
  -- strict thread matches above, loose matches on Subject: below --
2004-09-06 11:48 Akolinare
2004-09-07 16:10 ` Aleksandar Milivojevic

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.