Block IP Connection by Country in Windows Server 2016

C

Chris Top

I need to block IP traffics from a certain country. I know I can export a free IP address list from IP2Location.com. The sample output format for Web.config is as below.

What should I do next to import the list to enable blocking in Windows Server 2016? I don't want to enter the IP address manually. Should I use CIDR format instead?

<?xml version="1.0"?>
<configuration>
<system.webServer>
<security>
<ipSecurity allowUnlisted="true">
<clear/>
<add ipAddress="5.45.208.64" subnetMask="255.255.255.224"/>
<add ipAddress="5.45.208.96" subnetMask="255.255.255.248"/>
<add ipAddress="5.100.192.0" subnetMask="255.255.224.0"/>
<add ipAddress="31.24.88.0" subnetMask="255.255.248.0"/>
</ipSecurity>
</security>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>

Continue reading...
 
Back
Top Bottom