Copying packets from an interface to another

If your kernel is recent enough you could use iptables --tee to forward frames from eth0 to the capture machine.


You can use tc mirred action. For example: For incoming traffic:

tc qdisc add dev eth0 ingress
tc filter add dev eth0 parent ffff: \
   protocol all prio 2 u32 \
   match u32 0 0 flowid 1:1 \
   action mirred egress mirror dev eth1

For outgoing traffic:

tc qdisc replace dev eth0 parent root handle 10: prio
tc filter add dev eth0 parent 10: \
   protocol all prio 2 u32 \
   match u32 0 0 flowid 10:1 \
   action mirred egress mirror dev eth1

Search the net for tcpbridge, which is exactly what does the Job. It can be used to talk to virtual machines as well.