IPTABLES: process a packet locally and send a copy to another host
5
votes
1
answer
12368
views
I have a trouble configuring iptables to do this: some clients send messages to a server. I want that the host server processes the messages locally (host A, as normal) but that additionally for each message (tcp packet) sends a copy of the packet to another host (host B, that runs a modified version of the server and I want see how is the behaviour with the same messages, so that I can compare both servers). It should be done with iptables. I have tried with the following commands. These send the packet to B but the message is not processed by the host A (should be done by the 2nd command?).
iptables -t nat -A PREROUTING -p tcp --dport 31090 -j DNAT --to-destination IP_HOST_B:32090
iptables -t nat -A POSTROUTING -p tcp --dport 32090 -j SNAT --to-source IP_HOST_A:31090
What I've missed in my configuration to accomplish my goal?
Thank you.
Asked by Armando Contestabile
(151 rep)
Jul 10, 2017, 07:11 AM
Last activity: May 22, 2021, 09:16 AM
Last activity: May 22, 2021, 09:16 AM