I have a Linux system (let it be A) with 2 ethernet cards, namely eth0 and eth1 which are attached to two totally unrelated LANs.
Basically eth0 is used for normal application traffic and eth1 is used only for debugging purposes. Debugging means that eth1 is linked using a cross cable to another linux box (let it be B) which runs Wireshark. I want Wireshark to be able to process application packets travelling on A's eth0.
Basically I need to copy travelling packets from eth0 interface to interface eth1 so that Wireshark on box B can sniff them (for some reasons I don't have physical access to LAN eth0). I could also need to specify which packets to copy from eth0 to eth1 according to some rule (based only on TCP/IP fields by the way).
Also note that A's eth0 don't need to be put in promiscuous mode because I only want to copy a subset of packets which have A as destination
Is there a way to achieve this using iptables alone? Or do i need to write an application to make this work? What should I do to "copy" the packets?