Reproduced from
The goal is WIN7 X64, and opened the firewall, want to use his machine to access other machines, and do not want to login his system, the general method is generally upload a htran, and then forwarded, but the other side has to kill soft, there is the possibility of being killed, so I use another way to achieve my purpose.
For convenience, first shut down his firewall.
netsh advfirewall set allprofiles state off
(Win2003&xp is closed with Netsh firewall set opmode DISABLE)
You can also release listenport, the specific order to check the information yourself. Then use the netsh interface portproxy to forward to the target server, but there is a small flaw, the port can be seen in the system, after all, is R3 layer of things, not like the iptables of Linux, so must choose a confusing port.
After the operation is complete, restore the firewall netsh advfirewall set allprofiles state to on. Then retreat.
regarding netsh forwarding, please refer to the following content : Windows lower port forwarding.
Add to:
netsh interface portproxy add v4tov4 listenport= port listenaddress= native IP connectport= target port connectaddress= target IP
Example:
netsh interface portproxy add v4tov4 8002 202.112.58.200 8002//Local all IP turn target IP8002
netsh interface portproxy add v4tov4 listenport=5200 listenaddress=1.1.1.1 connectport=3389 connectaddress=2.2.2.2// Specifies IP rotation.
xp/2003 need to install IPV6 first.
netsh interface ipv6 install
Delete:
netsh interface portproxy delete v4tov4 listenport= port listenaddress= native IP
To configure IP routing rotation:
netsh interface ipv4 set int forwarding=enabled
26 is a network interface number that can be viewed with the netsh interface IPv4 show interfaces.