I have a C++ Program to sniff each and every packet that crosses my linux box. However i need to now get my linux box to listen to every traffic in my network. I could buy a managed switch and set up port spanning, but i aint paying 200+ £'s for a switch and plus gives me a chance to learn.
My Network
+---------Computer A
|
Internet-----Router------Switch-------------+---------Linux Box
|
+---------Computer B
Proposed Network
+---------Computer A
|
Internet-----Router------Linux Box--------Switch
eth0^ ^eth1 |
+---------Computer B
How would i setup this in linux. Do i just configure both the ethernet on different IP Address on the same network. Or am i completelly on the wrong track
My System
- Fedora 13.
Thanks
Best Answer
I'm assuming your current network is on a private subnet and that your router performs NAT for external communication (i.e. to the outside world all your machines look to have the same IP address). You have two options here:
To set it up as a router:
Exactly how you do some of the above perminantly (i.e. so it survives a reboot) depends on your Linux distribution and any other local network setup you need to respect. http://www.linuxjournal.com/article/8172 shows an example of a bridge setup using a RedHat/Fedora/CentOS style system, some minuor alterations may be needed for Debian/Ubuntu or Slackware or others.