MENU
      addRoute

        addRoute


        Article summary

        Available in VPC

        Add a route to a route table.

        Request

        The following describes the request format for the endpoint. The request format is as follows:

        MethodURI
        GET, POST/addRoute

        Request headers

        For headers common to all VPC APIs, see VPC common headers.

        Request query parameters

        The following describes the parameters.

        FieldTypeRequiredDescription
        regionCodeStringOptionalRegion code of the route table to which you want to add the route
      • First Region of the search result (default)
      • Check through getRegionList
      • vpcNoStringRequiredVPC number of the route table
      • It can be obtained through the getVpcList action
      • routeTableNoStringRequiredRoute table number
      • Check through getRouteTableList
      • routeList.N.destinationCidrBlockStringRequiredRange of destination IPv4 addresses for the route you want to add
      • Use CIDR notation
      • <E.g.> routeList.1.destinationCidrBlock=0.0.0.0/0&routeList.2.destinationCidrBlock=100.10.20.0/24
      • routeList.N.targetTypeCodeStringRequiredDestination type of the route to add
        • NATGW | VPCPEERING | VGW
          • NATGW: NAT Gateway
          • VPCPEERING: VPC Peering
          • VGW: Virtual Private Gateway
          • <E.g.> routeList.1.targetTypeCode=NATGW&routeList.2.targetTypeCode=VPCPEERING
        routeList.N.targetNoStringRequiredDestination identification number of the route to add
      • Check via API to view the list of resources for each destination type
      • <E.g.> routeList.1.targetNo=1234&routeList.2.targetNo=2345
      • routeList.N.targetNameStringRequiredDestination name of the route to add
      • Check via API to view the list of resources for each destination type
      • <E.g.> routeList.1.targetName=test-natgateway&routeList.2.targetName=test-peering
        responseFormatTypeStringOptional

        Request example

        The following is a sample request.

        curl --location 'https://ncloud.apigw.ntruss.com/vpc/v2/addRoute
        ?regionCode=KR
        &vpcNo=***04
        &routeTableNo=***38
        &routeList.1.destinationCidrBlock=***.***.200.0/24
        &routeList.1.targetTypeCode=NATGW
        &routeList.1.targetNo=***9734
        &routeList.1.targetName=test-***
        --header 'x-ncp-apigw-timestamp: {Timestamp}'
        --header 'x-ncp-iam-access-key: {Access Key}'
        --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
        Curl

        Response

        The following describes the response format.

        Response body

        See RouteList for the response body.

        Response status codes

        For response status codes common to NAVER Cloud Platform, see Ncloud API response status codes.

        Response example

        The following is a sample response.

        <addRouteResponse>
          <requestId>2b97f2f0-39fc-40f0-9a8d-3eb6d40506e3</requestId>
          <returnCode>0</returnCode>
          <returnMessage>success</returnMessage>
          <totalRows>3</totalRows>
          <routeList>
            <route>
              <destinationCidrBlock>***.***.200.0/24</destinationCidrBlock>
              <targetName>test-***</targetName>
              <routeTableNo>***38</routeTableNo>
              <targetType>
                <code>NATGW</code>
                <codeName>NAT Gateway</codeName>
              </targetType>
              <targetNo>***9734</targetNo>
              <isDefault>false</isDefault>
            </route>
            <route>
              <destinationCidrBlock>***.***.0.0/16</destinationCidrBlock>
              <targetName>LOCAL</targetName>
              <routeTableNo>***38</routeTableNo>
              <targetType>
                <code>LOCAL</code>
                <codeName>Local</codeName>
              </targetType>
              <targetNo></targetNo>
              <isDefault>true</isDefault>
            </route>
            <route>
              <destinationCidrBlock>***.***.0.0/0</destinationCidrBlock>
              <targetName>INTERNET GATEWAY</targetName>
              <routeTableNo>***38</routeTableNo>
              <targetType>
                <code>IGW</code>
                <codeName>Internet Gateway</codeName>
              </targetType>
              <targetNo></targetNo>
              <isDefault>true</isDefault>
            </route>
          </routeList>
        </addRouteResponse>
        XML

        Was this article helpful?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.