Suppose I need to Allow IPs of the range: 10.10.80.0 - 10.10.95.255 inside Access Control Policy
Currently I am writing them like below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AccessControl async="false" continueOnError="false" enabled="true" name="AC-Test"> <DisplayName>AC-Test</DisplayName> <Properties/> <IPRules noRuleMatchAction="DENY"> <MatchRule action="ALLOW"> <SourceAddress mask="24">10.10.80.0</SourceAddress> <SourceAddress mask="24">10.10.81.0</SourceAddress> . . . <SourceAddress mask="24">10.10.95.0</SourceAddress> </MatchRule> </IPRules> </AccessControl>
Is there any other way to write them in single line?
Solved! Go to Solution.
The easiest way to calculate CIDR range is here:
https://www.ipaddressguide.com/cidr
Here we can get the fine tuned mask value for a given IP range.
e.g. For the mentioned IP range (10.10.80.0 - 10.10.95.255) the output is 10.10.80.0/20
So, to write down the range it will be like below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AccessControl async="false" continueOnError="false" enabled="true" name="AC-Test"> <DisplayName>AC-Test</DisplayName> <Properties/> <IPRules noRuleMatchAction="DENY"> <MatchRule action="ALLOW"> <SourceAddress mask="20">10.10.80.0</SourceAddress> </MatchRule> </IPRules> </AccessControl>
The easiest way to calculate CIDR range is here:
https://www.ipaddressguide.com/cidr
Here we can get the fine tuned mask value for a given IP range.
e.g. For the mentioned IP range (10.10.80.0 - 10.10.95.255) the output is 10.10.80.0/20
So, to write down the range it will be like below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AccessControl async="false" continueOnError="false" enabled="true" name="AC-Test"> <DisplayName>AC-Test</DisplayName> <Properties/> <IPRules noRuleMatchAction="DENY"> <MatchRule action="ALLOW"> <SourceAddress mask="20">10.10.80.0</SourceAddress> </MatchRule> </IPRules> </AccessControl>