Skip to content

metalcloud-cli logical-network create

Create a new logical network from configuration

Create a new logical network of the specified kind using configuration from a file or pipe.

This command creates a logical network with the provided configuration. The configuration must be in JSON format and contain all required fields for the specified network kind.

Arguments: kind The type of logical network to create (e.g., vlan, vxlan, flat)

Required Flags: —config-source Source of the logical network configuration (required) Can be ‘pipe’ to read from stdin or path to a JSON file

Configuration Format: The configuration file must contain a JSON object with the network specification. Use ‘config-example’ command to see the expected structure for each kind.

Examples:

metalcloud-cli logical-network create vlan —config-source network.json

cat network.json | metalcloud-cli logical-network create vlan —config-source pipe

Create using generated example (edit as needed)

Section titled “Create using generated example (edit as needed)”

metalcloud-cli logical-network config-example vlan > config.json

metalcloud-cli logical-network create vlan —config-source config.json

metalcloud-cli logical-network config-example vxlan |
jq ‘.label = “my-network”’ |
metalcloud-cli logical-network create vxlan —config-source pipe

metalcloud-cli logical-network create kind [flags]
--config-source string Source of the new logical network configuration. Can be 'pipe' or path to a JSON file.
-h, --help help for create
-k, --api_key string MetalCloud API key
-c, --config string Config file path
-d, --debug Set to enable debug logging
-e, --endpoint string MetalCloud API endpoint
-f, --format string Output format. Supported values are 'text','csv','md','json','yaml'. (default "text")
-i, --insecure_skip_verify Set to allow insecure transport
-l, --log_file string Log file path
-v, --verbosity string Log level verbosity (default "INFO")

Auto generated by spf13/cobra on 11-Aug-2025

Section titled “Auto generated by spf13/cobra on 11-Aug-2025”