How do I redirect an incoming connection to a different IP address on a specific port using iptables?

How do I redirect an incoming connection to a different IP address on a specific port using iptables?
Answer
How to redirect an incoming connection to a different IP address on a specific port using IPtables
  1. iptables -t nat -A PREROUTING -p tcp –dport 3124 -j DNAT –to-destination 1.1.1.1:3000. This will route traffic incoming on port 3124 to 1.1. …
  2. iptables -t nat -A POSTROUTING -j MASQUERADE.
 

Tìm kiếm

Back
Top