--- title: "addPortForwardingRules" slug: "compute-server-addportforwardingrules" tags: ["Server", "PortForwarding"] updated: 2026-09-17T10:06:00Z published: 2026-09-17T10:06:00Z canonical: "api.ncloud-docs.com/compute-server-addportforwardingrules" --- > ## 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. # addPortForwardingRules ## Overview Add a port forwarding rule. You can add a port forwarding rule to your server so that you can access it using the public IP and port you have set. ## Request ### Request parameters | Parameter name | Required | Type | Restrictions | Description | | --- | --- | --- | --- | --- | | portForwardingConfigurationNo | Yes | String | | - Port forwarding configuration number portForwardingConfigurationNo can be obtained through the getPortForwardingRuleList action. | | portForwardingRuleList.N.serverInstanceNo | Yes | List | | - Port forwarding rule list.N.Server instance number Instance number of server to be set port forwarding for serverInstanceNo can be obtained through the getServerInstanceList action. e.g., portForwardingRuleList.1.serverInstanceNo=1088217 | | portForwardingRuleList.N.portForwardingExternalPort | Yes | List | Min: 1, Max: 65534 | - Port forwarding rule list.N.Port forwarding external port External port to connect to via port forwarding The external port number range is 1024 to 65,534 and is used for service purposes in addition to the feature for server access. e.g., portForwardingRuleList.1.portForwardingExternalPort=9090 | | portForwardingRuleList.N.portForwardingInternalPort | Yes | List | Min: 1, Max: 65534 | - Port forwarding rule list.N.Port forwarding internal port Internal port to connect to via port forwarding Only the following ports can be entered `[Linux: 22 \ Windows: 3389]` e.g., portForwardingRuleList.1.portForwardingInternalPort=22 | | responseFormatType | No | String | | - Format type of the response result Options: xml \| json Default: xml | ## Response ### Response body - [PortForwardingRuleList](/docs/en/common-apidatatype-portforwardingrulelist) ## Examples ### Request example ``` GET {SERVER_API_URL}/addPortForwardingRules ?portForwardingConfigurationNo=31260 &portForwardingRuleList.1.serverInstanceNo=1088217 &portForwardingRuleList.1.portForwardingExternalPort=9090 &portForwardingRuleList.1.portForwardingInternalPort=22 ``` ### Response example ``` 1e50cd88-32cb-422d-bf63-fefbbbb805bc 0 success 1 31260 106.10.51.90 3 KR-2 KR-2 Pyeongchon zone 1 9090 22 1088217 s167545541a3 4 8589934592 53687091200 LNX32 Linux 32 Bit juhoon-kim false 10.41.83.168 centos-6.3-32 RUN Server run state NULL Server NULL OP running 2018-11-27T17:42:13+0900 2018-11-27T18:35:47+0900 SPSW0LINUX000032 SPSVRSTAND000005 false 106.10.51.90 9090 22 3 KR-2 KR-2 Pyeongchon zone 1 1 KR Korea NET Network Storage HDD HDD STAND Standard 39995 ncloud-default-acg Default AccessControlGroup true 2018-04-09T11:12:54+0900 ``` ## Errors Errors that may occur while using this action are listed below. For more information about common errors, see [NAVER Cloud Platform API](/docs/en/common-ncpapi-index). | HTTP Response Code | Return code | Return message | | --- | --- | --- | | 400 | 26035 | Not found certificateName. Please check your input parameter. | | 400 | 25033 | Currently port forwarding setting is being created/ modifying/ deleting. Please try again a few seconds later. | | 400 | 24068 | {0} cannot be controlled. instanceNo = {1} | | 400 | 24069 | Invalid internal port has been configured. Usable internal port(LINUX type : 22, WINDOWS type : 3389) | | 400 | 24070 | A single external port number is used in multiple rules. External port number : {0} | | 400 | 24071 | Single server is existing in multiple rules. Server IP address : {0} | | 400 | 24074 | External internal port as well as server instance number are not designated to port forward rule. |