把本机,ip1.1.1.1,端口9002,转发到 2.2.2.2的8080
echo “1” > /proc/sys/net/ipv4/ip_forward
sysctl -p
iptables -t nat -A PREROUTING -d 1.1.1.1 -p tcp –dport 9002 -j DNAT –to-destination 2.2.2.2:8080
iptables -t nat -A POSTROUTING -d 2.2.2.2 -p tcp –dport 8080 -j SNAT –to-source 1.1.1.1