createSubnet

Prev Next

Available in VPC

Create a subnet according to the user-defined conditions.

Syntax

The createSubnet syntax is as follows:

./ncloud vpc createSubnet \
    --vpcNo <vpc-no> \
    --zoneCode <zone-code> \
    --subnet <subnet-ip-range> \
    --subnetTypeCode <PUBLIC|PRIVATE> \
    --networkAclNo <network-acl-no> \
    [--subnetName <subnet-name>] \
    [--usageTypeCode <GEN|LOADB|BM|NATGW>] \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running createSubnet.

Required options

The following options are required for createSubnet.

Options Type Required Description
--vpcNo String Required VPC number
--zoneCode String Required Zone code
--subnet String Required IP address range
  • /16-/28
  • Uses private range (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).
--subnetTypeCode String Required Subnet type code
  • PUBLIC | PRIVATE
    • PUBLIC: Allows internet gateway.
    • PRIVATE: Does not allow internet gateway.
--networkAclNo String Required Network ACL number

Optional options

These are the optional options for createSubnet. Options that are not specified will use their default values.

Options Type Required Description
--subnetName String Optional Subnet name
  • Enter 3-30 characters, including lowercase English letters, numbers, and special character -.
  • The string must begin with an English letter and end with an English letter or number.
  • If not entered, NAVER Cloud Platform will assign one automatically.
--usageTypeCode String Optional Subnet usage type code
  • GEN | LOADB | BM | NATGW
    • GEN: General
    • LOADB: Load balancer only
    • BM: Bare metal only
    • NATGW: NAT Gateway only

Common options

For information about the options common to all vpc subcommands, see VPC options.

Examples

If the subnet creation request is successful, the subnet's configuration information and creation status are returned.

Command

The command example is as follows:

./ncloud vpc createSubnet \
    --vpcNo 12345678 \
    --zoneCode KR-1 \
    --subnet 10.0.1.0/24 \
    --subnetTypeCode PUBLIC \
    --networkAclNo 34567890 \
    --subnetName test-subnet-01 \
    --usageTypeCode GEN \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
  "createSubnetResponse": {
    "totalRows": 1,
    "subnetList": [
      {
        "subnetNo": "23456789",
        "vpcNo": "12345678",
        "zoneCode": "KR-1",
        "subnetName": "test-subnet-01",
        "subnet": "10.0.1.0/24",
        "subnetStatus": {
          "code": "CREATING",
          "codeName": "Creating"
        },
        "createDate": "2026-07-07T14:12:27+0900",
        "subnetType": {
          "code": "PUBLIC",
          "codeName": "Public"
        },
        "usageType": {
          "code": "GEN",
          "codeName": "General"
        },
        "networkAclNo": "34567890"
      }
    ],
    "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "returnCode": "0",
    "returnMessage": "success"
  }
}