我们需要将 WAF 的 IP 地址范围列入白名单,如下:
199.83.128.0/21
198.143.32.0/19
149.126.72.0/21
103.28.248.0/22
45.64.64.0/22
185.11.124.0/22
192.230.64.0/18
更多细节:
我正在使用 .net ipSecurity 部分。但还没有找到任何如何添加上述 ip 地址而不必添加所有 ip 地址的示例。
例如
<ipSecurity allowUnlisted="false">
<!-- this line blocks everybody, except those listed below -->
<clear/>
<add ipAddress="xx.xx.xx.xx" allowed="true"/>
</ipSecurity>
我是子网掩码的新手。
有没有一种优雅的方式来实现这个?
最佳答案
在199.83.128.0/21中,21是子网掩码的CIDR格式。您可以使用 conversion table将 CIDR 格式转换为 IP 地址。
然后将您的 IPSecurity 设置为拒绝除指定 IP 地址之外的所有地址。即:
<security>
<ipSecurity allowUnlisted="false">
<add allowed="true" ipAddress="199.83.128.0" subnetMask="255.255.255.240"/>
[add additional ip addresses here]
</ipSecurity>
</security>
关于asp.net-mvc - ipSecurity - 如何添加 IP 地址范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33906413/