Window2008通过web.config进行限制ip访问

限制ip 访问 禁止访问的ip或者ip段

 

<security>

   <ipSecurity allowUnlisted="ture">

     <clear/>

       <add  ipAddress="127.0.0.1 allowed="true"/>

       <add  ipAddress="83.116.19.53 allowed="true"/>

       <add  ipAddress="83.116.119.0"  subnetMask="255.255.255.0" allowed="true"/>

       <add  ipAddress="83.117.0.0"  subnetMask="255.255.0.0" allowed="true"/>

       <add  ipAddress="83.0.0.0"  subnetMask="255.0.0.0" allowed="true"/>

   

    </ipSecurity>

</security>

 

 

永许ip访问  可以访问的ip或者ip段

 

<security>

   <ipSecurity allowUnlisted="false">

     <clear/>

       <add  ipAddress="127.0.0.1 allowed="true"/>

       <add  ipAddress="83.116.19.53 allowed="true"/>

       <add  ipAddress="83.116.119.0"  subnetMask="255.255.255.0" allowed="true"/>

       <add  ipAddress="83.117.0.0"  subnetMask="255.255.0.0" allowed="true"/>

       <add  ipAddress="83.0.0.0"  subnetMask="255.0.0.0" allowed="true"/>

   

    </ipSecurity>

</security>



取 消 确 定