I have a laptop that forwards all the traffic from one interface to another.
I followed the instruction provided for different question, and it works.
net.ipv4.ip_forward = 1 and add the following rules to iptables sudo iptables -t nat -A POSTROUTING --out-interface eth1 -j MASQUERADE sudo iptables -A FORWARD --in-interface eth0 -j ACCEPT
Now, I would like to set a rule for traffic matching a certain destination IP and port to be redirected to a local server. I tried something like:
iptables -t nat -I OUTPUT --src 0/0 --dst 22.214.171.124 -p tcp --dport 443 -j DNAT --to-destination 127.0.0.1:4433
Actually I tried a few others, but without success. At best, I get redirected only the traffic that is generated locally (and not the transit traffic).
What should I try next?