< Back

Get-IPRanges

Wed Jan 15, 2020 7:39 am

NAME Get-IPRanges



SYNOPSIS

This command is to find a free range of a given size among the list of occupied ranges of a "base" network





SYNTAX

Get-IPRanges -BaseNet <IPNetwork> -CIDR <Int32> -Networks <Object> [<CommonParameters>]





DESCRIPTION

This command is to find a free range of a given size among the list of occupied ranges of a "base" network. It

takes a list of networks of some "base" range and a CIDR/Length of a subnet you need and then searches through the

list to find a free slot of the requested size. The command uses ipnetwork2 library, compiled for netstandard.





PARAMETERS

-BaseNet <IPNetwork>

General "base" network, that "supernets" or contains all ranges provided for the "Networks" parameter



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CIDR <Int32>

The length of the range we search for



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Networks <Object>

The list of ranges of the "base" network which are in use



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

System.Object







NOTES









-------------------------- Example 1 --------------------------



PS C:\\> Get-IPRanges -Networks "10.10.5.0/24", "10.10.7.0/24" -CIDR 22 -BaseNet "10.10.0.0/16"



Base network is "10.10.0.0/16", the list of ranges already in use is ("10.10.5.0/24", "10.10.7.0/24"), we are

looking for a free range of a size /22



RELATED LINKS

ipnetwork2 library https://github.com/lduchosal/ipnetwork

cloudmgmt module https://github.com/eosfor/cloudmgmt

ipmgmt module https://github.com/eosfor/ipmgmt