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
|
--subnetTypeCode |
String | Required | Subnet type code
|
--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
|
--usageTypeCode |
String | Optional | Subnet usage type code
|
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"
}
}