Home > other >  Questions about the iptables port mapping
Questions about the iptables port mapping

Time:11-28

Iptables -t NAT - A PREROUTING - d 192.168.1.1 -p TCP -m TCP -- dport 4444 - j DNAT - to 192.168.2.10:4444
Iptables -t NAT - A 192.168.1.100 POSTROUTING - s - d 192.168.2.10 -p TCP -m TCP -- dport 4444 - j SNAT - to - source 192.168.2.1
The port mapping is possible, but - j SNAT - to - source 192.168.2.1:1111 after the port is not, after it is what reason?

CodePudding user response:

Add: snat behind specified port, specify a is only the first time the connection is successful, the TCP disconnect again even failed; Specify a port, is also the time off and even consumes a port, all run out again even fail, also is the inside of the port is not released?
  • Related