---
title: "infoblox_ipv4_range Resource"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/1383137574/infoblox_ipv4_range%20Resource"
format: markdown
---
This resource enables you to perform create, update, and delete operations on IPv4 range objects. 

The following table describes the parameters you can define in a IPv4 range resource block:

| **Parameter** | **Required/**  
**Optional** | **Description** |
| --- | --- | --- |
| `name` | Optional | Specifies the name of the range object. |
| `network` | Optional | Specifies the network to which this range belongs. It is defined in IPv4 Address/CIDR format. |
| `network_view` | Optional | Specifies the network view in which this range resides.  
If a value is not specified, `default` is used as the network view name. |
| `start_addr` | Required | Specifies the starting address of the IPv4 address range. |
| `end_addr` | Required | Specifies the ending address of the IPv4 address range. |
| `disable` | Optional | Determines whether the range object is disabled.  
The default value is `false`, which means the object is enabled. |
| `failover_association` | Optional | Specifies the name of the failover association: the server in this failover association will serve the IPv4 range in case the main server is out of service. If you want the failover association specified here to serve the range, `server_association_type` must be set to `FAILOVER` or `FAILOVER_MS`. |
| `server_association_type` | Optional | Specifies the type of server that will serve the range. Valid values are `FAILOVER`, `MEMBER`, `MS_FAILOVER`, `MS_SERVER`, `NONE`. The default value is `NONE`. |
| `options` | Optional | Specifies an array of DHCP option structs that lists the DHCP options associated with the object. DHCP options describe network configuration settings and various services available on the network. These options show as variable-length fields at the end of DHCP messages.<br>You can set the following sub parameters for every DHCP option that you define:<br>- `name` (required): Specifies the name of a DHCP option.
- `num` (required): Specifies the code of the DHCP option.
- `value` (required): Specifies the value of the option you are defining.
- `vendor_class`: Specifies the name of the space this DHCP option is associated with. The default value is `DHCP`.
- `use_option`: Determines whether the custom DHCP option that you choose from the below list must be enabled. The default value is `false`.  
These options correspond to those listed in the **Custom DHCP Options** drop-down list in NIOS Grid Manager: `router`, `router-templates`, `domain-name-servers`, `domain-name`, `broadcast-address`, `broadcast-address-offset`, `dhcp-lease-time`, and `dhcp6.name-servers`. |
| `use_options` | Optional | Determines whether the `options` field is enabled. The default value is `false`.  
To use `options`, you must set this parameter to `true`. |
| `member` | Optional | Specifies the member that will provide service for this range. `server_association_type` needs to be set to `MEMBER` if you want the server specified here to serve the range. `member` has the following three fields `name`, `ipv4addr` and `ipv6addr`. At least one of `name`, `ipv4addr`, or `ipv6addr` is required in the `member` block. The description of the fields of `member` is as follows:<br>- `name`: Specifies the name of the pool.
- `ipv4addr`: Specifies the weight of the pool.
- `ipv6addr`: Specifies the IPv6 address of the member. |
| `template` | Optional | Specifies whether the range will be created according to the values specified in the named template if set on creation. |
| `ms_server` | Optional | Specifies the IP address of the Microsoft server that will provide service for this range. If you want the server specified here to serve the range, you must set `server_association_type` to `MS_SERVER`. |
| `comment` | Optional | Describes the range. |
| `ext_attrs` | Optional | Specifies the set of NIOS extensible attributes that will be attached to the range. |

> ⚠️ **Note**
> ⚠️ 
> ⚠️ When configuring the `options` parameter, you must define the default option `dhcp-lease-time` to avoid the undesirable changes that can occur when the next `terraform apply` command runs. The sub parameters `name`, `num`, and `value` are required. An example block is as follows:  
> ⚠️ `options {`  
> ⚠️ `    name = "dhcp-lease-time"`  
> ⚠️ `    num = 51`  
> ⚠️ `    value = "43200"`  
> ⚠️ `    use_option = false`  
> ⚠️ `}`

## Examples of the IPv4 Range Block

`// creating a Network Range`  
`resource "infoblox_ipv4_range" "range3" {`  
`  start_addr = "192.0.2.20"`  
`  end_addr = "192.0.2.40"`  
`  options {`  
`    name = "dhcp-lease-time"`  
`    value = "43200"`  
`    vendor_class = "DHCP"`  
`    num = 51`  
`    use_option = true`  
`  }`  
`  network = "192.0.0.0/24"`  
`  network_view = "default"`  
`  comment = "test comment"`  
`  name = "test_range"`  
`  disable = false`  
`  member = {`  
`    name = "infoblox.localdomain"`  
`    ipv4addr = "192.168.10.10"`  
`  }`  
`  server_association_type= "MEMBER"`  
`  ext_attrs = jsonencode({`  
`    "Site" = "Blr"`  
`  })`  
`  use_options = true`  
`}`