Forward 3389 ports of the local interface IP 61.144.14.72 to 116.6.73.229 3389
(The main access to the 61.144.14.72 3389 port, you will jump to 116.6.73.229 3389)
Steps
1, the first thing to do is/etc/sysctl.conf configuration file Net.ipv4.ip_forward = 1 default is 0 This allows iptalbes forward.
2, service iptables stop shutdown firewall
3. Reconfigure rules
Iptables-t nat-a prerouting--dst 61.144.14.72-p tcp--dport 3389-j dnat--to-destination 116.6.73.229:3389
Iptables-t nat-a postrouting--dst 116.6.73.229-p tcp--dport 3389-j SNAT--to-source 61.144.14.72
Service Iptables Save
Saves the current rule to the/etc/sysconfig/iptables
If you're familiar with this file, modifying the contents directly is equivalent to command-line input rules.
5, Start iptables Services, service iptables start
Can be written into the script, the device starts to run automatically;
# vi/etc/rc.local
#!/bin/sh
#
# This script would be executed *after* all the other init scripts.
# You can put your own initialization stuff with If you don ' t
# want to does the full Sys V style init stuff.
Touch/var/lock/subsys/local
Sh/root/myshipin.log
---------------------------------------------------------------------
VI Myshipin.log
#!/bin/sh
#
# This script would be executed *after* all the other init scripts.
# You can put your own initialization stuff with If you don ' t
# want to does the full Sys V style init stuff.
Iptables-f-T Nat iptables-t nat-a prerouting--dst 61.144.14.72-p tcp--dport 3389-j dnat. 229:3,389
Iptables-t nat-a postrouting--dst 116.6.73.229-p tcp--dport 3389-j SNAT--to-source 61.144.14.72
~
----------------------------------------------------------------
Tcp
Iptables-t nat-a prerouting--dst 61.144.14.87-p tcp--dport 9304-j dnat--to-destination 10.94.143.204:9304
Iptables-t nat-a postrouting--dst 10.94.143.204-p tcp--dport 9304-j SNAT--to-source 61.144.14.87
Udp
Iptables-t nat-a prerouting--dst 61.144.14.87-p UDP--dport 9305-j dnat--to-destination 10.94.143.204:9305
Iptables-t nat-a postrouting--dst 10.94.143.204-p UDP--dport 9305-j SNAT--to-source 61.144.14.87