Document toolboxDocument toolbox

Appendix B: YML and JSON Templates

This appendix contains sample YML and JSON templates for the server deployment. To download the zip file for both the YML and JSON files, click here.

YML File

As an administrator, create the userdata.yml file.

After you download the YML file, modify it as follows:

#cloud-config
host_setup:
jointoken: "YOUR JOIN TOKEN"

Enter the join token you copied from the portal in the YML file. The portal uses the IP address, which is displayed on the DNS Forwarding Proxy page of the Infoblox Portal, to connect to the proxy.

Optionally, you can add host tags to associate Infoblox servers with the Infoblox Portal, as follows:

#cloud-config
host_setup:
   jointoken: "your BloxOne join token”

   access_https_proxy: “http://proxy_ip:port”

   tags:

    - "demo=toi"
    - “product=example”

JSON File

After you download the JSON file, complete the following configurations.

Setting up Network Interfaces

To set up network interfaces, use the meta data 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.


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

Setting Up Static Interfaces

To set up static interfaces, provide the specific data within the config attribute. The following is an
example:

     { 
"name": "ens160",
"type": "physical",
"subnets": [
{
"address": "192.168.10.1",
"control": "auto",
"netmask": "255.255.255.0",
"type": "static"
}
]
}

Setting Up DNS Configuration

Use the following commands to perform DNS configuration. Note that only the address parameter is
mandatory; search is optional.

 { 
"type": "nameserver",
"
address": [
"10.xxx.x.x",
"10.xxx.x.x"
],
"search": [
"example.abc.com"
]
}

Setting Up DHCP Configuration

Use the following commands to perform DHCP configuration. The following example illustrates how to configure for custom DHCP options:

  "ipv4addrs":[{ 
"ipv4addr":"func:nextavailableip:x.x.x.x/23",
"mac":"aa:bb:cc:11:22:55"
"options" : [{
"name": "host-name",
"value": "test003.domain.net" }
}],
]}

Configuring VLANs

Optionally, if you want to configure VLANs on the ens160 interface, you can use the commands described in the following example:

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

Note

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.


Setting Up Routing Configuration

       You can define routing configuration, as follows:

 { 
"type": "route",
"destination": "172.28.0.0/16",
"gateway": "192.168.10.254",
"metric": 6
}

Setting Up a Default Gateway

To setup a default gateway, define the following commands:

 { 
"type": "route",
"destination": "0.0.0.0/0",
"gateway": "192.168.0.100"
}

Defining MTU and Path MTU Discovery

Use the following command to define the MTU you want to use and enable path MTU discovery for IPv4 based on your network configuration:

     {
      "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"
    }

        Use the following command to define the MTU you want to use for IPv6 based on your network configuration:     

    {
    "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 ) &"

    }