Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.