A simple example of netsh interface portproxy

Source: Internet
Author: User
Tags haproxy microsoft help

netsh interface portproxy Microsoft help document address:

https://technet.microsoft.com/zh-cn/library/cc776297 (ws.10). Aspx#bkmk_1

The following is a simple example:

//Displays all portproxy parameters, including port/address pairs for v4tov4, v4tov6, v6tov4, and v6tov6. C:\>netshInterfaceportproxy Show All//since it has not been configured, nothing can be displayed. //Add configuration: Listen to 10022 port, when a socket is connected to 10022 port, the machine is connected to the 22 port of 192.168.2.53, the 10022 port of the machine can accept the connection address is "*", the protocol used is TCP, and currently only supports Transmission Control protocol (TCP). C:\>netshInterfacePortproxy Add v4tov4 listenport=10022connectaddress=192.168.2.53connectport= Alistenaddress=* protocol=TCP//add complete. //Show All. C:\>netshInterfaceportproxy Show All listens IPv4: Connect to IPv4: Address Port address port--------------- ----------  --------------- ----------*10022       192.168.2.53     A//Delete configuration: The local listening port accepts a connection address of "*" for the 10022,10022 port, the protocol used is TCP, and currently only supports the TCP protocol. C:\>netshInterfacePortproxy Delete v4tov4 listenport=10022listenaddress=* protocol=TCP//Delete is complete. //Show All. C:\>netshInterfaceportproxy Show All//since all the configurations have been deleted, nothing can be displayed. //View help information. C:\>netshInterfacePortproxy/?//A little. //View help information. C:\>netshInterface/?//A little. //View help information. C:\>netsh/?//A little. 

-----Haproxy is mainly used for load, if it is only a load, then it becomes a port mapping, but after all, Linux is the following program.

-----Windows also has a gadget: Portforward.exe, the graphical interface is easy to operate, the individual can use the usual, but there is no way to achieve interaction with the program.

After searching online and discovering Windows systems, including XP 2003,2008, netsh tools come with portproxy functionality. Currently only TCP port forwarding is supported, provided the host needs to be installed as a portproxy IPV6, the installation can not enable IPV6.
A. Configuration method
Assuming that you need to connect the 192.168.1.118 1494 port via the 192.168.1.8 14941 port, you need to enter the following statement on the command line of the 192.168.1.8 host
--- if IPV6 is already installed, the phrase may not be required
netsh interface ipv6 install
--- can not specify a local listener address, which can be implemented by the operating system to provide a floating address, if the operating system opens the host firewall, you need to release the TCP 14941 inbound connection

netsh interface portproxy add v4tov4 listenaddress=192.168.1.8 listenport=14941connectaddress=192.168.1.118 connectport=1494

netsh interface portproxy add v4tov4 listenport=14941connectaddress=192.168.1.118 connectport=1 494

--- cancel the port forwarding configured above, you can use the following statement:

netsh interface portproxy delete v4tov4 listenaddress=192.168.1.8 listenport=33891
--- if you want to see which port forwarding has been configured, you can use the following statement:

netsh interface portproxy show v4tov4

B. Advantages
Port forwarding entries can be added or removed as needed at any time, and restarting the operating system can still automatically save the previous configuration and automatically enable it, unlike Haproxy, which requires a restart of Haproxy when the configuration file is modified.
Online Some said XP configuration port forwarding does not work, it is estimated that there is no installation of IPV6, with XP test, after installing the IPV6 can implement port forwarding, and do not need to open the Routing and Remote Access service. In addition, considering the redundancy of port forwarding, multiple hosts can configure Port forwarding.

A simple example of netsh interface portproxy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.