--- title: "attachNetworkInterface" slug: "cli-vserver-networkinterface-attachnetworkinterface" updated: 2026-09-17T10:11:00Z published: 2026-09-17T10:11:00Z canonical: "cli.ncloud-docs.com/cli-vserver-networkinterface-attachnetworkinterface" --- > ## 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. # attachNetworkInterface VPC環境で利用できます。 ネットワークインターフェースをサーバインスタンスに割り当てます。 ## 構文 `attachNetworkInterface`構文は次の通りです。 ``` ./ncloud vserver attachNetworkInterface \ --subnetNo \ --networkInterfaceNo \ --serverInstanceNo \ [--regionCode ] \ [--output ] ``` ## オプション `attachNetworkInterface`の実行時に指定できるオプションについて説明します。 ### 必須オプション `attachNetworkInterface`の必須オプションです。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--subnetNo` | String | Required | Subnet番号 - [getSubnetList](/docs/ja/cli-vpc-subnetmanagement-getsubnetlist)を参照 | | `--networkInterfaceNo` | String | Required | ネットワークインターフェース番号 - デフォルトのネットワークインターフェースを含め、最大3個まで割り当て可能 - [getNetworkInterfaceList](/docs/ja/cli-vserver-networkinterface-getnetworkinterfacelist)を参照 | | `--serverInstanceNo` | String | Required | サーバインスタンス番号 - [getServerInstanceList](/docs/ja/cli-vserver-server-getserverinstancelist)を参照 | ### 共通オプション `vserver`コマンドで共通して使用するオプションについては、[Server (VPC)のオプション](/docs/ja/cli-vserver#%EC%98%B5%EC%85%98)をご参照ください。 ## 例 ネットワークインターフェースの割り当てリクエストが成功すると、ネットワークインターフェースの最新情報が返されます。 ### コマンド コマンドの例は次の通りです。 ``` ./ncloud vserver attachNetworkInterface \ --subnetNo 23456789 \ --networkInterfaceNo 56789012 \ --serverInstanceNo 34567890 \ --regionCode KR \ --output json ``` ### 出力 出力の例は次の通りです。 ``` { "attachNetworkInterfaceResponse": { "totalRows": 1, "networkInterfaceList": [ { "networkInterfaceNo": "56789012", "networkInterfaceName": "test-nic-01", "subnetNo": "23456789", "deleteOnTermination": false, "isDefault": false, "deviceName": "eth1", "networkInterfaceStatus": { "code": "SET", "codeName": "設定中" }, "instanceType": { "code": "VSVR", "codeName": "Server (VPC)" }, "instanceNo": "34567890", "ip": "192.0.2.10", "macAddress": "F2:20:AF:00:00:01", "enableFlowLog": false, "accessControlGroupNoList": [], "networkInterfaceDescription": "Test network interface", "secondaryIpList": [ "192.0.2.11" ] } ], "requestId": "e4f56789-0123-4567-ef01-456789012345", "returnCode": "0", "returnMessage": "success" } } ```