LinuxQuestions.org
Help answer threads with 0 replies.
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 07-08-2008, 10:48 AM   #1
ravenst1
LQ Newbie
 
Registered: Aug 2004
Distribution: redhat 9
Posts: 4

Rep: Reputation: 0
forwarding packets in promiscuous mode


Hi all,

I was hoping someone might be able to point me in the right direction.

I would like to build a small pc which would have dual NICs and connect inbetween my router and main switch. I would like it to act as a kind of passthru device, accepting all packets from the router on one interface and forwarding them out of the other interface and vice versa.

My reason for doing this is that I would like to build a box that intercepts all traffic and performs advanced accounting techniques on the packets (mainly as a learning exercise), and forwards the packets on as if the box never existed. This will lead on to other related experiments I am interested in performing to learn more about IP packets.

Is it possible to do this by setting both NICs to promiscuous mode and enabling ip forwarding? Will i need iptables rules to perform this? I don't want to alter the packets in anyway, just send them straight to the other interface.

Many thanks for any help you can give me on the matter

Andy
 
Old 07-08-2008, 11:33 AM   #2
jamesapnic
Member
 
Registered: Jul 2008
Posts: 40

Rep: Reputation: 15
It depends how transparent you want it. You could just have it act a router but the ttl will change giving away your presence and also if you have ICMP enabled then someone behind it can do a traceroute and get icmp unreachable. To prevent a basic traceroute you could just use ipforwarding, appropriate routing rules and disable ICMP.

However you will need to use ip tables mangling to fix the ttl issue.
There is a good tutorial on mangle rules at http://security.maruhn.com/iptables-...al/x10539.html

Then, yes, it is just a case of sniffing it as normal, however you only need to sniff one interface really, since any traffic going through it and not at it, will be getting processed on both interfaces.
 
Old 07-08-2008, 11:34 AM   #3
ravenst1
LQ Newbie
 
Registered: Aug 2004
Distribution: redhat 9
Posts: 4

Original Poster
Rep: Reputation: 0
Hi again,

I just wanted to clarify, although what i stated above sounds like I require a transparent bridge, I would (if possible) like the box to have no IP address at the present time (hence promiscuous). Also, when you bridge in linux, are you still able to interact with the layer 3? As I will need this for packet inspection.

Cheers,
Andy
 
Old 07-08-2008, 12:54 PM   #4
ravenst1
LQ Newbie
 
Registered: Aug 2004
Distribution: redhat 9
Posts: 4

Original Poster
Rep: Reputation: 0
Hi Jamesapnic,

Sorry, i didn't refresh before posting my 2nd thread so i didn't see your message.
Your reply was very useful, thanks very much for that!

Andy
 
Old 07-08-2008, 06:59 PM   #5
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Or just get a hub and connect your boxes to the hub. All traffic is right there for you to watch.
 
Old 07-09-2008, 08:57 AM   #6
jamesapnic
Member
 
Registered: Jul 2008
Posts: 40

Rep: Reputation: 15
Yeah you could do that Make sure you use a read-only ethernet cable though, just to make sure. I think you might also need echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp for total transparency (or appropriate adapters). If you wanted to go with the box in the middle method.
 
  


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
Wireshark in promiscuous mode TotalLinuxNoob Linux - Wireless Networking 5 06-20-2007 02:58 PM
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
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 12:48 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