---
title: "infoblox_ipv4_network Data Source"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/53154262/infoblox_ipv4_network%20Data%20Source"
format: markdown
---
The data source for the network object allows you to get the following parameters for an IPv4 network resource:

| **Parameter** | **Description** | **Example** |
| --- | --- | --- |
| `network_view` | <span style="color: #1f2328">The network view in which the network exists.</span> | `nondefault_netview` |
| `cidr` | <span style="color: #1f2328">The network block which corresponds to the network, in CIDR notation.</span> | `192.0.17.0/24` |
| `utilization` | The DHCP utilization. This is the percentage of the total number of available IP addresses belonging to the network versus the total number of all IP addresses in the network. | `3` |
| `options` | An array of DHCP option structs that lists the DHCP options associated with the object. | `{`  
`    name = "dhcp-lease-time"`  
`    value = "43200"`  
`    vendor_class = "DHCP"`  
`    num = 51`  
`    use_option = true`  
`  }` |
| `comment` | A description of the network. This is a regular comment. | `Untrusted network` |
| `ext_attrs` | The set of extensible attributes, if any. The content is formatted as a string of JSON map. | `{\"Owner\":\"State Library\",\"Administrator\":\"unknown\"}` |

To retrieve information about IPv4 networks that match the specified filters, use the `filters` argument and specify the parameters mentioned in the below table. These are the searchable parameters of the corresponding object in Infoblox NIOS WAPI. If you do not specify any parameter, the data source retrieves information about all IPv4 networks in the NIOS Grid.

<span style="color: #3e3f40">The following table describes the parameters you can define in an </span>`infoblox_ipv4_network`<span style="color: #3e3f40"> data source block:</span>

| **Parameter** | <span style="color: #000000">**Alias***</span> | **Description** |
| --- | --- | --- |
| `network` | `cidr` | <span style="color: #000000">Specifies the network block that</span> corresponds to the network, in CIDR notation<span style="color: #000000">. Do not use the IPv6 CIDR for an IPv4 network.</span> |
| `network_view` | `network_view` | Specifies the network view in which the network exists.  
If a value is not specified, matching objects are retrieved from all network views in the NIOS Grid. |
| `comment` | `comment` | <span style="color: #000000">Describes the network.</span> |
| <span style="color: #000000">Extensible Attributes</span> | <span style="color: #000000">-</span> | <span style="color: #000000">Specifies the extensible attributes specified for the network. You must specify the</span> key/value pair within the `filters` argument.  
Example:  
`filters = {`  
`"*Site" = "some test site"`  
`}` |

<span style="color: #172b4d">*Aliases are the parameter names used in the prior releases of Infoblox IPAM Plug-In for Terraform. Do not use the alias names for parameters in the data source blocks. Using them can result in error scenarios.</span>

## Example of an IPv4 Network Data Source Block

`resource "infoblox_ipv4_network" "net2" {`  
`    cidr = "192.168.128.0/20"`  
`    network_view = "nondefault_netview"`  
`    reserve_ip = 5`  
`    gateway = "192.168.128.254"`  
`    comment = "small network for testing"`  
`    ext_attrs = jsonencode({`  
`      "Site" = "bla-bla-bla... testing..."`  
`    })`  
`}`  
  
`data "infoblox_ipv4_network" "nearby_network" {`  
`    filters = {`  
`      network = "192.168.128.0/20"`  
`      network_view = "nondefault_netview"`  
`    }`  
`    // This is just to ensure that the network has been be created`  
`    // using 'infoblox_ipv4_network' resource block before the data source will be queried.`  
`    depends_on = [infoblox_ipv4_network.net2]`  
`}`

`output "ipv4_net1" { `  
`    value = data.infoblox_ipv4_network.nearby_network`  
`}`


`// searching for IPv4 networks by specifying EA's`  
`data "infoblox_ipv4_network" "ipv4_net_ea" {`  
`    filters = {`  
`      "*Site" = "Custom network site"`  
`      "*Site!" = "Office network site"`  
`    }`  
`}`

`// retrieves matching IPv4 networks with EA, if any`  
`output "net_ea_out" { `  
`    value = data.infoblox_ipv4_network.ipv4_net_ea`  
`}`