Firewall IP range exception windows CE 7

Zoltan 20 Reputation points
2023-03-28T14:52:44.72+00:00

Hello!

I would like to create a rule to allow a port range through firewall in windows CE.
I tried to make an IP rule with IP:10.10.10.1-254 and IP:10.10.10.1-10.10.10.254, but none of them works.
I tried to make a subnet rule: IP:10.10.10.1 IP Mask: 0.0.0.255, but this is not working too.

I want to allow these addresses: 10.10.10.1-10.10.10.254

Is someone know how to do it?

User's image

Windows for business Windows Client for IT Pros Networking Network connectivity and file sharing
0 comments No comments
{count} votes

Accepted answer
  1. Limitless Technology 44,751 Reputation points
    2023-03-29T11:21:22.7133333+00:00

    Hello there,

    You can use the below powershell script to achieve this.

    $port1 = New-Object -ComObject HNetCfg.FWOpenPort

    $port1.Port = 80

    $port1.Name = 'MyTestPort' # name of Port

    $port1.Enabled = $true

    $fwMgr = New-Object -ComObject HNetCfg.FwMgr

    $profiledomain=$fwMgr.LocalPolicy.GetProfileByType(0)

    $profiledomain.GloballyOpenPorts.Add($port1)

    To specify a range of port numbers, separate the two numbers with a colon (:), such as -p tcp --dport 3000:3200. The largest acceptable valid range is 0:65535.

    Use an exclamation point character (!) after the --dport option to match all packets which do not use that network service or port.

    https://learn.microsoft.com/en-US/troubleshoot/windows-server/networking/netsh-advfirewall-firewall-control-firewall-behavior

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.