--- title: "assignSecondaryIps" slug: "cli-vserver-networkinterface-assignsecondaryips" updated: 2026-09-17T10:11:00Z published: 2026-09-17T10:11:00Z canonical: "cli.ncloud-docs.com/cli-vserver-networkinterface-assignsecondaryips" --- > ## 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. # assignSecondaryIps VPC環境で利用できます。 ネットワークインターフェースに Secondary IPアドレスを割り当てます。 ## 構文 `assignSecondaryIps`構文は次の通りです。 ``` ./ncloud vserver assignSecondaryIps \ --networkInterfaceNo \ --secondaryIpList \ --secondaryIpCount \ [--allowReassign ] \ [--regionCode ] \ [--output ] ``` ## オプション `assignSecondaryIps`の実行時に指定できるオプションについて説明します。 ### 必須オプション `assignSecondaryIps`の必須オプションです。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--networkInterfaceNo` | String | Required | ネットワークインターフェース番号 - [getNetworkInterfaceList](/docs/ja/cli-vserver-networkinterface-getnetworkinterfacelist)を参照 | | `--secondaryIpList` | List | Conditional | Secondary IPアドレスリスト - スペースで区切って複数入力可能 (例: `--secondaryIpList 192.168.0.1 192.168.0.2`) - Subnetの IPアドレスの範囲内で最大5個まで入力可能 - `secondaryIpCount`を含めて少なくとも1個は必ず入力 | | `--secondaryIpCount` | Integer | Conditional | Secondary IPアドレスの自動割り当て数 - 0~5 - Private IPアドレスを順次自動割り当て - `secondaryIpList`を含めて最大5個まで入力可能 - `secondaryIpList`を含めて少なくとも1個は必ず入力 | ### 任意オプション `assignSecondaryIps`の任意オプションです。指定しない場合、オプションにはデフォルト値が適用されます。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--allowReassign` | Boolean | Optional | 再割り当てを許可するか - `true` \| `false` (デフォルト) - `true`: Secondary IPアドレスが既に使用中の場合、再割り当て - `false`: Secondary IPアドレスが既に使用中の場合、エラーが発生 - `secondaryIpList`で指定した IPアドレスにのみ適用 | ### 共通オプション `vserver`コマンドで共通して使用するオプションについては、[Server (VPC)のオプション](/docs/ja/cli-vserver#%EC%98%B5%EC%85%98)をご参照ください。 ## 例 ネットワークインターフェースへの Secondary IPアドレスの割り当てリクエストが成功すると、ネットワークインターフェースの構成情報と割り当てられた Secondary IPアドレスリストが返されます。 ### コマンド コマンドの例は次の通りです。 ``` ./ncloud vserver assignSecondaryIps \ --networkInterfaceNo 56789012 \ --secondaryIpList 192.0.2.13 192.0.2.14 \ --regionCode KR \ --output json ``` ### 出力 出力の例は次の通りです。 ``` { "assignSecondaryIpsResponse": { "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": [ "67890123" ], "networkInterfaceDescription": "Test network interface", "secondaryIpList": [ "192.0.2.11", "192.0.2.13", "192.0.2.14" ] } ], "requestId": "17890123-4567-8901-1234-789012345678", "returnCode": "0", "returnMessage": "success" } } ```