enter image description here

I have an OpenWrt router (v18.06.5, r7897-9d401013fc), that does a standard (out of the box) NAT between a LAN (on eth1) and one public IP (on eth2). The router has the iptables-mod-tee module loaded and running.

My goal is to monitor the traffic going OUT of the interface eth2 to the WAN. The monitoring is to be done by a computer running "Wireshark", which is located on the LAN (at

For example when I ping from another computer on the LAN (e.g. from, I expect to see an IP/ICMP Echo request, that has ip.src == and ip.dst == going out on the eth2 interface to the WAN.

I am using the following command to modify the iptables to send the cloned packets to the host running the "Wireshark":
iptables -t mangle -A POSTROUTING -o eth2 -j TEE --gateway

It works but "Wireshark" displays the IP/ICMP Echo request with ip.src == and ip.dst == is wrong, because the ip.src looks like it would be before it is SNAT'ed (or Masqueraded) !!!

The ip.src should be which is the IP of my public WAN interface... because if it wasn't, then the host would not know where to send the ICMP Echo reply to, however the ping command is getting ICMP Echo replies from the host (as it should).

Why is this happening and how to correct it ?


1 Answer 1


The rule in mangle's POSTROUTING is ran early than rule in nat's POSTROUTING...so Source NAT is not happened when you do TEE operation in mangle's POSTROUTING .... see below attached iptables diagram: https://th.bing.com/th/id/R.aa2afe9a3c09b762af0b59c8670c7740?rik=SvxGxvrwso1veg&riu=http%3a%2f%2flinux-ip.net%2fnf%2fnfk-traversal.png&ehk=kT6op7%2bDt4yCPX1npGPAw9mWOpRiFTZsA5qJ0HMDQZo%3d&risl=&pid=ImgRaw&r=0

iptables diagram

  • Your informational post offers no solution. This site is for solutions, but you have just pointed them to information. OP is asking Why and how to fix. Please revise your answer.
    – number9
    Commented May 25, 2022 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .