---
title: "DHCP Range"
canonical: "https://docs.infoblox.com/space/niosmodulesansible/237011137/DHCP%20Range"
format: markdown
---
Use the nios_range module to configure, update, or remove a NIOS DHCP range object from a NIOS server.

> ⚠️ **Note**  
> ⚠️ In the current version of Infoblox NIOS Modules for Ansible Collections, the `nios_range` module supports only the IPv4 DHCP range. The IPv6 DHCP range is not supported.

The following table describes the parameters you can define in the `nios_range` module:

| **Parameter** | **Required/Optional** | **Description** |
| --- | --- | --- |
| `network`/  
`cidr` | Required | Specifies the network to which the DHCP range must be added or removed.  Specify the value in CIDR notation. |
| `network_view` | Optional | Specifies the name of the network view to associate with this object instance.  
If a value is not specified, `default` is used as the network view name.  
If you are using a custom network view, then you must specify this parameter. |
| `options` | Optional | Defines the set of DHCP options to be included as part of the configured network instance.  
This parameter accepts a list of subparameters. When configuring the subparameters, you must define at least one of the `name` and `num` parameters.<br>- `name`: The name of the DHCP option to configure.  
The standard values are `router`, `router-templates`, `domain-name-servers`, `domain-name`,             `broadcast-address`, `broadcast-address-offset`, `dhcp-lease-time`, and `dhcp6.name-servers`
- `num`: The number of DHCP options to configure.
- `value` (required): The value of the DHCP option specified by the `name` subparameter.
- `use_option`: Only applies to a subset of options (see the NIOS API documentation).  
The default value is `yes`.
- `vendor_class`: The name of the space with which this DHCP option is associated.   
The default value is `DHCP`. |
| `start_addr`/  
`start`/  
`first_addr`/  
`first` | Required | Specifies the beginning IP address of the DHCP range object in a create operation.  
If you configure `start_addr` and `new_start_addr` in a create operation, the value of `new_start_addr` overrides the value of `start_addr`.<br>If you need to update the DHCP range, use the `new_start_addr` and `new_end_addr` parameters to specify the values to update to, and the `start_addr` and `end_addr` parameters to specify the values of the existing DHCP range. |
| `new_start_addr`/  
`new_start`/  
`new_first_addr`/  
`new_first` | Optional | Specifies the beginning IP address of the DHCP range object in an update operation. |
| `end_addr`/  
`end`/  
`last_addr`/  
`last` | Required | Specifies the ending IP address of the DHCP range object in a create operation.  
If you configure `end_addr` and `new_end_addr` in a create operation, the value of `new_end_addr` overrides the value of `end_addr`.<br>If you need to update the DHCP range, use the `new_start_addr` and `new_end_addr` parameters to specify the values to update to, and the `start_addr` and `end_addr` parameters to specify the values of the existing DHCP range. |
| `new_end_addr`/  
`new_end`/  
`new_last_addr`/  
`new_last` | Optional | Specifies the ending IP address of the DHCP range to which you want to update. |
| `member` | Optional | Specifies the host name of the NIOS member configured to serve this object instance.<br>Do not configure this parameter when the `ms_server` or the `failover_association` parameter is configured. |
| `failover_association` | Optional | Specifies the name of the DHCP failover association configured to serve this object instance.  
A failover of Microsoft or NIOS members can be configured.<br>Do not configure this parameter when the `ms_server` or the `member` parameter is configured. |
| `ms_server` | Optional | Specifies the host name of the Microsoft member configured to serve this object instance.<br>Do not configure this parameter when the `failover_association` or the `member` parameter is configured. |
| `server_association_type` | Optional | Specifies the type of server association assigned to serve this object instance.  
The values you can specify are:<br>- `NONE`
- `FAILOVER`
- `MEMBER`
- `FAILOVER_MS`
- `MS_SERVER`<br>The default value is `NONE`. |
| `state` | Optional | Specifies the intended state of the object instance in NIOS.  
Set one of the following values:<br>- `present` (default): Configures the object in NIOS.
- `absent`: Removes the object in NIOS. |
| `disable` | Optional | Determines whether the configured DHCP range is disabled or not. Set one of the following values:<br>- `true`: The DHCP range is disabled.
- `false` (default): The DHCP range is enabled. |
| `name` | Optional | Specifies the name of the Microsoft scope for the object instance in NIOS. |
| `extattrs` | Optional | Specifies extensible attributes for the DHCP range object. |
| `comment` | Optional | Describes the DHCP range object. |
| `provider` | Required | Defines the details of the connection:<br>- `host`: DNS host name or IP address to connect to the remote instance of NIOS.
- `username`: User name to use for authenticating the connection to the remote instance.
- `password`: Password to use for authenticating the connection to the remote instance.<br>For information on additional fields you can define, see the list of subparameters in the list of subparameters in the *[NIOS Modules for Ansible Collections](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/44525470)* topic. |
| `connection` | Required | The `nios_range` module must be run locally. |

> ⚠️ **Note**  
> ⚠️ If you want to remove the member assignment or the MS server or failover server assignment from a DHCP range object, do not specify the corresponding parameter in the playbook.

## Examples

`name: Configure an ipv4 reserved range`  
`infoblox.nios_modules.nios_range:`  
`  network: 192.168.10.0/24`  
`  start: 192.168.10.10`  
`  end: 192.168.10.20`  
`  name: Test Range 1`  
`  comment: this is a test comment`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`  


`name: Update an ipv4 reserved range`  
`infoblox.nios_modules.nios_range:`  
`  network: 80.0.0.0/24`  
`  start: 80.0.0.10`  
`  new_start: 80.0.0.100`  
`  end: 80.0.0.20`  
`  new_end: 80.0.0.150`  
`  comment: this is a test comment`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`  


`name: Configure an ipv4 range served by a NIOS Grid member; custom network view`  
`infoblox.nios_modules.nios_range:`  
`  network: 192.168.10.0/24`  
`  start: 192.168.10.10`  
`  end: 192.168.10.20`  
`  name: Test Range 1`  
`  member: infoblox1.localdomain`  
`  network_view: custom`  
`  comment: this is a test comment`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`  


`name: Configure an ipv4 range served by a failover association`  
`infoblox.nios_modules.nios_range:`  
`  network: 192.168.10.0/24`  
`  start: 192.168.10.10`  
`  end: 192.168.10.20`  
`  name: Test Range 1`  
`  failover_association: fo_association_01`  
`  comment: this is a test comment`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`  


`name: Configure an ipv4 range served by an MS Server`  
`infoblox.nios_modules.nios_range:`  
`  network: 192.168.10.0/24`  
`  start: 192.168.10.10`  
`  end: 192.168.10.20`  
`  name: Test Range 1`  
`  ms_server: dc01.ad.localdomain`  
`  comment: this is a test comment`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`