Blocking IP address range using Microsoft IIS

You need to select the "Group of computers" option instead of the default "Single computer" option in the "Deny Access" dialogue.

When this is selected, an additional group of text boxes appears to the right of the IP Address box, into which you can put a netmask.

So, to block 194.*.*.* you put 194.0.0.0 into the left-hand set of boxes and 255.0.0.0 into the right-hand set.

The zeros after 194 could have any value as they are ignored based on the netmask.

Netmasks basically indicate which bits of the IP address are relevant, so in this case the "255" says that the whole first part of the IP address you entered ("194") is relevant and the "0"s say that the other 3 parts are not.

So, the rule is "block any IP that starts with 194 and has anything else following that".

Commentaires

In IIS 7, a specific role has to be added. I went to Server Manager > Roles > Add Role Services. Under Security node in the Role Services tree there is an option for IP and Domain Restrictions.

Checking that installed the role services and now my IIS Manager has an icon for "IPv4 Address and Domain Restrictions".