Sunday 12 April 2015

IIS - Restrict IP Address Range

Allowing and restricting visits from certain IPs or IP ranges can be easily done on IIS.
Working with a simple IP is easy. Working on an IP range is a bit more complicated.
We will discuss about it here. I will discuss about the restriction case and you can follow the same method for "Allow IP " case also.
Follow the below steps:
  1. Make sure "IP Security" feature is installed on your IIS server machine.

    • Goto Control Panel > On Left Pane select "Turn Windows features on or off".
    • On Windows Features window, select "IP Security" and click "OK".
    • Installing this you might be prompted for a reboot.

  2. Now browse to your website on IIS (Internet Information Services Management Services Console) and Open (Double Click) "IP Address and Domain Restrictions".

  3. Right Click > Select option "Add Deny Entry".

  4. Enter the IP Address Range and Subnet Mask to restrict.
    • In the above example all IPs in the range: 115.164.0.1 - 115.164.255.254 will be blocked.
    • To help you calculate the subnet mask, use the tool: http://www.subnet-calculator.com/subnet.php

No comments:

Post a Comment