Creating a virtual router
Note
You need the cloud-router.editor role to run this operation.
-
In the management console
, select the folder where you want to create a virtual router. -
Navigate
to Cloud Router. -
Click Create routing instance.
-
Enter a name and description for your virtual router.
-
Optionally, add labels:
- Click Add label.
- Add a label in
key: valueformat. - Press Enter.
-
Optionally, enable Deletion protection to protect your virtual router from accidental deletion.
-
In the Private connections field, select the private connections or specify their IDs.
-
In the Networks field, select the networks.
-
Add the IP prefixes in the section that appears dedicated to the network and its subnets.
-
Click Create.
-
See the description of the CLI command for creating a virtual router:
yc cloudrouter routing-instance create --help -
Create a virtual router in the specified folder:
Note
To simplify maintenance, we recommend creating the virtual router in the same folder where the trunk and private connection were previously created.
yc cloudrouter routing-instance create --name ri1 \ --description "Routing instance 1" \ --folder-id b1gqf**********jiz2w \ --asyncExpected result:
id: fokrf**********ml058 description: routing instance create created_at: "2025-04-16T12:43:54.507531644Z" created_by: bfbud**********v7dfn modified_at: "2025-04-16T12:43:54.507531644Z" metadata: '@type': type.googleapis.com/yandex.cloud.cloudrouter.v1.CreateRoutingInstanceMetadata routing_instance_id: c3l87**********1dpin -
To check the result of creating a virtual router:
yc cloudrouter routing-instance get c3l87**********1dpin id: c3l87**********1dpin name: ri1 description: Routing instance 1 folder_id: b1gqf**********jiz2w region_id: ru-central1 status: ACTIVE created_at: "2025-04-16T12:43:55Z"Where:
id: Virtual router ID.name: Virtual router name.description: Virtual router description.folder_id: ID of the cloud folder the virtual router was created in.region_id: Region of the cloud the virtual router was created in.status: Resource state. Target state:ACTIVE. When being created, it may be in theCREATINGstate.created_at: Date and time of resource creation.async: Running the operation in asynchronous mode. This is the recommended mode for all operations that involve changes to resources.