[英]IIS IP Address restrictions subnet masks
我有以下ipv4和ipv6地址范圍,需要將它們放入web.config中以限制對它們的訪問。
103.21.244.0/22
2400:cb00::/32
2a06:98c0::/29
這是正確的方法嗎? 我不確定的是如何處理子網掩碼。 我使用https://www.tunnelsup.com/subnet-calculator/來計算適當的掩碼。 由於在生產現場關閉之前無法進行測試,因此我需要事先知道我是否做對了。
<system.webServer>
<security>
<ipSecurity allowUnlisted="false" denyAction="NotFound" xdt:Transform="Insert">
<clear/>
<add ipAddress="103.21.244.0" subnetMask="255.255.252.0" allowed="true"/>
<add ipAddress="2400:cb00::" subnetMask="FFFF:FFFF::" allowed="true"/>
<add ipAddress="2a06:98c0::" subnetMask="FFFF:FFF8::" allowed="true"/>
</ipSecurity>
</security>
</system.webServer>
最簡單的方法是在subnetMask
輸入/xx
位。 像這樣:
<system.webServer>
<security>
<ipSecurity allowUnlisted="false">
<add ipAddress="10.46.0.0" subnetMask="16" allowed="true" />
<add ipAddress="2001:44b8:3168:9b::" subnetMask="56" allowed="true" />
</ipSecurity>
</security>
</system.webServer>
我在IIS管理器中輸入IPv6地址,然后在C:\\Windows\\System32\\inetsrv\\Config\\applicationHost.config
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.