I create a method that have this code script :
SubnetUtils utils = new SubnetUtils("15.0.0.0/8");
if (utils.getInfo().isInRange("170.2.1.1"))
{
// Do some code
}
the if statement returns true ! But the single ip isn't in range.
What am I doing wrong? Is there's another way to check if single ip in range?
Thanks
SubnetUtils subnetUtils = new SubnetUtils("cidrRange");
**subnetUtils.setInclusiveHostCount(true);**
boolean withinRange = subnetUtils.getInfo().isInRange("ipAddress");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.