--- title: "assignSecondaryIps" slug: "compute-vserver-networkinterface-assignsecondaryips" updated: 2026-09-17T09:57:39Z published: 2026-09-17T09:57:39Z canonical: "api.ncloud-docs.com/compute-vserver-networkinterface-assignsecondaryips" --- > ## Documentation Index > Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # assignSecondaryIps VPC環境で利用できます。 ネットワークインターフェースに Secondary IPアドレスを割り当てます。 ## リクエスト リクエスト形式を説明します。リクエスト形式は次の通りです。 | メソッド | URI | | --- | --- | | GET \| POST | /vserver/v2/assignSecondaryIps | 参考 ガイドは GETメソッドを基準に説明します。POSTメソッドの呼び出しテストは、NAVERクラウドプラットフォームコンソールの API Gatewayサービスの Swaggerで行えます。 ### リクエストヘッダ Server APIで共通して使用されるヘッダの詳細は、[Serverのリクエストヘッダ](/docs/ja/compute-vserver#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94)をご参照ください。 ### リクエストクエリパラメータ リクエストクエリパラメータの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `regionCode` | String | Optional | リージョンコード - [getRegionList](/docs/ja/compute-vserver-server-common-getregionlist)を参照 - 照会結果の最初のリージョン(デフォルト) | | `networkInterfaceNo` | String | Required | ネットワークインターフェース番号 - [getNetworkInterfaceList](/docs/ja/compute-vserver-networkinterface-getnetworkinterfacelist)を参照 | | `secondaryIpList.N` | Array | Conditional | Secondary IPアドレスリスト - Subnetの IPアドレス範囲内で最大5個まで入力可能 - `secondaryIpCount`を含めて少なくとも1個は必ず入力 - <例> `secondaryIpList.1=192.168.0.1&secondaryIpList.2=192.168.0.2` | | `secondaryIpCount` | Integer | Conditional | Secondary IPアドレスの自動割り当て数 - 0~5 - Private IPアドレスを順次自動割り当て - `secondaryIpList`を含めて少なくとも1個は必ず入力 - ネットワークインターフェースごとに最大5個まで入力可能 | | `allowReassign` | Boolean | Optional | 明示的な再割り当てを許可するかどうか - `true` \| `false` (デフォルト) - `true`: Secondary IPアドレスが既に使用中の場合、再割り当て - `false`: Secondary IPアドレスが既に使用中の場合、エラーが発生 - `secondaryIpList`で指定した IPアドレスにのみ適用 | | `responseFormatType` | String | Optional | レスポンスデータの形式 - `xml`(デフォルト) \| `json` | ### リクエスト例 リクエストのサンプルコードは次の通りです。 ``` curl --location --request GET 'https://ncloud.apigw.ntruss.com/vserver/v2/assignSecondaryIps ?regionCode=KR &networkInterfaceNo=70***6 &secondaryIpList.1=10.0.10.11 &secondaryIpCount=1 &allowReassign=true &responseFormatType=json' \ --header 'x-ncp-apigw-timestamp: {Timestamp}' \ --header 'x-ncp-iam-access-key: {Access Key}' \ --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' ``` ## レスポンス レスポンス形式を説明します。 ### レスポンスボディ レスポンスボディの説明は次の通りです。 | フィールド | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `assignSecondaryIpsResponse` | Object | - | レスポンス結果 - [NetworkInterfaceList](/docs/ja/common-vapidatatype-networkinterfacelist)を参照 | | `assignSecondaryIpsResponse.requestId` | String | - | リクエスト ID - UUID形式 | | `assignSecondaryIpsResponse.returnCode` | String | - | レスポンスコード | | `assignSecondaryIpsResponse.returnMessage` | String | - | レスポンスメッセージ | ### レスポンスステータスコード Server APIで共通して使用されるレスポンスステータスコードの詳細は、[Serverのレスポンスステータスコード](/docs/ja/compute-vserver#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C)をご参照ください。 ### レスポンス例 レスポンスのサンプルコードは次の通りです。 ``` { "assignSecondaryIpsResponse": { "totalRows": 1, "networkInterfaceList": [ { "networkInterfaceNo": "70***6", "networkInterfaceName": "nic-70***6", "subnetNo": "3***4", "deleteOnTermination": true, "isDefault": true, "deviceName": "eth0", "networkInterfaceStatus": { "code": "SET", "codeName": "設定中" }, "instanceType": { "code": "VSVR", "codeName": "Server (VPC)" }, "instanceNo": "10*****18", "ip": "10.0.10.6", "macAddress": "F2:**:**:**:**:AC", "enableFlowLog": false, "accessControlGroupNoList": [ "1***1" ], "networkInterfaceDescription": "", "secondaryIpList": [ "10.0.10.11", "10.0.10.8" ] } ], "requestId": "7c0d1b29-****-****-****-876342a60d6f", "returnCode": "0", "returnMessage": "success" } } ```