Managing networks and IP prefixes in a routing instance
Warning
To request access to this function, contact support
Updating networks and IP prefixes in a routing instance
You can use the yc cloudrouter routing-instance update-networks Yandex Cloud CLI command to simultaneously manage multiple announced IP prefixes of Yandex Virtual Private Cloud cloud networks added to a routing instance, as well as add new networks to a routing instance and delete the existing ones.
Note
To manage networks and IP prefixes in a routing instance, you need the cloud-router.editor role.
Adding a cloud network to a routing instance
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
-
View the description of the command for managing networks and IP prefixes in a routing instance:
yc cloudrouter routing-instance update-networks --help -
View the list of all routing instances in the folder:
yc cloudrouter routing-instance list \ --folder-id <folder_ID>Where
--folder-idis the ID of the folder containing the routing instance.Result:
+----------------------+------+----------+--------------------------------+ | ID | NAME | STATUS | PRIVATE CONNECTION ID | +----------------------+------+----------+--------------------------------+ | c3lgk007olse******** | ri1 | UPDATING | cf3or586ln29********, | | | | | cf3uj9uph7b6******** | +----------------------+------+----------+--------------------------------+ -
Get information about a routing instance by specifying its ID:
yc cloudrouter routing-instance get c3lgk007olse******** \ --folder-id <folder_ID>Result:
id: c3lgk007olse******** name: ri1 description: Routing instance 1 folder_id: b1gt6g8ht345******** region_id: ru-central1 vpc_info: - vpc_network_id: enpcfncr6uld******** az_infos: - manual_info: az_id: ru-central1-d prefixes: - 192.168.7.0/24 - manual_info: az_id: ru-central1-a prefixes: - 192.168.2.0/24 - manual_info: az_id: ru-central1-b prefixes: - 192.168.15.0/24 - vpc_network_id: enpt8ok6snlp******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 192.168.45.0/24 - 192.168.46.0/24 cic_private_connection_info: - cic_private_connection_id: cf3or586ln29******** - cic_private_connection_id: cf3uj9uph7b6******** status: UPDATING created_at: "2025-12-23T07:30:19Z" -
Add a new network with an announced IP prefix to the routing instance by specifying this network's ID under
idin the--add-vpc-netparameter:yc cloudrouter routing-instance update-networks \ --folder-id <folder_ID> \ --id c3lgk007olse******** \ --add-vpc-net id=enpvt41bh5gk********,zone=ru-central1-a,ipv4-prefixes=192.168.100.0/24,192.168.101.0/24 \ --asyncResult:
id: foku4jbrp07i******** description: routing instance update prefix mask created_at: "2025-12-23T08:35:04.852963002Z" created_by: ajeol2afu1js******** modified_at: "2025-12-23T08:35:04.852963002Z" metadata: '@type': type.googleapis.com/yandex.cloud.cloudrouter.v1.UpdateRoutingInstanceMetadata routing_instance_id: c3lgk007olse********Where:
id: ID of the operation performed with a routing instance.description: Description of the operation in progress.created_by: ID of the subject running the operation.async: Running the operation in asynchronous mode. We recommend using this mode for all operations that modify your resources.
-
Wait for the operation to complete and make sure the routing instance configuration has been updated:
yc cloudrouter routing-instance get c3lgk007olse******** \ --folder-id <folder_ID>Result:
id: c3lgk007olse******** name: ri1 description: Routing instance 1 folder_id: b1gt6g8ht345******** region_id: ru-central1 vpc_info: - vpc_network_id: enpcfncr6uldme5e5929 az_infos: - manual_info: az_id: ru-central1-d prefixes: - 192.168.7.0/24 - manual_info: az_id: ru-central1-a prefixes: - 192.168.2.0/24 - manual_info: az_id: ru-central1-b prefixes: - 192.168.15.0/24 - vpc_network_id: enpt8ok6snlp******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 192.168.45.0/24 - 192.168.46.0/24 - vpc_network_id: enpvt41bh5gk******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 192.168.100.0/24 - 192.168.101.0/24 cic_private_connection_info: - cic_private_connection_id: cf3or586ln29******** - cic_private_connection_id: cf3uj9uph7b6******** status: ACTIVE created_at: "2025-12-23T08:35:07Z"id: Routing instance ID.name: Routing instance name.description: Routing instance description.folder_id: ID of the folder the routing instance was created in.region_id: Region of the cloud the routing instance was created in.vpc_info: List of IP prefixes by availability zone. Prefixes are shown separately for each availability zone.cic_private_connection_info: List of private connections connected to the routing instance.status: Resource state. The target state isACTIVE. When being updated, it may be in theUPDATINGstate.created_at: Date and time of resource creation.
Deleting an existing cloud network from a routing instance
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
-
View the description of the command for managing networks and IP prefixes in a routing instance:
yc cloudrouter routing-instance update-networks --help -
View the list of all routing instances in the folder:
yc cloudrouter routing-instance list \ --folder-id <folder_ID>Where
--folder-idis the ID of the folder containing the routing instance.Result:
+----------------------+------+----------+--------------------------------+ | ID | NAME | STATUS | PRIVATE CONNECTION ID | +----------------------+------+----------+--------------------------------+ | c3lgk007olse******** | ri1 | UPDATING | cf3or586ln29********, | | | | | cf3uj9uph7b6******** | +----------------------+------+----------+--------------------------------+ -
Get information about a routing instance by specifying its ID:
yc cloudrouter routing-instance get c3lgk007olse******** \ --folder-id <folder_ID>Result:
id: c3lgk007olse******** name: ri1 description: Routing instance 1 folder_id: b1gt6g8ht345******** region_id: ru-central1 vpc_info: - vpc_network_id: enpcfncr6uld******** az_infos: - manual_info: az_id: ru-central1-d prefixes: - 192.168.7.0/24 - manual_info: az_id: ru-central1-a prefixes: - 192.168.2.0/24 - manual_info: az_id: ru-central1-b prefixes: - 192.168.15.0/24 - vpc_network_id: enpt8ok6snlp******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 192.168.45.0/24 - 192.168.46.0/24 cic_private_connection_info: - cic_private_connection_id: cf3or586ln29******** - cic_private_connection_id: cf3uj9uph7b6******** status: UPDATING created_at: "2025-12-23T07:30:19Z" -
Delete an existing network from the routing instance:
yc cloudrouter routing-instance update-networks \ --folder-id <folder_ID> \ --id c3lgk007olse******** \ --delete-vpc-net-id id=enpt8ok6snlp******** \ --asyncResult:
id: fokg66rcqie1******** description: routing instance update prefix mask created_at: "2025-12-23T08:53:09.626102995Z" created_by: ajeol2afu1js******** modified_at: "2025-12-23T08:53:09.626102995Z" metadata: '@type': type.googleapis.com/yandex.cloud.cloudrouter.v1.UpdateRoutingInstanceMetadata routing_instance_id: c3lgk007olse********Where:
id: ID of the operation performed with a routing instance.description: Description of the operation in progress.created_by: ID of the subject running the operation.async: Running the operation in asynchronous mode. We recommend using this mode for all operations that modify your resources.
-
Wait for the operation to complete and make sure the routing instance configuration has been updated:
yc cloudrouter routing-instance get c3lgk007olse******** \ --folder-id <folder_ID>Result:
id: c3lgk007olse******** name: ri1 description: Routing instance 1 folder_id: b1gt6g8ht345******** region_id: ru-central1 vpc_info: - vpc_network_id: enpcfncr6uldme5e5929 az_infos: - manual_info: az_id: ru-central1-d prefixes: - 192.168.7.0/24 - manual_info: az_id: ru-central1-a prefixes: - 192.168.2.0/24 - manual_info: az_id: ru-central1-b prefixes: - 192.168.15.0/24 cic_private_connection_info: - cic_private_connection_id: cf3or586ln29******** - cic_private_connection_id: cf3uj9uph7b6******** status: ACTIVE created_at: "2025-12-23T08:35:07Z"id: Routing instance ID.name: Routing instance name.description: Routing instance description.folder_id: ID of the folder the routing instance was created in.region_id: Region of the cloud the routing instance was created in.vpc_info: List of IP prefixes by availability zone. Prefixes are shown separately for each availability zone.cic_private_connection_info: List of private connections connected to the routing instance.status: Resource state. The target state isACTIVE. When being updated, it may be in theUPDATINGstate.created_at: Date and time of resource creation.
Updating IP prefixes of existing cloud networks in a routing instance
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
-
View the description of the command for managing networks and IP prefixes in a routing instance:
yc cloudrouter routing-instance update-networks --help -
View the list of all routing instances in the folder:
yc cloudrouter routing-instance list \ --folder-id <folder_ID>Where
--folder-idis the ID of the folder containing the routing instance.Result:
+----------------------+------+----------+--------------------------------+ | ID | NAME | STATUS | PRIVATE CONNECTION ID | +----------------------+------+----------+--------------------------------+ | c3lgk007olse******** | ri1 | UPDATING | cf3or586ln29********, | | | | | cf3uj9uph7b6******** | +----------------------+------+----------+--------------------------------+ -
Get information about a routing instance by specifying its ID:
yc cloudrouter routing-instance get c3lgk007olse******** \ --folder-id <folder_ID>Result:
id: c3lgk007olse******** name: ri1 description: Routing instance 1 folder_id: b1gt6g8ht345******** region_id: ru-central1 vpc_info: - vpc_network_id: enpcfncr6uld******** az_infos: - manual_info: az_id: ru-central1-d prefixes: - 192.168.7.0/24 - manual_info: az_id: ru-central1-a prefixes: - 192.168.2.0/24 - manual_info: az_id: ru-central1-b prefixes: - 192.168.15.0/24 - vpc_network_id: enpt8ok6snlp******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 192.168.45.0/24 - 192.168.46.0/24 cic_private_connection_info: - cic_private_connection_id: cf3or586ln29******** - cic_private_connection_id: cf3uj9uph7b6******** status: UPDATING created_at: "2025-12-23T07:30:19Z" -
Update the announced IP prefixes in the routing instance:
yc cloudrouter routing-instance update-networks \ --folder-id <folder_ID> \ --id c3lgk007olse******** \ --update-vpc-net id=enpcfncr6uld********,zone=ru-central1-a,ipv4-prefixes=192.168.2.0/28 \ --update-vpc-net id=enpcfncr6uld********,zone=ru-central1-b,ipv4-prefixes=192.168.15.0/24 \ --update-vpc-net id=enpcfncr6uld********,zone=ru-central1-d,ipv4-prefixes=192.168.7.0/24 \ --update-vpc-net id=enpt8ok6snlp********,zone=ru-central1-d,ipv4-prefixes=192.168.47.0/28 \ --asyncResult:
id: fokr80vgdskp******** description: routing instance update prefix mask created_at: "2025-12-23T09:56:40.259684884Z" created_by: ajeol2afu1js******** modified_at: "2025-12-23T09:56:40.259684884Z" metadata: '@type': type.googleapis.com/yandex.cloud.cloudrouter.v1.UpdateRoutingInstanceMetadata routing_instance_id: c3lgk007olse********Where:
id: ID of the operation performed with a routing instance.description: Description of the operation in progress.created_by: ID of the subject running the operation.async: Running the operation in asynchronous mode. We recommend using this mode for all operations that modify your resources.
-
Wait for the operation to complete and make sure the routing instance configuration has been updated:
yc cloudrouter routing-instance get c3lgk007olse******** \ --folder-id <folder_ID>Result:
id: c3lgk007olse******** name: ri1 description: Routing instance 1 folder_id: b1gt6g8ht345******** region_id: ru-central1 vpc_info: - vpc_network_id: enpcfncr6uld******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 192.168.2.0/28 - manual_info: az_id: ru-central1-b prefixes: - 192.168.15.0/24 - manual_info: az_id: ru-central1-d prefixes: - 192.168.7.0/24 - vpc_network_id: enpt8ok6snlp******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 192.168.47.0/28 cic_private_connection_info: - cic_private_connection_id: cf3or586ln29******** - cic_private_connection_id: cf3uj9uph7b6******** status: ACTIVE created_at: "2025-12-23T10:46:55Z"id: Routing instance ID.name: Routing instance name.description: Routing instance description.folder_id: ID of the folder the routing instance was created in.region_id: Region of the cloud the routing instance was created in.vpc_info: List of IP prefixes by availability zone. Prefixes are shown separately for each availability zone.cic_private_connection_info: List of private connections connected to the routing instance.status: Resource state. The target state isACTIVE. When being updated, it may be in theUPDATINGstate.created_at: Date and time of resource creation.
Adding IP prefixes to a routing instance
You can use the yc cloudrouter routing-instance upsert-prefixes Yandex Cloud CLI command to announce new IP prefixes in a routing instance.
Tip
If you need to add new IP prefixes to a routing instance while also deleting all or some of its existing prefixes, use the yc cloudrouter routing-instance update-networks command.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
-
See the description of the CLI command for updating a list of IP prefixes in a routing instance:
yc cloudrouter routing-instance upsert-prefixes --help -
View the routing instance configuration and the list of IP prefixes:
yc cloudrouter routing-instance get c3l871dpin4f******** \ --folder-id <folder_ID>Where
--folder-idis the ID of the folder containing the routing instance.Result:
id: c3l871dpin4f******** name: ri1 description: Routing instance 1 folder_id: b1gqfjiz2wda******** region_id: ru-central1 vpc_info: - vpc_network_id: c64ckjtr7b3l******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 10.128.0.0/24 cic_private_connection_info: - cic_private_connection_id: cf3td2nufvr5******** status: ACTIVE created_at: "2025-03-19T13:35:56Z" -
Add more prefixes to the routing instance IP prefix list:
Note
To manage networks and IP prefixes in a routing instance, you need the
cloud-router.editorrole.yc cloudrouter routing-instance upsert-prefixes c3l871dpin4f******** \ --folder-id <folder_ID> \ --vpc-net id=c64ckjtr7b3l********,zone=ru-central1-b,ipv4-prefixes=10.129.0.0/24 \ --vpc-net id=c64ckjtr7b3l********,zone=ru-central1-d,ipv4-prefixes=172.16.1.0/24 \ --asyncResult:
id: al457njn6pj1******** description: routing instance upsert prefixes created_at: "2025-03-24T15:24:15.817401507Z" created_by: bfbudv7dfn22******** modified_at: "2025-03-24T15:24:15.817401507Z" metadata: '@type': type.googleapis.com/yandex.cloud.cloudrouter.v1.UpdateRoutingInstanceMetadata routing_instance_id: c3l871dpin4f********Where:
id: ID of the operation performed with a routing instance.description: Description of the operation in progress.created_by: ID of the subject running the operation.async: Running the operation in asynchronous mode. We recommend using this mode for all operations that modify your resources.
-
Wait for the operation to complete and make sure the routing instance configuration has been updated:
yc cloudrouter routing-instance get c3l871dpin4f******** \ --folder-id <folder_ID>Result:
id: c3l871dpin4f******** name: ri1 description: Routing instance 1 folder_id: b1gqfjiz2wda******** region_id: ru-central1 vpc_info: - vpc_network_id: c64ckjtr7b3l******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 10.128.0.0/24 - manual_info: az_id: ru-central1-b prefixes: - 10.129.0.0/24 - manual_info: az_id: ru-central1-d prefixes: - 172.16.1.0/24 cic_private_connection_info: - cic_private_connection_id: cf3td2nufvr5******** status: ACTIVE created_at: "2025-03-19T13:35:56Z"Where:
id: Routing instance ID.name: Routing instance name.description: Routing instance description.folder_id: ID of the folder the routing instance was created in.region_id: Region of the cloud the routing instance was created in.vpc_info: List of IP prefixes by availability zone. Prefixes are shown separately for each availability zone.cic_private_connection_info: List of private connections connected to the routing instance.status: Resource state. The target state isACTIVE. When being updated, it may be in theUPDATINGstate.created_at: Date and time of resource creation.
Deleting IP prefixes from a routing instance
You can use the yc cloudrouter routing-instance remove-prefixes Yandex Cloud CLI command to delete announced IP prefixes from a routing instance.
Tip
If you need to delete existing IP prefixes from a routing instance while also adding new prefixes to it, use the yc cloudrouter routing-instance update-networks command.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
-
See the description of the CLI command for deleting IP prefixes from a routing instance:
yc cloudrouter routing-instance remove-prefixes --help -
View the routing instance configuration and the list of IP prefixes:
yc cloudrouter routing-instance get c3l871dpin4f******** \ --folder-id <folder_ID>Where
--folder-idis the ID of the folder containing the routing instance.Result:
id: c3l871dpin4f******** name: ri1 description: Routing instance 1 folder_id: b1gqfjiz2wda******** region_id: ru-central1 vpc_info: - vpc_network_id: c64ckjtr7b3l******** az_infos: - manual_info: az_id: ru-central1-a prefixes: - 10.128.0.0/24 - manual_info: az_id: ru-central1-b prefixes: - 10.129.0.0/24 - manual_info: az_id: ru-central1-d prefixes: - 172.16.1.0/24 cic_private_connection_info: - cic_private_connection_id: cf3td2nufvr5******** status: ACTIVE created_at: "2025-03-19T13:35:56Z" -
Delete IP prefixes from the routing instance:
Note
To manage networks and IP prefixes in a routing instance, you need the
cloud-router.editorrole.yc cloudrouter routing-instance remove-prefixes c3l871dpin4f******** \ --folder-id <folder_ID> \ --vpc-net id=c64ckjtr7b3l********,zone=ru-central1-b,ipv4-prefixes=10.128.0.0/24 \ --vpc-net id=c64ckjtr7b3l********,zone=ru-central1-d,ipv4-prefixes=10.129.0.0/24 \ --asyncResult:
id: al457njn6pj1******** description: routing instance remove prefixes created_at: "2025-03-24T15:24:15.817401507Z" created_by: bfbudv7dfn22******** modified_at: "2025-03-24T15:24:15.817401507Z" metadata: '@type': type.googleapis.com/yandex.cloud.cloudrouter.v1.UpdateRoutingInstanceMetadata routing_instance_id: c3l871dpin4f********Where:
id: ID of the operation performed with a routing instance.description: Description of the operation in progress.created_by: ID of the subject running the operation.async: Running the operation in asynchronous mode. We recommend using this mode for all operations that modify your resources.
-
Wait for the operation to complete and make sure the routing instance configuration has been updated:
yc cloudrouter routing-instance get c3l871dpin4f******** \ --folder-id <folder_ID>Result:
id: c3l871dpin4f******** name: ri1 description: Routing instance 1 folder_id: b1gqfjiz2wda******** region_id: ru-central1 vpc_info: - vpc_network_id: c64ckjtr7b3l******** az_infos: - manual_info: az_id: ru-central1-d prefixes: - 172.16.1.0/24 cic_private_connection_info: - cic_private_connection_id: cf3td2nufvr5******** status: ACTIVE created_at: "2025-03-19T13:35:56Z"Where:
id: Routing instance ID.name: Routing instance name.description: Routing instance description.folder_id: ID of the folder the routing instance was created in.region_id: Region of the cloud the routing instance was created in.vpc_info: List of IP prefixes by availability zone. Prefixes are shown separately for each availability zone.cic_private_connection_info: List of private connections connected to the routing instance.status: Resource state. The target state isACTIVE. When being updated, it may be in theUPDATINGstate.created_at: Date and time of resource creation.