Share via


Netsh interface Portproxy ports range

Question

Monday, August 24, 2015 2:52 PM

Hello,

I am using portproxy Netsh logic in my windows server 2008 R2 to redirect ports of services, I have a scenario where I need to configure a port range to redirect inside to a specific port of a working service of my Windows 2008 R2 server.

Is there anybody help me if there is any possibility to define port range for portproxy and redirect it to one port.

Regards,
Jebran.

All replies (3)

Tuesday, August 25, 2015 4:32 AM ✅Answered

Hi Mohammad Jebran,

Based on my understanding, you would like to add portproxy that multiple ports locally forwards to one port remotely.

I use the command “netsh interface portproxy add v4tov4 listenport=a connectaddress=m connectport=z; “netsh interface portproxy add v4tov4 listenport=b connectaddress=m connectport=z” to create two portproxy to forward packets to the specific port, it works in my lab.

You may use the command to create multiple ports to forward packets to the specific port.

Best regards,

Anne he

Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected].


Wednesday, August 26, 2015 12:03 AM ✅Answered

Listenport accepts single port and not an array, there isnt API documentation to view the dataset bind to ListenPort in MSDN. But you could view the calls using different tools, if you need to provide artifact. 

Current implementation only supports TCP and not UDP - dont think this gets change for server 2016 preview.


Tuesday, August 25, 2015 7:34 AM

Hello Anne He,

Thanks for the reply, Yes the command works for me too, I know that we can create multiple portproxy rules for different ports, but I required to add ports in thousands which is part of my scenario, still finding a way to define a ports range, such as netsh interface portproxy add v4tov4 listenport=a-to-j connectaddress=m connectport=z” 

Also do you have any idea if we can do the same for UDP ports, As I ready netsh portproxy currently support only TCP?

Regards,
Jebran.