I'm trying to use iptables.
I'm simulating a network with Mininet. I currently have a router connecting two subnets (10.0.1.1/24 and 10.0.2.1/24). If I use these two iptables rules on the router I see that two duplicates are created, but on the host 10.0.2.180 I only see echo request or reply packets (in the case of icmp ping). It seems that it is not bidirectional. The router only captures traffic traveling from one subnet to another, not internal traffic.
I wrote this two rules on the router, but I can only catch inbound traffic. I would also need to take the outgoing traffic. I'm using this iptables rules:
iptables -t mangle -A PREROUTING -i r1-eth1 -j TEE --gateway 10.0.2.180
iptables -t mangle -A POSTROUTING -o r1-eth1 -j TEE --gateway 10.0.2.180