---
title: "addRoute"
slug: "cli-vpc-routetable-addroute"
updated: 2026-04-23T08:57:15Z
published: 2026-04-23T08:59:03Z
canonical: "cli.ncloud-docs.com/cli-vpc-routetable-addroute"
---

> ## 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.

# addRoute

<p class="platform-info type-vpc">VPC 환경에서 이용 가능합니다.</p>

## 개요<a name="개요"></a>

라우트 테이블에 라우트 리스트를 추가합니다.

## 요청<a name="요청"></a>

### 요청 파라미터<a name="요청파라미터"></a>

| 파라미터명                            | 필수 여부      | 타입            | 제약 사항               | 설명                                         |
| ---------------------------------- | ------------ | -------------- | --------------------- | ------------------------------------------- |
| regionCode                         | No           | String         |                       | - 리전 코드<br/>라우트가 추가될 라우트 테이블의 리전(Region) 결정 가능<br/>regionCode는 [getRegionList](/docs/cli-vserver-server-common-getregionlist) 액션을 통해 획득 가능<br/>Default : getRegionList 조회 결과의 첫 번째 리전을 선택  |
| vpcNo                              | Yes          | String         |                       | - VPC 번호<br/>라우트가 추가될 라우트 테이블의 VPC를 결정함<br/>vpcNo는 [getVpcList](/docs/cli-vpc-vpcmanagement-getvpclist) 액션을 통해 획득 가능 |
| routeTableNo                       | Yes          | String         |                       | - 라우트 테이블 번호<br/>라우트가 추가될 라우트 테이블 번호를 결정함<br/>routeTableNo는 [getRouteTableList](/docs/cli-vpc-routetable-getroutetablelist) 액션을 통해 획득 가능    |
| routeList.N.destinationCidrBlock   | Yes          | String         |                       | - 목적지 IPv4 CIDR 블록<br/>추가할 라우트의 목적지 IP 주소 범위를 지정함    |
| routeList.N.targetTypeCode         | Yes          | String         |                       | - 목적지 유형 코드<br/>추가할 라우트의 목적지 유형을 결정함<br/>Options : NATGW (NAT Gateway) \| VPCPEERING (VPC Peering) \| VGW (Virtual Private Gateway)  |
| routeList.N.targetNo               | Yes          | String         |                       | - 목적지 식별 번호<br/>목적지 유형에 해당하는 목적지 식별 번호를 결정함<br/>targetNo는 각 목적지 유형에 해당하는 조회 액션을 통해 획득 가능 |
| routeList.N.targetName             | Yes          | String         |                       | - 목적지 이름<br/>목적지 유형에 해당하는 목적지 이름을 입력함<br/>targetName은 각 목적지 유형에 해당하는 조회 액션을 통해 획득 가능  |
| responseFormatType                 | No           | String         |                       | - 응답 결과의 포맷 타입<br/>Options : xml \| json<br/>Default : xml |

## 응답<a name="응답"></a>

### 응답 데이터 타입<a name="응답데이터타입"></a>

- routeList 타입

| RouteList extends CommonResponse |
| ---------- |
| private Integer totalRows; |
| private List<Route> routeList = new ArrayList<>(); |

| Route |
| ---------- |
| private String routeTableNo; |
| private String destinationCidrBlock; |
| private String targetName; |
| private CommonCode targetType; |
| private String targetNo; |
| private Boolean isDefault; |


## 예시<a name="예시"></a>

### 요청 예시<a name="요청예시"></a>

```
ncloud vpc addRoute --regionCode KR --vpcNo ***04 --routeTableNo ***38 --routeList "destinationCidrBlock='***.***.200.0/24', targetTypeCode='NATGW', targetNo='***9734', targetName='test-***'" "destinationCidrBlock='***.***.201.0/24', targetTypeCode='VGW', targetNo='***9735', targetName='test-***'"
```

### 응답 예시<a name="응답예시"></a>

요청 수행 후 해당 라우트 테이블의 라우트 리스트

```xml
<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>
```
