All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudio Lavecchia <Claudio.Lavecchia@eurecom.fr>
To: Alistair Tonner <Alistair@nerdnet.ca>
Cc: netfilter@lists.netfilter.org
Subject: Re: iptables and wireless card in promiscuous mode
Date: Wed, 01 Dec 2004 13:12:39 +0100	[thread overview]
Message-ID: <41ADB537.6040603@eurecom.fr> (raw)
In-Reply-To: <200411301821.23588.Alistair@nerdnet.ca>

Well,

In fact  I really wanted my WLAN card set in promiscuous mode to drop 
all the packets coming from the other laptop, this means that I wanted a 
filter BEFORE the promiscuos mode filter.
And by the way: how do I cancel a rule from the PREROUTING chain?
If I do the standard way, I get:

~ # iptables -D PREROUTING 1
iptables: No chain/target/match by that name

Thx

Claudio


Alistair Tonner wrote:

> see inlined:
> 
>On November 30, 2004 07:53 am, Claudio Lavecchia wrote:
>  
>
>>Hello People,
>>
>>I have a little question:
>>
>>I have two laptops that have 802.11 wireless cards. I am developing some
>>application that essentially perform sniffing functions using wireless
>>cards in promiscuous mode. To test my code, I need those two laptops not
>>to "see" each other (--> I do not want the wireless card of laptop A,
>>which is operating in promiscuous mode to process packets coming from
>>laptop B) and I tought to do it using iptables. so on laptop A i added
>>the following rule:
>>
>>iptables -A INPUT -mac --mac-source MAC_ADDRESS_LAPTOP_B -j DROP
>>
>>and on laptop B I added the rule:
>>
>>iptables -A INPUT -mac --mac-source MAC_ADDRESS_LAPTOP_A -j DROP
>>
>>I just executed my first tests and the feeling  I got is that, for
>>example, the wlan card of  laptop B still passes through the packet
>>coming from laptop A.
>>
>>Can anyone confirm  this analysis? If I am right, can anyone give me a
>>hint to possibly workaround this?
>>    
>>
>
> Urrm.  
> You are likely doing the filtering in the wrong pipe.  These rules will only 
>drop packets that are destined for the IP of the host they are on.  You 
>PROBABLY are trying to drop *all* traffic from the other laptop.  Iptables 
>can do this at the IP layer, however you will STILL be able to see the 
>traffic across that card (from the other laptop) with any decent sniffer 
>program since ip sniffers work below the IP layer, before iptables gets the 
>packet to filter.  Most decent network sniffers, however, can do mac address 
>filtering on input.
>
> If you would like to have the traffic dropped anyway, there are better places 
>to put these rules, even though many are strongly against filtering anywhere 
>but in the filter table (including myself) the following would get the 
>traffic off your iptables radar:
>
>iptables -A PREROUTING -t mangle -m mac --mac-source MAC_ADDRESS_LAPTOP_A -j \  
>DROP
>
> Although in truth I'm not sure that this is wise, it might serve your 
>purposes.
>
> Alistair Tonner
> RSO HP Unix support 
>
>
>  
>



  reply	other threads:[~2004-12-01 12:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-30 12:53 iptables and wireless card in promiscuous mode Claudio Lavecchia
2004-11-30 13:05 ` Cedric Blancher
2004-11-30 23:21 ` Alistair Tonner
2004-12-01 12:12   ` Claudio Lavecchia [this message]
2004-12-01 13:31     ` Jason Opperisano
  -- strict thread matches above, loose matches on Subject: below --
2004-11-30 15:38 Gary W. Smith
2004-12-01 13:34 Scott Knake
2004-12-01 13:52 ` Claudio Lavecchia
2004-12-01 14:34 ` Claudio Lavecchia
2004-12-01 16:16   ` Jason Opperisano
2004-12-01 20:14     ` Sean Donner
2004-12-01 20:45 Scott Knake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41ADB537.6040603@eurecom.fr \
    --to=claudio.lavecchia@eurecom.fr \
    --cc=Alistair@nerdnet.ca \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.