All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: iptables and wireless card in promiscuous mode
@ 2004-12-01 13:34 Scott Knake
  2004-12-01 13:52 ` Claudio Lavecchia
  2004-12-01 14:34 ` Claudio Lavecchia
  0 siblings, 2 replies; 12+ messages in thread
From: Scott Knake @ 2004-12-01 13:34 UTC (permalink / raw)
  To: netfilter


iptables -t MANGLE -D PREROUTING 1.
It was also mentioned earlier to configure BPF to drop the undesired
packets.. what is wrong with this solution?

>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
>>
>>
>>
>>


^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: iptables and wireless card in promiscuous mode
@ 2004-12-01 20:45 Scott Knake
  0 siblings, 0 replies; 12+ messages in thread
From: Scott Knake @ 2004-12-01 20:45 UTC (permalink / raw)
  To: netfilter

>> Can anyone tell me how to set up a simple filter using BPF that
blocks
>> all the packets coming from a given MAC address?

>Out of curiosity what is this BPF you speak of? I googled for it and I
>came across "Berkeley Packet Filter" which sounds about on topic with
this
>mailing list but it seems to be a FreeBSD util.  I did an slocate for
it
>on my box and it found nothing but a header file.  Is this some
>non-standard util has a linux port for link layer filtering?

/usr/src/linux/Documentation/Configure.help (2.4.28)

Packet socket
CONFIG_PACKET
  The Packet protocol is used by applications which communicate
  directly with network devices without an intermediate network
  protocol implemented in the kernel, e.g. tcpdump.  If you want them
  to work, choose Y.

  This driver is also available as a module called af_packet.o ( =
  code which can be inserted in and removed from the running kernel
  whenever you want).  If you want to compile it as a module, say M
  here and read <file:Documentation/modules.txt>; if you use modprobe
  or kmod, you may also want to add "alias net-pf-17 af_packet" to
  /etc/modules.conf.

  If unsure, say Y.


man tcpdump. More or less the linux equivelant.




^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: iptables and wireless card in promiscuous mode
@ 2004-11-30 15:38 Gary W. Smith
  0 siblings, 0 replies; 12+ messages in thread
From: Gary W. Smith @ 2004-11-30 15:38 UTC (permalink / raw)
  To: Claudio Lavecchia, netfilter

Try pre and post routing...  It might be a start


> -----Original Message-----
> From: netfilter-bounces@lists.netfilter.org [mailto:netfilter-
> bounces@lists.netfilter.org] On Behalf Of Claudio Lavecchia
> Sent: Tuesday, November 30, 2004 4:54 AM
> To: netfilter@lists.netfilter.org
> Subject: iptables and wireless card in promiscuous mode
> 
> 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?
> 
> Thank you very much
> 
> Claudio



^ permalink raw reply	[flat|nested] 12+ messages in thread
* iptables and wireless card in promiscuous mode
@ 2004-11-30 12:53 Claudio Lavecchia
  2004-11-30 13:05 ` Cedric Blancher
  2004-11-30 23:21 ` Alistair Tonner
  0 siblings, 2 replies; 12+ messages in thread
From: Claudio Lavecchia @ 2004-11-30 12:53 UTC (permalink / raw)
  To: netfilter

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?

Thank you very much

Claudio


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

end of thread, other threads:[~2004-12-01 20:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-01 13:34 iptables and wireless card in promiscuous mode 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
  -- strict thread matches above, loose matches on Subject: below --
2004-12-01 20:45 Scott Knake
2004-11-30 15:38 Gary W. Smith
2004-11-30 12:53 Claudio Lavecchia
2004-11-30 13:05 ` Cedric Blancher
2004-11-30 23:21 ` Alistair Tonner
2004-12-01 12:12   ` Claudio Lavecchia
2004-12-01 13:31     ` Jason Opperisano

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.