Variable as IP address

Parent Previous Next

Data variables are added to the templates in the format <VariableDelimiter><VariableName><VariableDelimiter>, e.g. <<IPAddress>>. The variables can be included anywhere within the template. Multiple variables may be added to a single cell.


The data variable name is prefixed and suffixed by predefined characters (defaults ‘<<‘ and ‘>>‘). These characters are defined in the spreadsheet specific settings.


The general format of the IP data variables is as below:


<$<<VVV>>,<<ZZZ>>$>



Example 1, Add an offset to an IP address:


<$192.168.1.1,1$>



Although it's possible to place an IP address directly into the template, it's not very useful.


Example 2, Add an offset to an IP address:


<$<<IPSubnet>>,3$>



Example 3, Add an offset to an IP address:


<$<<IPSubnet>>,<<IncrementVal>>$>



CIDR IP Variables


IP variables may be defined as CIDR variables instead of just IP address e.g. 10.1.0.0/24


The IP address and/or subnet length may be extracted from the variable. The subnet length may be converted to a subnet mask or inverse mask if required.


Example 1, Add 11 to a CIDR IP Address:


<$<<CIDR>>,IPV4,11$>


Example 2, Add the IncrementVal to CIDR IP Address:


<$<<CIDR>>,IPV4,<<IncrementVal>>$>


Example 3,  Extract the subnet length:


<$<<CIDR>>,LEN$>


Example 4,  Extract the subnet length and convert to a subnet mask:


<$<<CIDR>>,MASK$>


Example 5, Extract the subnet length and convert to a wildcard mask:


<$<<CIDR>>,IMASK$>


IPv6 Variables


IP variables may be defined as IPv6 variables instead of just IP address e.g. 2402:9400::0000:0000:0001/48


Example 1, Add 1 to a IPv6 Address:


<$2402:9400::0000:0000:0001/48,1$>


Example 2, Add the IncrementVal to IPv6 Address:


<$<<CIDR Variable>>,IPV6,<<IncrementVal>>$>