removeRoute

Prev Next

Available in VPC

Remove the list of routes configured in a route table. Default routes can't be removed.

Syntax

The removeRoute syntax is as follows:

./ncloud vpc removeRoute \
    --vpcNo <vpc-no> \
    --routeTableNo <route-table-no> \
    --routeList <route-list> \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running removeRoute.

Required options

The following options are required for removeRoute.

Options Type Required Description
--vpcNo String Required VPC number
--routeTableNo String Required Route table number
--routeList List Required Route list
  • For each route, enter {field='value'} pairs enclosed in quotes and separated by commas.
    • destinationCidrBlock (required): Destination IPv4 address range. Uses CIDR notation. Example: 0.0.0.0/0, 100.10.20.0/24
    • targetTypeCode (required): Destination type. NATGW (NAT Gateway) | VPCPEERING (VPC peering) | VGW (Virtual Private Gateway)
    • targetNo (required): Destination identification number. Check the list of resources corresponding to each destination type via the API.
    • targetName (required): Destination name. Check the list of resources corresponding to each destination type via the API.
    • See getRouteList.

Common options

For information about the options common to all vpc subcommands, see VPC options.

Examples

If the route removal request is successful, the configuration information for each route is returned.

Command

The command example is as follows:

./ncloud vpc removeRoute \
    --vpcNo 12345678 \
    --routeTableNo 45678901 \
    --routeList "destinationCidrBlock='192.0.2.0/24', targetTypeCode='NATGW', targetNo='56789012', targetName='test-natgw'" \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
  "removeRouteResponse": {
    "totalRows": 2,
    "routeList": [
      {
        "destinationCidrBlock": "0.0.0.0/0",
        "targetName": "INTERNET GATEWAY",
        "routeTableNo": "45678901",
        "targetType": {
          "code": "IGW",
          "codeName": "Internet Gateway"
        },
        "targetNo": "",
        "isDefault": false
      },
      {
        "destinationCidrBlock": "10.0.0.0/16",
        "targetName": "LOCAL",
        "routeTableNo": "45678901",
        "targetType": {
          "code": "LOCAL",
          "codeName": "Local"
        },
        "targetNo": "",
        "isDefault": true
      }
    ],
    "requestId": "a7b8c9d0-e1f2-3456-abcd-789012345678",
    "returnCode": "0",
    "returnMessage": "success"
  }
}