« Previous Next »

Answered Thread: IIS IP blocking in CIDR Notation

Last post 11-02-2009 1:59 PM by rmcdonald. 11 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (12 items)

Sort Posts:

  • 09-29-2009, 11:49 AM

    IIS IP blocking in CIDR Notation

    Hi,

    How to block IP in CIDR notation in IIS? 

    Also please let me know how to use the CIDR notation IP in Allow/Deny Section of IIS?

    Please Help 

     

     

  • 09-29-2009, 2:59 PM In reply to

    • naziml
    • Top 150 Contributor
    • Joined on 03-10-2008, 6:25 PM
    • Posts 41

    Answered Re: IIS IP blocking in CIDR Notation

    You can easily convert CIDR notation for an IPV4 address to an IP address and subnet mask. IP restriction in IIS6 does not support CIDR notation.

  • 09-29-2009, 3:16 PM In reply to

    Re: IIS IP blocking in CIDR Notation

    To my knowledge you cannot do this.

    (Doh! nazim beat me too it.)

  • 09-29-2009, 11:22 PM In reply to

    Re: IIS IP blocking in CIDR Notation

    Hi,

    CIDR notation IP is used to Indicates a range of IP's right(Correct me if i am wrong).

    If so with a CIDR notation how to Get the range of IP's from a CIDR IP and add them into IIS to block that IP's.,

     Please Help.

  • 09-29-2009, 11:38 PM In reply to

    • naziml
    • Top 150 Contributor
    • Joined on 03-10-2008, 6:25 PM
    • Posts 41

    Re: IIS IP blocking in CIDR Notation

    You can still use an IP address and a subnet mask in IP restriction setting. Here is an example:

    CIDR notation: 192.168.0.0/8     This means you can mask the last 32 bits, so the range is 192.168.0.0 - 192.168.0.255

    Using subnet masks this is equivalent to:

    IP address: 192.168.0.0

    Subnet mask: 255.255.255.0

    What this says is that only the first 3 bytes are relevant and the last can be anything ... that essentially maps to the same range as above.

    HTH.

  • 09-29-2009, 11:49 PM In reply to

    Re: IIS IP blocking in CIDR Notation

    Hi,

    If I have a IP address in the in following format ex. 192.168.72.24/22. Here 22 is the netmask in CIDR. Then how to find out the subnet mask and then add that range into the iis.

    Please help

     

  • 09-30-2009, 12:09 AM In reply to

    • naziml
    • Top 150 Contributor
    • Joined on 03-10-2008, 6:25 PM
    • Posts 41

    Re: IIS IP blocking in CIDR Notation

    22 = 8+8+6. So the relevant bits after mask are 8bits : 2highest order bits: none : none 

    Hence the subnet mask will be 255.192.0.0

  • 09-30-2009, 12:51 AM In reply to

    Re: IIS IP blocking in CIDR Notation

    Should the Sub net mask  value for /22 not be "255.255.252.0"..??

    How did you get the abovw sub net mask.. Please clarify

  • 09-30-2009, 12:59 AM In reply to

    • naziml
    • Top 150 Contributor
    • Joined on 03-10-2008, 6:25 PM
    • Posts 41

    Re: IIS IP blocking in CIDR Notation

    IP address is  1 byte : 1 byte : 1 byte : 1 byte.

    You need to mask off the lower 22 bits. That is 8+8+6 bits, so the lower 2 bytes are masked off (zeroed) and from the 3rd byte , the lower 6 bits are masked off.

    So the lower 2 bytes are zero since they are masked off. When we mask of the lower 6 bits, the byte is essentially 11000000 in binary, which is 192. So your mask is 255.192.0,0

  • 09-30-2009, 2:51 AM In reply to

    Answered Re: IIS IP blocking in CIDR Notation

    Mm.. not sure if we are talking about the same thing, but generally in my env when we said
    192.168.10.x /24 - it meant 255.255.255.0 netmask
    then /22 is 255.255.252.0 netmask
    /18 will be 255.255.192.0 netmask.  <- Edited

    Cheers,
    Bernard Cheah
  • 09-30-2009, 5:35 AM In reply to

    Re: IIS IP blocking in CIDR Notation

    I think Last line in your reply should be /18 will be 255.255.192.0

  • 11-02-2009, 1:59 PM In reply to

    Re: IIS IP blocking in CIDR Notation

    hey guys i just went through this and found a solution. one of our sites that was developed poorly and is going to be shutdown soon was being attacked by a Russian IP address that kept using a SQL injection attack on us. So i was looking into blocking countries in IIS and as i found out doing it real quick in IIS is not possible like it is in Apache. So heres what ended up working for me after hours of looking around. (btw there is a paid tool called IP2Location ISAPI Filter at http://www.ip2location.com/ip2location-isapi-filter.aspx if your willing to spend the money for the yearly fee). Now on to the free way

    I first went to http://www.countryipblocks.net/country-blocks/

    Choose the country you would like to block (you can also choose multiple if you like) but select "IP Range" as the format up top and you will get a list of ranges for that country. Ctrl + A select the whole list and paste it into a wordpad.

    Now next you will need a non Microsoft product called IISIP

    Get it here http://www.hdgreetings.com/other/Block-IP-IIS

    Extract it and you will see a IPFeeds folder and a few sample lists there, I used the "Feed-Okean-China.xml" and "IPData-Okean China.txt" as a template. so I deleted everything in the text file and pasted in the range list from the site earlier and saved it. Edited the XML accordingly so it matches and loads the right text file and i was able to load the huge blocked list for just the site i was having problems with not my IIS Root.

     That small free program saved the day and my time since there isn't an easy way to load huge lists in IIS. too bad the program doesn't do the reverse and let you load allow list so i could say load all the USA IP ranges and deny everything else. Source code is available on that site so i guess its possible but hey i don't program so thats a no go for me. still worked out great anyways hope this helps someone else.

     Thanks

    Rich

Page 1 of 1 (12 items)
Microsoft Communities