Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Allow / Deny IP Address via Web.config

Allow / Deny IP Address via Web.config

Scheduled Pinned Locked Moved ASP.NET
questionsysadminwindows-adminsecurity
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 9427106
    wrote on last edited by
    #1

    Hi, My host server is : windows server 2003 and IIS6. How can i block an Ip Address or allow in webconfig? I have seen this code but not used for IIS6. <location path="Default Web Site"> <system.webServer> <security> <ipSecurity> <add ipAddress="192.168.100.1" /> <add ipAddress="169.254.0.0" subnetMask="255.255.0.0" /> </ipSecurity> </security> </system.webServer> </location>

    Richard DeemingR J 2 Replies Last reply
    0
    • U User 9427106

      Hi, My host server is : windows server 2003 and IIS6. How can i block an Ip Address or allow in webconfig? I have seen this code but not used for IIS6. <location path="Default Web Site"> <system.webServer> <security> <ipSecurity> <add ipAddress="192.168.100.1" /> <add ipAddress="169.254.0.0" subnetMask="255.255.0.0" /> </ipSecurity> </security> </system.webServer> </location>

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      You can't. IIS6 stores its configuration in the metabase, and doesn't use the web.config file at all. The only way you could possibly make this work would be to write a custom module, and add a wildcard mapping[^] so that every request to the server goes through the ASP.NET pipeline. This would probably have a detrimental effect on the performance of your site. Windows Server 2003 is out of mainstream support, and reaches end-of-life by July 2015[^]. You should really be looking to upgrade you server ASAP.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      • U User 9427106

        Hi, My host server is : windows server 2003 and IIS6. How can i block an Ip Address or allow in webconfig? I have seen this code but not used for IIS6. <location path="Default Web Site"> <system.webServer> <security> <ipSecurity> <add ipAddress="192.168.100.1" /> <add ipAddress="169.254.0.0" subnetMask="255.255.0.0" /> </ipSecurity> </security> </system.webServer> </location>

        J Offline
        J Offline
        joginder banger
        wrote on last edited by
        #3

        HI you can do as you want with the help of IIS7. Some simple step follow and deny any IP address. for more information check this link http://technet.microsoft.com/en-us/library/cc730889.aspx[^] and one more link this http://stackoverflow.com/questions/6812324/iis7-question-about-blocking-all-ip-addresses-from-accesing-my-site[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups