LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-14-2005, 12:36 AM   #1
Barzan
LQ Newbie
 
Registered: Aug 2004
Distribution: Redhat
Posts: 6

Rep: Reputation: 0
Cool Iptables in promiscuous mode


Hi all,
When I put my network interface into promiscuous mode by:
#ifconfig eth0 promisc
I expect that all packets in my hub-based Lan appear in some of iptables' chains(as in tcpdump appear),but only those packets which have my own MAC address or brodcast address are appeared in iptables chains(I used -j LOG to trace this).
No one could tell me how I can fix this? where other packets are droped(assuming I am in promiscuous mode)?before giving packet to iptables or later? in which kernel function I could fix it?

Thank you in advance,
Barzan
 
Old 08-14-2005, 07:36 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
I'm not sure this is broken. Those packets will never be handed off to any programs that don't use raw sockets, so it's not like normal services will be handling them. What is your goal here?
 
Old 08-14-2005, 09:13 PM   #3
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
It was meant to be this way.

The kernel gets packets which may destined to your host or to another hosts. If your machine is not routing (there are no routing tables for other networks/hosts) or IP forwarding is turned off, then netfilter won't see those packets. If it did otherwise, then suddendly netfilter would have to process each one :s

Raw sockets don't listen to any port, they just tell the kernel that they would like to see all traffic, nothing more. Note that raw sockets will see packets dropped by netfilter too.

If you'd want to "fix" it, setup your machine as a router on your LAN.
Anyway, those packets would never reach any service on your machine and, if you're not routing, they won't reach other hosts either. The only security breach is the fact that these sniffers run as root, and there have been many overflows on the protocols handlers which they use. I never use ethereal for this fact, and tcpdump too has its dangers


Anyway, if you wanna try something with these packets, you could setup some bpf rules as used by libpcap that could filter some traffic. What you're trying to do anyway?

Last edited by primo; 08-14-2005 at 09:25 PM.
 
Old 10-23-2005, 07:24 AM   #4
Mr_Zet
LQ Newbie
 
Registered: Nov 2004
Posts: 16

Rep: Reputation: 0
I am also interested in this.
I found patch for netfilter, that adds PROMISC chain into iptables, but it is only for 2.4 kernels

Zet
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
wlan promiscuous mode paulr1984 Linux - Wireless Networking 0 05-13-2005 09:52 AM
Promiscuous Mode: Yes or No? AvatarofVirgo Linux - Security 3 02-22-2005 07:22 PM
eth0 promiscuous mode? emetib Linux - Networking 9 08-26-2004 06:51 PM
How Do I switch to promiscuous mode? 0din Linux - Newbie 1 03-05-2004 12:34 PM
eth0 promiscuous mode susx Linux - Networking 11 09-22-2001 12:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration