I have the following setup:
- A data source (IP
192.168.178.1) sends UDP packets to a server. - Server (Debian) collects and processes UDP data (IP
192.168.178.10, port4000) - PC (Windows 10) is supposed to monitor UDP data (IP
192.168.178.22, port4000)
The idea is to copy the UDP data and forward it to the PC using iptabels. The rule is set up on the Debian server (IP 192.168.178.10):
iptables -t mangle -A PREROUTING -p udp --dport 4000 -j TEE --gateway 192.168.178.22 The effect is:
- The server still receives and processes UDP data (OK).
- The PC also receives that data, however with the wrong destination IP. Hence, that data is not processed by the monitoring software.
On the PC Wireshark shows that the destination address is not the IP of the PC (.22) but the one of the server (.10):
Internet Protocol Version 4, Src: 192.168.178.1, Dst: 192.168.178.10 Now there are two, maybe three questions:
- Why does the PC receive the forwarded UDP packets at all since the destination IP address of those packets does not match?
- How may the IP-address of the iptables rule be changed to the IP address of the PC? Maybe I need to add a rule for POSTROUTING?
- Do I need to update any check sums?