> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing routing tables and routes

By default, Nebius AI Cloud routes egress traffic from your resources according to the [default routing rules](/vpc/routing/overview#default-routing-rules). You can configure routing by creating and managing routing tables (route tables) and routes. For more details on how routing works, see [Routing in Nebius AI Cloud](/vpc/routing/overview).

## Prerequisites

<Tabs>
  <Tab title="Web console">
    Make sure you are in a [group](/iam/authorization/groups/index) that has at least the `editor` role within your tenant or project; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
  </Tab>

  <Tab title="CLI">
    1. [Install and configure the Nebius AI Cloud CLI](/cli/quickstart).
    2. Make sure you are in a [group](/iam/authorization/groups/index) that has at least the `editor` role within your tenant or project; for example, the default `editors` group. You can check this in the [Administration → IAM](https://console.nebius.com/iam) section of the web console.
  </Tab>
</Tabs>

## Creating routing tables

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/networking.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=7a4fe6d935f68131371d7b49a9bd595f" width="16" height="16" data-path="_assets/sidebar/networking.svg" /> **Networking** → **Virtual Networks**.

    2. Select the network for which you want to create a routing table.

       You can only assign a routing table to subnets within this network.

    3. Click **Create** and select **Routing table**.

    4. In the window that opens:

       1. Enter a name for the routing table.
       2. (Optional) Select the subnets within this network that you want to assign to the routing table. You can also [assign a routing table to subnets](#assigning-routing-tables-to-subnets) later.

    5. Click **Create**.
       The new routing table should appear on the **Routing tables** tab.
  </Tab>

  <Tab title="CLI">
    To create a routing table, run the following command:

    ```bash theme={null}
    nebius vpc route-table create \
      --name <name> \
      --network-id <network_ID>
    ```

    In the command, specify the following parameters:

    * `--name`: Name of the routing table.
    * `--network-id`: [ID of the network](/vpc/networking/resources#how-to-get-a-network-id) for which you are creating the routing table. You can only assign a routing table to subnets within this network.

    Routing tables are created empty. After creating a routing table, [add routes to it](#adding-routes-to-routing-tables) and then [assign it to subnets](#assigning-routing-tables-to-subnets).
  </Tab>
</Tabs>

## Adding routes to routing tables

Routes support different next hop options. You can set the next hop to an [allocation](/vpc/overview#allocation) or to the [internet through the default egress gateway](/vpc/routing/overview#default-egress-gateway). For more information, see [Routing in Nebius AI Cloud](/vpc/routing/overview).

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/networking.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=7a4fe6d935f68131371d7b49a9bd595f" width="16" height="16" data-path="_assets/sidebar/networking.svg" /> **Networking** → **Virtual Networks**.

    2. Select the network that contains the routing table and switch to the **Routing tables** tab.

    3. Select the routing table to which you want to add a route.

    4. Click **Add route**.

    5. In the window that opens:

       1. Enter a name for the route.

       2. In **Destination CIDR**, do one of the following:

          * To route traffic to an [allocation](/vpc/overview#allocation), specify the CIDR block of destination IP addresses to which the route applies.
          * To route traffic to the internet through the [default egress gateway](/vpc/routing/overview#default-egress-gateway), specify `0.0.0.0/0`.

       3. Under **Next hop**, do one of the following:

          * To route traffic to an allocation, select **Allocation**.
          * To route traffic to the internet, select **Default egress gateway**.

       4. Only if you selected **Allocation** under **Next hop**, select the allocation to route traffic through.

    6. Click **Add route**.
  </Tab>

  <Tab title="CLI">
    * **Routing traffic to an allocation**

      To route traffic to an allocation, run the following command:

      ```bash theme={null}
      nebius vpc route create \
        --name <route_name> \
        --parent-id <routing_table_ID> \
        --destination-cidr <destination_CIDR_block> \
        --next-hop-allocation-id <allocation_ID>
      ```

      In the command, specify the following parameters:

      * `--name`: Name of the route.

      * `--parent-id`: ID of the routing table to add the route to. To get it, run:

        ```bash theme={null}
        nebius vpc route-table list
        ```

        The output contains the routing table ID in the `.metadata.id` parameter.

      * `--destination-cidr`: Specify the CIDR block of destination IP addresses to which the route applies.

      * `--next-hop-allocation-id`: ID of the allocation to route traffic through. To get it, run:

        ```bash theme={null}
        nebius vpc allocation list
        ```

        The output contains the allocation ID in the `.metadata.id` parameter.

    * **Routing traffic to the internet**

      To route traffic to the internet through the default egress gateway, run the following command:

      ```bash theme={null}
      nebius vpc route create \
        --name "default-egress" \
        --parent-id <routing_table_ID> \
        --destination-cidr "0.0.0.0/0" \
        --next-hop-default-egress-gateway true
      ```

      In the command, specify the following parameters:

      * `--name`: Name of the route.

      * `--parent-id`: ID of the routing table to add the route to. To get it, run:

        ```bash theme={null}
        nebius vpc route-table list
        ```

        The output contains the routing table ID in the `.metadata.id` parameter.

      * `--destination-cidr`: Set to `0.0.0.0/0` to route traffic to the internet through the default egress gateway.

      * `--next-hop-default-egress-gateway`: Set to `true` to route traffic through the default egress gateway.
  </Tab>
</Tabs>

## Deleting routes

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/networking.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=7a4fe6d935f68131371d7b49a9bd595f" width="16" height="16" data-path="_assets/sidebar/networking.svg" /> **Networking** → **Virtual Networks**.
    2. Select the network that contains the routing table and switch to the **Routing tables** tab.
    3. Select the routing table from which you want to delete a route.
    4. Do one of the following:

       * To delete one route, click <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/button-vellipsis.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=e80b8e57c43bfd117679262e6a1334ad" width="12" height="24" data-path="_assets/button-vellipsis.svg" /> next to the route and select **Delete**.
       * To delete multiple routes at once, select the checkboxes next to the required routes and click **Delete** in the banner that appears.
  </Tab>

  <Tab title="CLI">
    To delete a route from a routing table, run the following command:

    ```bash theme={null}
    nebius vpc route delete <route_ID>
    ```

    In the command, specify the route ID to delete. To get it, do the following:

    1. Get the ID of the routing table:

       ```bash theme={null}
       nebius vpc route-table list
       ```

       The output contains the routing table ID in the `.metadata.id` parameter.

    2. Use this ID to list all the routes in that routing table:

       ```bash theme={null}
       nebius vpc route list --parent-id <routing_table_ID>
       ```

       The output contains the route ID in the `.metadata.id` parameter.
  </Tab>
</Tabs>

If you delete all routes in a routing table, resources in subnets that have this routing table assigned can only communicate with other resources within their network. All traffic to private IP addresses outside the network and to public IP addresses is discarded.

## Assigning routing tables to subnets

You can only assign a routing table to subnets within the network that the routing table is associated with. After you assign a routing table to a subnet, egress traffic from all resources in the subnet is routed according to the routing table.

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/networking.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=7a4fe6d935f68131371d7b49a9bd595f" width="16" height="16" data-path="_assets/sidebar/networking.svg" /> **Networking** → **Virtual Networks**.
    2. Switch to the **Subnets** tab.
    3. Select the subnet to which you want to assign a routing table.
    4. On the **Settings** tab, select a routing table from the **Routing table** drop-down list.
    5. Click **Save changes**.
  </Tab>

  <Tab title="CLI">
    To assign a routing table to a subnet, run the following command:

    ```bash theme={null}
    nebius vpc subnet update <subnet_ID> \
      --route-table-id <routing_table_ID>
    ```

    In the command, specify the following parameters:

    * `<subnet_ID>`: ID of the subnet to assign the routing table to. To get it, run:

      ```bash theme={null}
      nebius vpc subnet list
      ```

      The output contains the subnet ID in the `.metadata.id` parameter.

    * `--route-table-id`: ID of the routing table to assign to the subnet. To get it, run:

      ```bash theme={null}
      nebius vpc route-table list
      ```

      The output contains the routing table ID in the `.metadata.id` parameter.
  </Tab>
</Tabs>

## Reverting subnets to the parent network's default routing table

If you no longer want to apply custom routing to a subnet, you can unassign its custom routing table. After this, the subnet uses its parent network's default routing table.

<Tabs group="interfaces">
  <Tab title="Web console">
    To assign the subnet to its parent network's default routing table:

    1. Find the parent network's default routing table:
       1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/networking.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=7a4fe6d935f68131371d7b49a9bd595f" width="16" height="16" data-path="_assets/sidebar/networking.svg" /> **Networking** → **Virtual Networks**.
       2. In the list of networks, select the network to which the subnet belongs.
       3. Switch to the **Routing tables** tab. The default routing table has a **Default** label next to its name.
    2. Assign the default routing table to the subnet:
       1. Switch to the **Subnets** tab.
       2. Select the subnet that you want to revert to the default routing table.
       3. On the **Settings** tab, select the default routing table from the **Routing table** drop-down list.
       4. Click **Save changes**.

    Alternatively, you can [delete](#deleting-routing-tables) the custom routing table if you no longer need it. When you delete the routing table, you can choose the option to use the default routing table for the subnet.
  </Tab>

  <Tab title="CLI">
    To revert a subnet to its parent network's default routing table, run the following command:

    ```bash theme={null}
    nebius vpc subnet update <subnet_ID> \
      --route-table-id ""
    ```

    In the command, specify the subnet ID. To get it, run:

    ```bash theme={null}
    nebius vpc subnet list
    ```

    After you run this command, the subnet uses its parent network's default routing table.
  </Tab>
</Tabs>

## Resetting default routing tables of networks

[Reverting to the default routing table](#reverting-subnets-to-the-parent-networks-default-routing-table) means that the [default routing rules](/vpc/routing/overview#default-routing-rules) apply to the subnet again, unless you have modified the default routing table. If you modified it, you can make the default routing table implement the default routing rules again. To do this, bring it to the state described in [Default routing tables](/vpc/routing/overview#default-routing-tables):

<Tabs group="interfaces">
  <Tab title="Web console">
    If you added new routes to the default routing table, you can delete them to reset the default routing table.

    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/networking.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=7a4fe6d935f68131371d7b49a9bd595f" width="16" height="16" data-path="_assets/sidebar/networking.svg" /> **Networking** → **Virtual Networks**.

    2. Select the network whose default routing table you want to reset.

    3. Switch to the **Routing tables** tab.

    4. Select the routing table that is labeled **Default**.

    5. In the routes list, check whether there is a route whose **Destination CIDR** value is `0.0.0.0/0`.

    6. If there is no such route:

       1. Click **Add route**.

       2. In the window that opens:

          1. Specify a name for the route.
          2. In **Destination CIDR**, enter `0.0.0.0/0`.
          3. Under **Next hop**, select **Default egress gateway**.

       3. Click **Add route**.

    7. [Delete](#deleting-routes) all other routes from the default routing table.
  </Tab>

  <Tab title="CLI">
    1. Get the ID of the default routing table:

       ```bash theme={null}
       nebius vpc network list
       ```

       The output contains the ID in the `.status.default_route_table_id` parameter.

    2. List the table's routes:

       ```bash theme={null}
       nebius vpc route list --parent-id <default_routing_table_ID>
       ```

    3. If the table does not contain a route to the internet through the default egress gateway for all egress traffic (CIDR block `0.0.0.0/0`) as described in [Default routing tables](/vpc/routing/overview#default-routing-tables), add it:

       ```bash theme={null}
       nebius vpc route create \
         --name <route_name> \
         --parent-id <routing_table_ID> \
         --destination-cidr "0.0.0.0/0" \
         --next-hop-default-egress-gateway true
       ```

    4. [Delete](#deleting-routes) all other routes from the default routing table.
  </Tab>
</Tabs>

## Deleting routing tables

<Tabs group="interfaces">
  <Tab title="Web console">
    1. In the sidebar, go to <Icon icon="https://mintcdn.com/nebius-ai-cloud/rOlLZ_MFvrheaI-h/_assets/sidebar/networking.svg?fit=max&auto=format&n=rOlLZ_MFvrheaI-h&q=85&s=7a4fe6d935f68131371d7b49a9bd595f" width="16" height="16" data-path="_assets/sidebar/networking.svg" /> **Networking** → **Virtual Networks**.
    2. Select the network from which you want to delete the routing table and switch to the **Routing tables** tab.
    3. Click <Icon icon="https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/button-vellipsis.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=e80b8e57c43bfd117679262e6a1334ad" width="12" height="24" data-path="_assets/button-vellipsis.svg" /> next to the routing table you want to delete.
    4. In the window that opens:
       * If the routing table is not assigned to any subnets, confirm the deletion.
       * If the routing table is assigned to a subnet, select a new routing table for the subnet or choose the option to use the default routing table, then confirm the deletion.
  </Tab>

  <Tab title="CLI">
    <Warning>
      You can only delete custom routing tables that are not assigned to any subnet. Before deleting a routing table, [assign other routing tables](#assigning-routing-tables-to-subnets) to this table's subnets or [revert these subnets to defaults](#reverting-subnets-to-the-parent-networks-default-routing-table).
    </Warning>

    To delete a routing table, run the following command:

    ```bash theme={null}
    nebius vpc route-table delete <routing_table_ID>
    ```

    In the command, specify the ID of the routing table. To get it, run:

    ```bash theme={null}
    nebius vpc route-table list
    ```
  </Tab>
</Tabs>
