---
title: "NIOS Next IP"
canonical: "https://docs.infoblox.com/space/niosmodulesansible/46006352/NIOS%20Next%20IP"
format: markdown
---
Use the `nios_next_ip` plug-in to fetch the next available IP addresses or IP address ranges for a specified network CIDR. The plug-in uses the Infoblox WAPI to return the IP address.

The following table describes the parameters you can define in the `nios_next_ip` plug-in:

| **Parameter** | **Required/Optional** | **Description** |
| --- | --- | --- |
| `terms` | Required | Specifies the CIDR network to retrieve the next address or set of addresses from. |
| `network_view` | Optional | Specifies the network view from which to retrieve the next available IP address.  
If a value is not specified, the default network view configured in NIOS is used. |
| `use_range` | Optional | Specifies whether to retrieve the next available IPv4 or IPv6 addresses. The default value is `false`.  
When you set this parameter to `true`, ensure that the configured number of IP addresses in the `num` parameter is between `1` and `20`. |
| `num` | Optional | Specifies the number of IP addresses to return. The default value is `1`. |
| `exclude` | Optional | Specifies the list of IP addresses to be excluded from the returned IP addresses. |
| `provider` | Required | <span style="color: #000000">Defines the details of the connection:</span><br>- `host`: The DNS host name or IP address to connect to the remote instance of NIOS.
- `username`: The user name to use for authenticating the connection to the remote instance.
- `password`: The password to use for authenticating the connection to the remote instance.<br>For information on additional fields you can define, see <span style="color: #172b4d">the list of subparameters in the </span><span style="color: #172b4d">*[NIOS Modules for Ansible Collections](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/44525470)*</span><span style="color: #172b4d"> topic.</span> |
| `connection` | Required | The `nios_next_ip` module must be run locally. |

## <span style="color: #000000">Examples</span>

`name: return next available IP address for network 192.168.10.0/24`  
`ansible.builtin.set_fact:`  
`  ipaddr: "{{ lookup('infoblox.nios_modules.nios_next_ip', '192.168.10.0/24', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"`  


`name: return next available IP address for network fd30:f52:2:12::/64`  
`ansible.builtin.set_fact:`  
`  ipaddr: "{{ lookup('infoblox.nios_modules.nios_next_ip', 'fd30:f52:2:12::/64', provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"`  


`name: return the next 3 available IP addresses for network 192.168.10.0/24`  
`ansible.builtin.set_fact:`  
`  ipaddr: "{{ lookup('infoblox.nios_modules.nios_next_ip', '192.168.10.0/24', num=3,`  
`provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"`


`name: return next available IP address for network 192.168.10.0/24 from a DHCP range`  
`ansible.builtin.set_fact:`  
`  ipaddr: "{{ lookup('infoblox.nios_modules.nios_next_ip', '192.168.10.0/24', use_range=true,`  
`  provider={'host': 'nios01', 'username': 'admin', 'password': 'password'}) }}"`