Skip to content

Create Subnet

INFO

To learn more, see Networks and Subnets or Subnet Addressing.

A Subnet is one segment of a Network. It defines how Machines get an address on it (DHCP or IPAM) and further network configuration (DNS servers, NTP servers, MTU, routes, ...)

Create a Subnet

  1. Navigate to the Network, select the tab Subnets and click Create Subnet.
  2. Configure the properties, as described in DHCP or IPAM.
  3. Click Create.

WARNING

Subnets are immutable. To change one, use ActionsCopy to start a new Subnet from it. Then, roll the affected Machines onto an updated Network Profile that uses the new Subnet.

Terraform

Reference

DHCP

terraform
# a DHCP server on the segment hands out the addresses
resource "meltcloud_subnet" "workload_dhcp" {
  network_id = meltcloud_network.example.id
  name       = "workload"
  addressing = "dhcp"

  # settings to override, or to add where the DHCP server delivers none
  # example: MTU not set by DHCP, let's set it for jumbo frames:
  mtu = 9000
}

Example using VLANs:

terraform
# DHCP with VLAN specified
resource "meltcloud_subnet" "storage_dhcp" {
  network_id = meltcloud_network.example.id
  name       = "storage"
  addressing = "dhcp"

  vlan = 300

  # settings to override, or to add where the DHCP server delivers none
  # example: additional routes, not provided by dhcp
  route {
    destination = "10.30.0.0/16"
    via         = "10.20.0.254"
    metric      = 200
  }
}

IPAM

terraform
# an IPAM subnet
resource "meltcloud_subnet" "workload_ipam" {
  network_id = meltcloud_network.example.id
  name       = "workload"
  addressing = "ipam"

  ip_pool_id = meltcloud_ip_pool.example.id
  gateway    = "10.20.0.1"
  dns        = ["10.20.0.53", "10.20.0.54"]
  ntp        = ["10.20.0.60"]
  domains    = ["lab.example.com"]
}

A tagged segment with its own IP Pool:

terraform
# a tagged segment addressed by meltcloud, with its own pool
resource "meltcloud_subnet" "storage_ipam" {
  network_id = meltcloud_network.example.id
  name       = "storage"
  addressing = "ipam"

  ip_pool_id = meltcloud_ip_pool.storage.id
  vlan       = 300
  gateway    = "10.30.0.1"
  dns        = ["10.20.0.53", "10.20.0.54"]
  mtu        = 9000 # jumbo frames
}