ovhcloud_cloud_network_gateway_create.md
February 27, 2026 ยท View on GitHub
ovhcloud cloud network gateway create
Create a gateway in the given cloud project
Synopsis
Use this command to create a new gateway.
Two options are available to create a gateway: - Create a gateway in an existing private network - Create a gateway in a new private network
When creating a gateway in an existing private network, you must specify the network ID and subnet ID using the flags --network-id and --subnet-id. In this case, only two parameters are supported and required: the gateway model and its name (respectively --model and --name flags).
There are three ways to define the parameters:
-
Using only CLI flags:
ovhcloud cloud network gateway create
--name MyGateway --model xl -
Using a configuration file:
First you can generate an example of parameters file using the following command:
ovhcloud cloud network gateway create <region> --init-file ./params.json
You will be able to choose from several examples of parameters. Once an example has been selected, the content is written in the given file. After editing the file to set the correct creation parameters, run:
ovhcloud cloud network gateway create <region> --from-file ./params.json
Note that you can also pipe the content of the parameters file, like the following:
cat ./params.json | ovhcloud cloud network gateway create <region>
In both cases, you can override the parameters in the given file using command line flags, for example:
ovhcloud cloud network gateway create <region> --from-file ./params.json --name MyGateway
3. Using your default text editor:
ovhcloud cloud network gateway create <region> --editor
You will be able to choose from several examples of parameters. Once an example has been selected, the CLI will open your default text editor to update the parameters. When saving the file, the creation will start.
Note that it is also possible to override values in the presented examples using command line flags like the following:
ovhcloud cloud network gateway create <region> --editor --name MyGateway
ovhcloud cloud network gateway create <region> [flags]
Options
--editor Use a text editor to define parameters
--from-file string File containing parameters
-h, --help help for create
--init-file string Create a file with example parameters
--model string Gateway model (s, m, l, xl, 2xl, 3xl)
--name string Name of the gateway
--network-id string ID of the existing private network to create the gateway in
--network-name string Name of the private network
--network-vlan-id int VLAN ID for the private network
--replace Replace parameters file if it already exists
--subnet-allocation-pools strings Allocation pools for the subnet in format start:end
--subnet-cidr string CIDR of the subnet
--subnet-dns-name-servers strings DNS name servers for the subnet
--subnet-enable-dhcp Enable DHCP for the subnet
--subnet-gateway-ip string Gateway IP address for the subnet
--subnet-host-routes strings Host routes for the subnet in format destination:nextHop
--subnet-id string ID of the existing subnet to create the gateway in
--subnet-ip-version int IP version (4 or 6)
--subnet-name string Name of the subnet
--subnet-use-default-public-dns-resolver Use default DNS resolver for the subnet
--wait Wait for gateway creation to be done before exiting
Options inherited from parent commands
--cloud-project string Cloud project ID
-d, --debug Activate debug mode (will log all HTTP requests details)
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
Examples:
--output json
--output yaml
--output interactive
--output 'id' (to extract a single field)
--output 'nested.field.subfield' (to extract a nested field)
--output '[id, "name"]' (to extract multiple fields as an array)
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
--output 'name+","+type' (to extract and concatenate fields in a string)
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
--profile string Use a specific profile from the configuration file
SEE ALSO
- ovhcloud cloud network gateway - Manage gateways in the given cloud project