vim /etc/sysconfig/iptables
*filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 9090 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 9099 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 7070 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 16000 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 16001 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT *nat :PREROUTING ACCEPT [2:104] :POSTROUTING ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A OUTPUT -d 222.128.6.251 -p tcp --dport 9090 -j DNAT --to-destination 192.168.1.245:9090 -A OUTPUT -d 222.128.6.251 -p tcp --dport 7070 -j DNAT --to-destination 192.168.1.245:7070 -A PREROUTING -d 222.128.6.251/24 -p tcp --dport 9090 -j DNAT --to-destination 192.168.1.245:9090; -A POSTROUTING -d 192.168.1.245/24 -p tcp --dport 9090 -j SNAT --to-source 222.128.6.251:9090; -A PREROUTING -d 222.128.6.251/24 -p tcp --dport 7070 -j DNAT --to-destination 192.168.1.245:7070; -A POSTROUTING -d 192.168.1.245/24 -p tcp --dport 7070 -j SNAT --to-source 222.128.6.251:7070; COMMIT