Reply

How to exclude a range of ip addresses or how to select next available ip address within a range

wstaten
Techie
Posts: 1
4015     0

I wanted to know if it was a way to use the API to either exclude IP addresses using a range instead of listing them one by one or is it a way to use next available ip and use a range. Currently I have something like the following:

 

_object_function: next_available_ip
_parameters:
exclude:
- 172.26.x.1
- 172.26.x.2
- 172.26.x.3
- 172.26.x.4
- 172.26.x.5

 

I have many different networks so I would rather use a range instead of listing all the IPs out.

Re: How to exclude a range of ip addresses or how to select next available ip address within a range

Adviser
Posts: 93
4016     0

next_available_ip's exclude option only takes individual IP addresses.  You could create a reserved range (a dhcp range not assigned to any appliances) in the network, and that range would not be available to the next_available_ip function.

Re: How to exclude a range of ip addresses or how to select next available ip address within a range

baizej
Techie
Posts: 2
4016     0

You could build an array to pass to the exclude parameter.  If you know you want to exclude the first 10 IPs, then something like a for loop counting from 0 to 10 and appending each new counted number to the last octet and then append the full IP to the array. 

Showing results for 
Search instead for 
Do you mean 

Recommended for You