---
title: "Appendix B: YAML and JSON Templates"
canonical: "https://docs.infoblox.com/space/BloxOneThreatDefense/35408412/Appendix%20B%3A%20YAML%20and%20JSON%20Templates"
format: markdown
---
<span style="color: #000000">This appendix contains sample YAML and JSON templates for the NIOS-X server deployment. To d</span>ownload the <span style="color: #000000">YAML and JSON files, click the following:</span>

| **Deployments** | **Userdata** | **Network Configuration ** | **Metadata** |
| --- | --- | --- | --- |
| **vCenter(ESXi) Hypervisor** |  |  | NA |
| **KVM Hypervisor** |  |  | NA |
| **Hyper-V** |  |  |  |
| **Proxmox Hypervisor** |  |  | NA |
| **Disk resize (all deployments)** |  | NA | NA |

## <span style="color: #000000">YAML File</span>

### Example 1: 

<span style="color: #000000">The following is an example of userdata YAML file and the filename can be named as </span><span style="color: #000000">**userdata or user-data or userdata.yaml**</span><span style="color: #000000">.</span>   
  

```
#cloud-config
host_setup:
  jointoken: your NIOS-X join token
```

<span style="color: #000000">After you download the YAML file, modify it by entering the join token you copied from the portal in the YAML file. The portal uses the IP address, which is displayed on the DNS Forwarding Proxy page of the </span><span style="color: #172b4d">Infoblox</span><span style="color: #000000"> Portal.</span>

### Example 2: 

<span style="color: #000000"> </span>Optionally, to connect the NIOS-X server via an HTTP proxy, set the `access_https_proxy` field. You can also add host tags to associate Infoblox servers with the Infoblox Portal. Optional parameters can include:

- docker_bip
- service_cidr
- cluster_cidr
- ntp_servers
- tags

 

```
#cloud-config
host_setup:
  jointoken: your NIOS-X join token
  docker_bip: 172.xx.xx.0/24
  service_cidr: 10.xx.xx.0/24
  cluster_cidr: 10.xx.xx.0/24
  access_https_proxy: https://[username@password]<ip>:<port>
  ntp_servers: "0.pool.ubuntu.com, 1.2.3.4"
  tags:
    - "env=prod"
    - "color=blue"
```


## Setting up Network Interface with Static IP and Name server

To assign a static IP address and configure nameservers using **YAML-based network config**, create or edit the **network configuration** accordingly. 

> ⚠️ Avoid using subnets smaller than /30 for host interface IP settings to prevent configuration issues. Use a /24 subnet to ensure the gateway IP is within the same subnet and avoid validation errors.

> ⚠️ Do not configure a DNS search domain for NIOS-X hosts; omit the search key from the nameservers section. Infoblox service endpoints are fully qualified, so it adds no benefit — and if one is set, the resolver tries the suffixed name first (for example, csp.infoblox.com.<your-search-domain>), so any answer from your internal DNS, including an empty record, can cause intermittent activation failures or connection to the wrong regional service. Use fully qualified domain names in configuration fields such as NTP, syslog, splunk, and proxy servers.

### Single network interface configuration

The following examples shows network configurations** **for single network interface configurations and dual stack configurations.

**Single network interface Ipv4 DHCP configuration**

 

```
network-config:
  version: 2
  ethernets:
    ens160:
      dhcp4: true
```

**Single network interface Ipv4 static configuration**

 

```
version: 2 
#cloud-config
ethernets: 
  <interface-name>: 
    dhcp4: false
    addresses:
      - 192.168.xxx.222/24
    gateway4: 192.168.xxx.1
    nameservers:
      addresses:
        - 8.x.x.8
        - 1.x.x.1
```

  
Existing section talks about static IPv4 only configuration, 

**Single network interface Dualstack DHCP configuration**

 

```
network-config:
  version: 2
  ethernets:
    ens160:
      dhcp4: true
      dhcp6: true
```

**Single network interface dual-stack based on static IP configuration**

 

```
version: 2
#cloud-config
ethernets:
  eth0:
    dhcp4: false
    dhcp6: false
    addresses:
      - 192.168.xxx.222/24
      - 2001:db8:100::222/64
    gateway4: 192.168.xxx.1
    gateway6: 2001:db8:100::1
    nameservers:
      addresses:
        - 8.x.x.8
        - 1.x.x.
```


### Multiple network interface configuration

Similarly, you can create a network configuration with multiple interfaces as needed.

**Multiple network interface Ipv4 DHCP configuration**

  

```
network-config:
  version: 2
  ethernets:
    ens160:
      dhcp4: true
      dhcp6: true
    ens192:
      dhcp4: true
      dhcp6: true
```

**Multiple network interface static Ipv4 DHCP configuration**

 

```
version: 2
#cloud-config
ethernets:
  eth0:
    dhcp4: false
    dhcp6: false
    addresses:
      - 192.168.xxx.111/24
      - 2001:db8:100::111/64
    gateway4: 192.168.xxx.1
    gateway6: 2001:db8:100::1
    nameservers:
      addresses:
        - 8.x.x.8
        - 1.x.x.1
  eth1:
    dhcp4: false
    dhcp6: false
    addresses:
      - 192.168.xxx.222/24
      - 2001:db8:200::222/64
    gateway4: 192.168.xxx.1
    gateway6: 2001:db8:200::1
    nameservers:
      addresses:
        - 4.x.x.4
```

where <interface-name> is the interface name in a virtual environment such as `enp1s0`, `eth1`, `ens160` or `ens18`.

Similarly, you can create a network configuration with multiple interfaces as needed. The following example shows a dual-stack DHCP configuration.

### Dual-stack multiple network interface configuration

 

```
network-config:
  version: 2
  ethernets:
    ens160:
      dhcp4: true
      dhcp6: true
```

where <interface-name> is the interface name in a virtual environment such as `enp1s0`, `eth1`, `ens160` or `ens18`.

## <span style="color: #000000">JSON File</span>

<span style="color: #000000">After you download the JSON file, complete the following configurations.</span>

## Setting up Network Interface with Static IP and Name server

To assign a static IP address and configure nameservers using **JSON-based network config**, create or edit the network configuration accordingly. 

The following example shows network configuration for a single network interface. 

 

```
{ 
  "network-config": { 
    "version": 2, 
    "ethernets": { 
      "<interface-name>": { 
        "dhcp4": false, 
        "addresses": [ 
          "10.196.xxx.199" 
        ], 
        "gateway4": "10.196.xxx.1", 
        "nameservers": { 
          "addresses": [ 
            "8.x.x.8", 
            "1.x.x.1" 
          ], 
        } 
      } 
    } 
  } 
} 
```

Similarly, you can create network configuration with multiple interfaces as needed.

 

```
{
  "network-config": {
    "version": 2,
    "ethernets": {
      "<interface-name>": {
        "dhcp4": false,
        "addresses": [
          "10.196.xxx.199/24"
        ],
        "gateway4": "10.196.xxx.1",
        "nameservers": {
          "addresses": [
            "8.x.x.8",
            "1.x.x.1"
          ],
        }
      },
      "<interface-name>": {
        "dhcp4": false,
        "addresses": [
          "10.197.xxx.200/24"
        ],
        "nameservers": {
          "addresses": [
            "8.x.x.8",
            "1.x.x.1"
          ],
        }
      }
    }
  }
}
```

## <span style="color: #000000">Setting up Network Interfaces</span>

<span style="color: #000000">To set up network interfaces, use the metadata parameter network-config. The following example illustrates a general format for network configuration. Each element within the config attribute defines the interface, such as vLAN, DNS, or other routing configuration.</span>

 

```
{ 
  "network-config": { 
    "version": 1, 
    "config": [ 
    ] 
  } 
}
```

## <span style="color: #000000">Setting Up Static Interfaces</span>

<span style="color: #000000">To set up static interfaces, provide the specific data within the config attribute. The following is an example:</span>

 

```
{ 
       "name": "ens160", 
       "type": "physical", 
       "subnets": [ 
         { 
           "address": "192.x.x.x", 
           "control": "auto",
           "netmask": "255.255.255.0", 
            "type": "static" 
         } 
       ] 
     }
```

## <span style="color: #000000">Setting Up DHCP Configuration</span>

<span style="color: #000000">Use the following commands to perform DHCP configuration. The following example illustrates how to configure for custom DHCP options:</span>

 

```
"ipv4addrs":[{ 
      "ipv4addr":"func:nextavailableip:x.x.x.x/23", 
      "mac":"aa:bb:xx:11:22:xx" 
      "options" : [{ 
          "name": "host-name", 
          "value": "some.example.net" } 
      }], 
   ]}
```

## <span style="color: #000000">Configuring VLANs</span>

<span style="color: #000000">Optionally, if you want to configure VLANs on the ens160 interface, you can use the commands described in the following example:</span>

 

```
{ 
   "type": "vlan", 
     "name": "ens160.100", 
     "vlan_id": "100", 
     "vlan_link": "ens160", 
     "subnets": [ 
       { 
         "type": "static", 
         "address": “10.x.x.x", 
         "netmask": "255.x.x.x" 
       } 
     ] 
  }
```

> ⚠️ <span style="color: #000000">Only ens160 is enabled at initial start up. You must use the metadata parameter network-config to add additional interface configuration, as described in the previous steps.</span>

## Setting Up Routing Configuration

<span style="color: #000000">You can define routing configuration, as follows:</span>

 

```
{ 
   "type": "route", 
   "destination": "172.x.x.x/16", 
   "gateway": "192.x.x.x", 
   "metric": 6 
 }
```

## <span style="color: #000000">Setting Up a Default Gateway</span>

<span style="color: #000000">To setup a default gateway, define the following commands:</span>

 

```
{ 
   "type": "route", 
   "destination": "0.x.x.x/0", 
   "gateway": "192.x.x.x" 
 }
```

## <span style="color: #000000">Defining MTU and Path MTU Discovery</span>

<span style="color: #000000">Use the following command to define the MTU you want to use and enable path MTU discovery for IPv4 based on your network configuration:</span>

 

```
{
  "type": "dhcp",
  "metric": "0\n    pre-up ip link set dev ens160 mtu 1600\n    pre-up /sbin/sysctl -w net.ipv4.ip_no_pmtu_disc=1"
}
```

<span style="color: #000000">Use the following command to define the MTU you want to use for IPv6 based on your network configuration:  </span>

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

```
{
  "type": "dhcp6",
  "metric": "0\n    pre-up ip6tables -I INPUT -p udp -m udp --dport 546 -j ACCEPT\n   pre-up /sbin/sysctl -w net.ipv6.conf.ens160.autoconf=0\n    post-up /sbin/sysctl -w 
net.ipv6.conf.ens160.mtu=1450\n    post-up ( for i in $(seq 2 ${count:=200}); do /sbin/sysctl -w net.ipv6.conf.ens160.mtu=1450 || true; sleep 3; done ) &"
}
```