---
title: "infoblox_ipv4_shared_network Resource"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/1383268725/infoblox_ipv4_shared_network%20Resource"
format: markdown
---
This resource enables you to perform create, update, and delete operations on shared networks. When you create a shared network, the DHCP server can assign IP addresses to client requests from any subnet (that resides on the same network interface) in the shared network.

The following table describes the parameters you can define in a shared network resource block:

| **Parameter** | **Required/**  
**Optional** | **Description** |
| --- | --- | --- |
| `name` | Required | Specifies the name of the IPv4 shared network object. |
| `networks` | Required | Specifies the list of networks belonging to the shared network. |
| `network_view` | Optional | Specifies the network view in which the shared network must reside.  
If a value is not specified, `default` will be used as the network view name. |
| `disable` | Optional | Determines whether the shared network object is disabled.  
The default value is `false`, which means the object is enabled. |
| `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`. |
| `options` | Optional | Specifies an array of DHCP option structs that lists the DHCP options associated with the object. You can set the following sub parameters for every DHCP option:<br>- `name` (required): Specifies the name of a DHCP option.  
Example: `domain-name-servers`.
- `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`. |
| `comment` | Optional | Describes the shared network. |
| `ext_attrs` | Optional | Specifies the set of NIOS extensible attributes that will be attached to the shared network. |

> ⚠️ **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 Shared Network Block

`// shared network with minimum set of parameters`  
`resource "infoblox_ipv4_shared_network" "shared_network_min_parameters" {`  
`  name = "shared-network1"`  
`  networks = ["10.9.3.0/24"]`  
`}`  


`// shared network with full set of parameters`  
`resource "infoblox_ipv4_shared_network" "shared_network_full_parameters" {`  
`  name = "shared-network2"`  
`  comment = "test ipv4 shared network record"`  
`  networks = ["10.7.3.0/24","10.8.3.0/24"]`  
`  network_view = "view2"`  
`  disable = false`  
`  ext_attrs = jsonencode({`  
`    "Site" = "Tokyo"`  
`  })`  
`  use_options = false`  
`  options {`  
`    name = "domain-name-servers"`  
`    value = "10.9.3.0"`  
`    vendor_class = "DHCP"`  
`    num = 6`  
`    use_option = true`  
`  }`  
`}`