Answer the question
In order to leave comments, you need to log in
How to forward a range of ports in windows server 2012?
I have a windows server 2012 datacenter x64 configured with RRAS over PPPoE. It is necessary to forward a large range of ports in NAT for virtual machines. How to do it by standard means?
The problem is that in standard "routing and remote access" you can only create one port per rule.
Answer the question
In order to leave comments, you need to log in
Solution
On a command prompt (run as administrator):
for /L %g in (1024,1,65535) do netsh routing ip nat add portmapping "PPPoE" udp 0.0.0.0 %g 192.168.50.12 %g
Like this:
netsh advfirewall firewall add rule name="Allow RTMFP" dir=in action=allow profile=any localport=1024-65535 remoteport=1024-65535 protocol=udp
netsh advfirewall firewall add rule name="Allow RTMFP" dir=out action=allow profile=any localport=1024-65535 remoteport=1024-65535 protocol=udp
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question