I have a big list of IP ranges which I want to import to windows firewall. It is a pain to import them one by one.
Is there any automatic way to achieve that? A script that can create rules for port with large number of IPs? I hold them in a file.
And what about performance of a large IP based rule?
2 Answers
You can add IP range via Scope tab:
Open the rule you created in Windows Firewall
Click on the Scope tab.
For remote IP addresses, click Add.
Click This IP address range.
For the first range, From: **** To:**** and click OK.
Click OK one last time to save your rule.
You can refer to this Microsoft document:
1Export rules, edit, then import
You could export the rules as a CSV or JSON file, edit them to include your new IP ranges, then import the rules back into the WIndows Firewall.
You may find these scripts useful:
Powershell scripts to export and import firewall rules in CSV or JSON format