Allow / Deny IP Address via Web.config
-
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>
-
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>
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
-
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>
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[^]