Documentation Index

Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

createNetworkInterface

Prev Next

Available in VPC

Create a network interface.

Syntax

The createNetworkInterface syntax is as follows:

./ncloud vserver createNetworkInterface \
    --vpcNo <vpc-no> \
    --subnetNo <subnet-no> \
    --accessControlGroupNoList <acg-no-list> \
    [--serverInstanceNo <server-instance-no>] \
    [--isBareMetal <true|false>] \
    [--networkInterfaceName <nic-name>] \
    [--networkInterfaceDescription <nic-description>] \
    [--ip <ip>] \
    [--secondaryIpList <secondary-ip-list>] \
    [--secondaryIpCount <secondary-ip-count>] \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running createNetworkInterface.

Required options

The following options are required for createNetworkInterface.

Options Type Required Description
--vpcNo String Required VPC number
--subnetNo String Required Subnet number
--accessControlGroupNoList List Required ACG number list
--serverInstanceNo String Conditional Server instance number
  • Can be assigned to the server only if it is a network interface on a private subnet.
  • See getServerInstanceList.

Optional options

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

Options Type Required Description
--isBareMetal Boolean Optional Whether it is a network interface for bare metal servers
  • true | false (default)
    • true: For bare metal servers (serverInstanceNo required)
    • false: General
  • Network interfaces for bare metal servers can't be created on general subnets.
--networkInterfaceName String Optional Network interface name
  • Automatically generated if not entered.
  • Enter 3-30 characters using a combination of lowercase English letters, numbers, and special character -.
  • The string must start with a lowercase English letter and end with a lowercase English letter or a number.
--networkInterfaceDescription String Optional Network interface description (byte)
  • 0-1000
--ip String Optional Primary IP address
  • Automatically assigned if not entered.
  • Enter in the subnet IP's address range.
  • Subnet's 0-5th and last IP addresses can't be used.
  • Can't duplicate IP addresses within the subnet range.
--secondaryIpList List Optional Secondary IP list
  • You can enter multiple items separated by spaces. (e.g., --secondaryIpList 192.168.0.1 192.168.0.2)
  • Enter in the subnet IP's address range.
  • Up to 5 can be entered including secondaryIpCount.
  • Can't duplicate IP addresses within the subnet range.
--secondaryIpCount Integer Optional Number of auto-assigned secondary IPs
  • 0-5
  • Automatically assign private IPs sequentially.
  • Up to 5 can be entered including secondaryIpList.

Common options

For information about the options common to all vserver subcommands, see Server (VPC) options.

Examples

If the request to create a network interface is successful, the network interface's identification information and network configuration are returned.

Command

The command example is as follows:

./ncloud vserver createNetworkInterface \
    --vpcNo 12345678 \
    --subnetNo 23456789 \
    --accessControlGroupNoList 67890123 \
    --networkInterfaceName test-nic-01 \
    --networkInterfaceDescription "Test network interface" \
    --secondaryIpCount 1 \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
  "createNetworkInterfaceResponse": {
    "totalRows": 1,
    "networkInterfaceList": [
      {
        "networkInterfaceNo": "56789012",
        "networkInterfaceName": "test-nic-01",
        "subnetNo": "23456789",
        "deleteOnTermination": false,
        "isDefault": false,
        "deviceName": "",
        "networkInterfaceStatus": {
          "code": "NOTUSED",
          "codeName": "Not used"
        },
        "ip": "192.0.2.10",
        "macAddress": "F2:20:AF:00:00:01",
        "enableFlowLog": false,
        "accessControlGroupNoList": [
          "67890123"
        ],
        "networkInterfaceDescription": "Test network interface",
        "secondaryIpList": [
          "192.0.2.11"
        ]
      }
    ],
    "requestId": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
    "returnCode": "0",
    "returnMessage": "success"
  }
}