Prerequisites
- Install and configure the Nebius AI Cloud CLI.
- Make sure you are in a group that has at least the
editorrole within your tenant; for example, the defaulteditorsgroup. You can check this in the Administration → IAM section of the web console. - Get the ID of the network where you want to manage routing tables and routes.
Creating routing tables
To create a routing table, run the following command:--name: Name of the routing table.--network-id: ID of the network for the routing table. You can only assign a routing table to subnets within this network. For instructions, see Getting network and subnet IDs for Nebius AI Cloud resources.
Adding routes to routing tables
Routes to allocations
To route traffic to an allocation, specify the allocation ID in--next-hop-allocation-id:
nebius vpc route-table list and nebius vpc allocation list. The outputs of these commands contain the IDs in the .metadata.id fields.
Routes to the internet
To route traffic to the internet through the default egress gateway, use the CIDR block0.0.0.0/0 and add --next-hop-default-egress-gateway true to the command:
nebius vpc route-table list. The output of this command contains the ID in the .metadata.id field.
Deleting routes
To delete a route from a routing table, run the following command:nebius vpc route list --parent-id <routing_table_ID>.
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. To assign a routing table to a subnet, run the following command:nebius vpc subnet list and nebius vpc route-table list, respectively.
Reverting subnets to the parent network’s default routing table
If you no longer want to apply custom routing to a subnet, you can de-assign its custom routing table. After this, the subnet uses its parent network’s default routing table. To revert a subnet to its parent network’s default routing table, run the following command:nebius vpc subnet list.
Resetting default routing tables of networks
Reverting to the default routing table means that the 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:-
Get the ID of the default routing table:
The output contains the ID in the
.status.default_route_table_idfield. -
List the table’s routes:
-
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, add it: - Delete all other routes.
Deleting routing tables
To delete a routing table, run the following command:nebius vpc route-table list.