Hetzner hcloud icon

Hetzner hcloud

Interact with the cloud api of the german infrastructure provider Hetzner.

Actions47

Network → Create

AI-generated

Summary

Create a new network in Hetzner Cloud with specified name, IP range, optional routes, subnets, labels, and an option to expose routes to the network's vSwitch.

Inputs

  • name (required) — Name of the network to create.
  • ip_range (required) — IP range of the network in CIDR notation (e.g., '10.0.0.0/16').
  • expose_routes_to_vswitch — Boolean flag to expose routes to the network's vSwitch; defaults to false.
  • routes — Array of preset routes for the network, each with destination IP range and gateway IP.
  • subnets — Array of subnets to be created within the network; each subnet includes IP range, network zone, type, and optionally a Vswitch ID.
  • labels — Key-value pairs to label the network for identification or categorization.

Output shape

a single object representing the created network, including its properties and configuration.

The operation returns the full representation of the newly created network. Optional fields like routes, subnets, and labels are included if provided. If the creation fails, an error will be thrown.

Examples

Example 1: Create a basic network with name and IP range

Set 'name' to 'example network' and 'ip_range' to '10.0.0.0/16'. Leave other parameters as default.

Example 2: Create a network with a subnet and labels

Provide 'name', 'ip_range', add a subnet with its IP range and zone, and add user-defined labels as key-value pairs.

Links

Discussion