I'm trying to redirect a server's incoming TCP packets to local machine B.
The application client on local machine A (
192.168.0.7) is connected to the server (
188.8.131.52), so every incoming TCP packet from the server arrives at local machine A on port 38xx.
- How can I redirect the packets from the server to local machine B (
192.168.0.20) instead of local machine A?
- How can I then send the packets back to the server from local machine B but make it seem that it was coming from local machine A?
I have tried the following:
- Enabling port forwarding by editing the
- Running the IP tables command:
iptables -t nat -A PREROUTING -d 192.168.0.7 -p tcp -m tcp --dport 38xx -j DNAT --to-destination 192.168.0.120:38xx iptables -t nat -A POSTROUTING -j MASQUERADE
However, analyzing the traffic with Wireshark doesn't seem to bring up any results.
Thank you kindly.