[Yandex Cloud documentation](../../index.md) > [Yandex BareMetal](../index.md) > [Tutorials](index.md) > Establishing network connectivity between BareMetal and Virtual Private Cloud private subnets

# Setting up network connectivity between BareMetal and Yandex Virtual Private Cloud subnets using Yandex Cloud Interconnect

# Setting up network connectivity between Yandex BareMetal and Yandex Virtual Private Cloud subnets using Yandex Cloud Interconnect


[Yandex Cloud Interconnect](../../interconnect/index.md)-based network connectivity in Yandex BareMetal enables access to [CIDRs](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) of Virtual Private Cloud private subnets in a cloud infrastructure and/or CIDRs of private subnets in an on-prem infrastructure.

In this tutorial, you will set up network connectivity between a BareMetal [server](../concepts/servers.md) located in a private Yandex BareMetal [subnet](../concepts/private-network.md) and a Yandex Compute Cloud [VM](../../compute/concepts/vm.md) located in a subnet of a Yandex Virtual Private Cloud [cloud network](../../vpc/concepts/network.md#network).

Similarly, you can set up network connectivity with your on-prem resources located in private subnets within your own network infrastructure.

You can use Yandex Cloud Interconnect free of charge as part of integration with Yandex BareMetal.

You can see the solution architecture in the diagram below:

![bm-vrf-and-vpc-interconnect](../../_assets/tutorials/bm-vrf-and-vpc-interconnect.svg)

To set up network connectivity between BareMetal and Virtual Private Cloud subnets using Cloud Interconnect:

1. [Get your cloud ready](#before-you-begin).
1. [Create a cloud infrastructure](#setup-infrastructure).
1. [Request a routing instance](#request-ri).
1. [Create a private connection](#create-prc).
1. [Test network connectivity](#check-connectivity).

If you no longer need the resources you created, [delete them](#clear-out).

## Getting started {#before-you-begin}

Sign up for Yandex Cloud and create a [billing account](../../billing/concepts/billing-account.md):
1. Navigate to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud or create a new account.
1. On the **[Yandex Cloud Billing](https://center.yandex.cloud/billing/accounts)** page, make sure you have a billing account linked and it has the `ACTIVE` or `TRIAL_ACTIVE` [status](../../billing/concepts/billing-account-statuses.md). If you do not have a billing account, [create one](../../billing/quickstart/index.md) and [link](../../billing/operations/pin-cloud.md) a cloud to it.

If you have an active billing account, you can create or select a [folder](../../resource-manager/concepts/resources-hierarchy.md#folder) for your infrastructure on the [cloud page](https://console.yandex.cloud/cloud).

[Learn more about clouds and folders here](../../resource-manager/concepts/resources-hierarchy.md).


### Required paid resources {#paid-resources}

The cost of supporting an infrastructure for network connectivity between BareMetal and VPC subnets includes:

* Fee for using the VM [public IP address](../../vpc/concepts/address.md#public-addresses) (see [Yandex Virtual Private Cloud pricing](../../vpc/pricing.md)).
* Fee for [VM](../../compute/concepts/vm.md) computing resources and disks (see [Yandex Compute Cloud pricing](../../compute/pricing.md)).
* BareMetal server lease fee (see [Yandex BareMetal pricing](../pricing.md)).

Traffic transmitted via [Yandex Cloud Interconnect](../../interconnect/index.md) between private Yandex BareMetal and Yandex Virtual Private Cloud addresses in either direction is not billable.


## Create a cloud infrastructure {#setup-infrastructure}

Create the Yandex Cloud infrastructure you will use to set up network connectivity.

To configure Cloud Interconnect in BareMetal, you will need a private routable [subnet](../concepts/private-network.md#private-subnet) and a [VRF segment](../concepts/private-network.md#vrf-segment) in BareMetal, a [cloud network](../../vpc/concepts/network.md#network) with one or more Virtual Private Cloud [subnets](../../vpc/concepts/network.md#subnet), as well as a routing instance with at least one [announced](../../interconnect/concepts/priv-con.md#prc-announce) VPC private subnet prefix.

To check network connectivity, you will need a BareMetal server and a Compute Cloud VM.

### Create a VRF segment and a BareMetal private subnet {#setup-vrf}

Create a virtual network segment (VRF) and a private subnet in the `ru-central1-m3` [server pool](../concepts/servers.md#server-pools):

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder where you are going to create your infrastructure.
  1. Navigate to **BareMetal**.
  1. Create a virtual routing and forwarding segment:
        1. In the left-hand panel, select ![icon](../../_assets/console-icons/vector-square.svg) **VRF** and click **Create VRF**.
        1. In the **Name** field, name your VRF segment: `my-vrf`.
        1. Click **Create VRF**.
  1. Create a private subnet:
        1. In the left-hand panel, select ![icon](../../_assets/console-icons/nodes-right.svg) **Private subnets** and click **Create subnet**.
        1. In the **Pool** field, select the `ru-central1-m3` server pool.
        1. In the **Name** field, enter the subnet name: `subnet-m3`.
        1. Enable **IP addressing and routing**.
        1. In the **Virtual network segment (VRF)** field, select `my-vrf`.
        1. In the **CIDR** field, specify `192.168.1.0/24`.
        1. In the **Default gateway** field, keep the default value, `192.168.1.1`.
        1. Enable the **Assigning IP addresses via DHCP** option and in the **IP address range** field that appears, leave the default values, `192.168.1.1`-`192.168.1.254`.
        1. Click **Create subnet**.

{% endlist %}


### Rent a BareMetal server {#rent-bms}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder where you are deploying your infrastructure.
  1. Navigate to **BareMetal**.
  1. Click **Lease server** and, in the window that opens, select `Stock configurations` and a suitable BareMetal server [configuration](../concepts/server-configurations.md) in the `ru-central1-m3` server pool.

      Do it by selecting the `ru-central1-m3` server pool in the filter on the right side of the window, under **Pool**.

      To select the suitable server configuration, click the section with its name in the central part of the screen.

      {% note tip %}
      
      You can reduce the cost of renting a server in some configurations by ordering server [assembly](../concepts/server-custom-configurations.md#assembly).
      
      To use the discount, hover over **Cheaper with assembly** ![circle-info.svg](../../_assets/console-icons/circle-info.svg) under the configuration at hand and click ![person-nut-hex.svg](../../_assets/console-icons/person-nut-hex.svg) **Go to assembly** in the pop-up window.
      
      When ordering a server with assembly, follow the steps below to configure the server properties. In this case, the server will not be available immediately, but only after the assembly is completed (within four calendar days), and at a lower price.
      
      {% endnote %}

  1. In the server configuration window that opens:

      1. In the **Lease duration** field, select the [lease period](../concepts/servers.md#server-lease): `1 day`, `1 month`, `3 months`, `6 months`, or `1 year`.
         
         When this period expires, server lease will automatically be renewed for the same period. You cannot terminate the lease during the specified lease period, but you can [refuse](../operations/servers/server-lease-cancel.md) to extend the server lease further.
      1. Under **Image**, select an image, e.g., `Ubuntu 24.04`.
      1. Optionally, under **Disk**, configure [disk](../concepts/disks/disk-types.md) partitioning:
         
         1. Click **Configure disk layout**.
         1. Specify partition settings. To create a new partition, click ![icon](../../_assets/console-icons/plus.svg) **Add partition**.
         
             To configure [RAID](../concepts/disks/raid.md) arrays and disk partitions by yourself, click **Remove RAID**.
         1. Click **Save**.
      1. Under **Network interfaces**:
          1. In the **Private subnet** field, select the `subnet-m3` subnet you created earlier.
          1. In the **Public address** field, select `No address`.

      1. Under **Access**:

          1. In the **Password** field, select one of the following options to create a root password:
          
              * To generate a new root password, select `New password` and click **Generate**.
          
                  {% note warning %}
                  
                  This option requires you to maintain password security. Save the password you generated in a secure location. Yandex Cloud does not store it, and you will not be able to retrieve it once the server is deployed.
                  
                  {% endnote %}
          
              * To use the root password saved in a Yandex Lockbox [secret](../../lockbox/concepts/secret.md), select `Lockbox secret`.
          
                  In the **Name**, **Version**, and **Key** fields, select the secret containing your password, its version, and its key, respectively.
                  
                  If you do not have a Yandex Lockbox secret, click **Create** to create it.
          
                  Choose the `Custom` secret type to specify a custom password or `Generated` to generate password automatically.
          
          1. In the **Public SSH key** field, select the SSH key saved in your [organization user](../../organization/concepts/membership.md) profile.
          
              If there are no SSH keys in your profile or you want to add a new key:
              
              1. Click **Add key**.
              1. Enter a name for the SSH key.
              1. Select one of the following:
              
                  * `Enter manually`: Paste the contents of the public SSH key. You need to [create](../../compute/operations/vm-connect/ssh.md#creating-ssh-keys) an SSH key pair on your own.
                  * `Load from file`: Upload the public part of the SSH key. You need to create an SSH key pair on your own.
                  * `Generate key`: Automatically create an SSH key pair.
                  
                    When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the `/home/<user_name>/.ssh` directory. In Windows, unpack the archive to the `C:\Users\<user_name>/.ssh` directory. You do not need additionally enter the public key in the management console.
              
              1. Click **Add**.
              
              The system will add the SSH key to your organization user profile. If the organization has [disabled](../../organization/operations/os-login-access.md) the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.

      1. Under **Server information**, in the **Name** field, enter the server name: `server-m3`.
      1. Click **Lease server**.

{% endlist %}

{% note info %}

Server setup and OS installation may take up to 45 minutes. The server will have the `Provisioning` status during this time. After OS installation is complete, the server status will change to `Ready`.

{% endnote %}


### Create a cloud network with a subnet {#setup-vpc}

Create a cloud network and subnet to connect the Compute Cloud VM to.

{% list tabs group=instructions %}

- Management console {#console} 

  1. In the [management console](https://console.yandex.cloud), select the folder where you are deploying your infrastructure.
  1. Navigate to **Virtual Private Cloud**.
  1. Create a cloud network:

      1. At the top right, click **Create network**.

      1. In the **Name** field, specify `sample-network`.

      1. In the **Advanced** field, disable **Create subnets**.

      1. Click **Create network**.
  1. Create a subnet:

      1. In the left-hand panel, select ![subnets](../../_assets/console-icons/nodes-right.svg) **Subnets**.
      1. At the top right, click **Create subnet**.
      1. In the **Name** field, specify `subnet-ru-central1-b`.
      1. In the **Availability zone** field, select `ru-central1-b`.
      1. In the **Network** field, select `sample-network`.
      1. In the **CIDR** field, specify `192.168.11.0/24`.
      
          {% note warning %}
          
          To successfully configure network connectivity between BareMetal subnets and on-premise or VPC subnets, their CIDR address ranges must not match or overlap.
          
          {% endnote %}

      1. Click **Create subnet**.

{% endlist %}


### Create a VM {#create-vm}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder where you are deploying your infrastructure.
  1. Navigate to **Compute Cloud**.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/server.svg) **Virtual machines** and click **Create virtual machine**.
  1. Under **Boot disk image**, select an appropriate VM image. For example, [Ubuntu 24.04](https://yandex.cloud/en/marketplace/products/yc/ubuntu-2404-lts-oslogin).
  1. Under **Location**, select the `ru-central1-b` [availability zone](../../overview/concepts/geo-scope.md).
  1. Under **Network settings**:

      * In the **Subnet** field, select the `subnet-ru-central1-b` subnet you created earlier.
      * In the **Public IP address** field, select `Auto`.

  1. Under **Access**, select **SSH key** and specify the VM access credentials:

      * In the **Login** field, enter the username: `yc-user`.
      * In the **SSH key** field, select the SSH key saved in your [organization user](../../organization/concepts/membership.md) profile.
        
        If there are no SSH keys in your profile or you want to add a new key:
        
        1. Click **Add key**.
        1. Enter a name for the SSH key.
        1. Select one of the following:
        
            * `Enter manually`: Paste the contents of the public SSH key. You need to [create](../../compute/operations/vm-connect/ssh.md#creating-ssh-keys) an SSH key pair on your own.
            * `Load from file`: Upload the public part of the SSH key. You need to create an SSH key pair on your own.
            * `Generate key`: Automatically create an SSH key pair.
            
              When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the `/home/<user_name>/.ssh` directory. In Windows, unpack the archive to the `C:\Users\<user_name>/.ssh` directory. You do not need additionally enter the public key in the management console.
        
        1. Click **Add**.
        
        The system will add the SSH key to your organization user profile. If the organization has [disabled](../../organization/operations/os-login-access.md) the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.

  1. Under **General information**, specify the VM name: `sample-vm`.
  1. Click **Create VM**.

{% endlist %}


## Create a routing instance {#request-ri}

To set up network connectivity between BareMetal subnets, Virtual Private Cloud subnets, and/or on-prem subnets, you need to create a `Routing Instance` resource. To create a `Routing Instance`, [contact](https://center.yandex.cloud/support/tickets/create) support.

If your folder already has [Cloud Interconnect](../../interconnect/index.md) network connectivity (VPC-to-On-Prem) configured, you can either use the existing `Routing Instance` or request a new additional `Routing Instance` to be created for standalone network connectivity.

### Make sure you have a routing instance in your folder {#check-for-ri}

1. If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

    The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

1. Make sure you have a routing instance in your default folder:
   
   {% list tabs group=instructions %}
   
   - CLI {#cli}
   
     Run this command:
   
     ```bash
     yc cloudrouter routing-instance list
     ```
   
     If your folder already contains a routing instance, the command will output something like this:
   
     ```text
     +----------------------+-------------------------------------------+--------+-----------------------+
     |          ID          |                    NAME                   | STATUS | PRIVATE CONNECTION ID |
     +----------------------+-------------------------------------------+--------+-----------------------+
     | cf35oot8f0eu******** | ajeol2afu1js********-enpcfncr6uld******** | ACTIVE | cf395uf8dg7h********  |
     +----------------------+-------------------------------------------+--------+-----------------------+
     ```
   
   {% endlist %}

1. If you already have a routing instance, you may skip the next step and [proceed](#create-private-connection) to creating a private connection.

    If you do not have a routing instance or you want to build additional dedicated network connectivity, request a new routing instance.

### Request a new routing instance {#request-ri}

[Contact](https://center.yandex.cloud/support/tickets/create) support to create a routing instance in your folder.

Fill out your request as follows:

```text
Subject: [CIC for BareMetal] Creating a routing instance.

Request text:
Please create a routing instance in the specified cloud folder with the following parameters:

folder_id: <folder_ID>

vpc:
  vpc_net_id: <network_ID>
    vpc_subnets:
      ru-central1-a: [CIDR_a1, CIDR_a2, ..., CIDR_an]
      ru-central1-b: [CIDR_b1, CIDR_b2, ..., CIDR_bn]
      ru-central1-d: [CIDR_d1, CIDR_d2, ..., CIDR_dn]
```

Where:
* `folder_id`: [Folder ID](../../resource-manager/operations/folder/get-id.md).
* `vpc_net_id`: Cloud network [ID](../../vpc/operations/network-get-info.md).
* `vpc_subnets`: List of [announced](../../interconnect/concepts/priv-con.md#prc-announce) address prefixes for each [availability zone](../../overview/concepts/geo-scope.md). For example, for the VPC subnet you created earlier, you will specify `ru-central1-b: [192.168.11.0/24]`.

    You may announce [aggregated](../../interconnect/concepts/priv-con.md#agg-subnets) address prefixes.

{% note info %}

It may take up to 24 hours for the support to create a routing instance. With that done, you will be able to get the ID of the new routing instance by running the `yc cloudrouter routing-instance list` [Yandex Cloud CLI](../../cli/index.md) command.

{% endnote %}

## Create a private connection {#create-prc}

Once the routing instance has been created in your folder, create a [private Cloud Interconnect connection](../concepts/private-network.md#private-connection-to-vpc) in BareMetal:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../resource-manager/concepts/resources-hierarchy.md#folder) where you want to create your private connection.
  1. Navigate to **BareMetal**.
  1. In the left-hand panel, select ![icon](../../_assets/console-icons/vector-square.svg) **VRF** and then select the virtual network segment you need.
  1. Under **Private connection to cloud networks**, click **Configure connection**, and in the window that opens:

      1. In the **Setup method** field, select `Enter ID` and paste the `Routing Instance` private connection ID to the **Connection ID** field.

          You can also select the `Choose from folder` option. In this case, select the `Routing Instance` you need from the list that opens.

          As a result, you will see the CIDR blocks of Virtual Private Cloud subnets that will be [advertised](../../interconnect/concepts/priv-con.md#prc-announce) over Cloud Interconnect.

          {% note warning %}
          
          To successfully configure network connectivity between BareMetal subnets and on-premise or VPC subnets, their CIDR address ranges must not match or overlap.
          
          {% endnote %}
      1. To create a private connection for the specified CIDR subnets, click **Save**.

  As a result, the VRF information page will display the newly created connection ID and its status under **Private connection to cloud networks**.

- API {#api}

  To create a private connection with cloud networks, use the [PrivateCloudConnection.Create](../api-ref/PrivateCloudConnection/create.md) REST API method or the [PrivateCloudConnectionService/Create](../api-ref/grpc/PrivateCloudConnection/create.md) gRPC API call.

  Run this query:

  ```bash
  curl -X POST \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer <IAM_token>" \
    -d '{
      "routingInstanceId":"fokrf2in3c7********",
      "vrfId":"ly5uyq2gbxu2********"
      }' \
    "https://baremetal.api.cloud.yandex.net/baremetal/v1alpha/privateCloudConnections"
  ```

  Where:

  * `routingInstanceId`: [Routing instance](../../cloud-router/concepts/routing-instance.md) ID in Cloud Router.
  * `vrfId`: ID of the VRF you are connecting to the Routing Instance. To get the VRF ID, use the [VrfService.List](../api-ref/Vrf/list.md) method.

  Result:

  ```json
  {
    "done": false,
    "id": "arpas4mne3********",
    "description": "Create private cloud connection",
    "createdAt": "2024-01-01T12:00:00Z",
    "createdBy": "user-id",
    "modifiedAt": "2024-01-01T12:00:00Z",
    "metadata": {
      "privateCloudConnectionId": "kor4msi1aqq********"
    }
  }
  ```

  The operation of creating a private connection is performed asynchronously. Follow the status of the operation by the `done` field.

{% endlist %}

{% note info %}

Setting up a private connection may take up to two business days. During this period, the connection status will display as `Creating`. Once the connection is created, its status will change to `Ready`.

{% endnote %}

Private cloud netweork connections may show one of the following statuses:

* `CREATING`: Connection creation in progress.
* `READY`: Connection is up and ready to use.
* `ERROR`: Connection failure. Contact support.
* `DELETING`: Connection deletion in progress.
* `UPDATING`: Connection settings update in progress.

## Test network connectivity {#check-connectivity}

As soon as the status of the new private connection changes to `Ready`, network connectivity between the BareMetal and VPC subnets will be established, and you can start checking it.

A network connectivity check assumes that:
* The process of setting up a private connection to cloud networks has been successfully completed (the connection status is `Ready`).
* The local firewall on the BareMetal server allows [ICMP](https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol) traffic.
* The routing table in the BareMetal server OS contains a route to the CIRD of the subnet the VM resides in.
* The [security group](../../vpc/concepts/security-groups.md) assigned to the VM [network interface](../../compute/concepts/network.md) allows ICMP traffic.

### Test network connectivity between a private BareMetal subnet and a private VPC subnet {#check-bms-to-vm}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder where you created the infrastructure.
  1. Navigate to **BareMetal**.
  1. Next to `server-m3`, click ![image](../../_assets/console-icons/ellipsis.svg) and select **KVM console**.
  
      The KVM console terminal window will open, showing a login prompt:
      
      ```
      server-m3 login:
      ```

      If you do not see this prompt, try [restarting](../operations/servers/server-stop-and-start.md#restart) the server.

  1. In the KVM console terminal, specify `root` for the username and press **ENTER**.
  1. Paste the password generated when renting the server in the password input line and press **ENTER**. Note that when typing or pasting a password in Linux, the characters you enter will not appear on the screen.

      {% note tip %}
      
      To paste clipboard text to the KVM console, use the **Paste text here** field in the upper right corner.
      
      {% endnote %}

      Result:

      ```text
      Welcome to Ubuntu 24.04.2 LTS (GNU/Linux 6.8.0-53-generic x86_64)
      ...
      root@server-m3:~# _
      ```

      If you did not save the server administrator password, you can create a new password following [this guide](../operations/servers/reset-password.md) or [reinstall](../operations/servers/reinstall-os-from-marketplace.md) the server OS.
  1. In the KVM console terminal, run the `ping` command to make sure you can access `sample-vm` by its [internal](../../compute/concepts/network.md#internal-ip) IP address:

      ```bash
      ping <VM_internal_IP_address> -c 5
      ```

      You can find the VM internal IP address in the [management console](https://console.yandex.cloud) under **Network interface** on the VM information page.

      Result:

      ```text
      PING 192.168.11.2 (192.168.11.2) 56(84) bytes of data.
      64 bytes from 192.168.11.2: icmp_seq=1 ttl=64 time=3.90 ms
      64 bytes from 192.168.11.2: icmp_seq=2 ttl=64 time=0.235 ms
      64 bytes from 192.168.11.2: icmp_seq=3 ttl=64 time=0.222 ms
      64 bytes from 192.168.11.2: icmp_seq=4 ttl=64 time=0.231 ms
      64 bytes from 192.168.11.2: icmp_seq=5 ttl=64 time=0.235 ms

      --- 192.168.11.2 ping statistics ---
      5 packets transmitted, 5 received, 0% packet loss, time 4086ms
      rtt min/avg/max/mdev = 0.222/0.964/3.899/1.467 ms
      ```

      Network connectivity between the BareMetal server and the VM has been established with zero packet loss.

{% endlist %}

### Test network connectivity between a private VPC subnet and a private BareMetal subnet {#check-vm-to-bms}

1. [Connect](../../compute/operations/vm-connect/ssh.md) to the VM over SSH.
1. In the terminal, run the `ping` command to make sure you can access `server-m3` by its private IP address:

      ```bash
      ping <server_private_IP_address> -c 5
      ```

      You can learn the BareMetal server's private IP address in the [management console](https://console.yandex.cloud) under **Network settings** on the server information page.

      Result:

      ```text
      PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
      64 bytes from 192.168.1.3: icmp_seq=1 ttl=64 time=0.271 ms
      64 bytes from 192.168.1.3: icmp_seq=2 ttl=64 time=0.215 ms
      64 bytes from 192.168.1.3: icmp_seq=3 ttl=64 time=0.262 ms
      64 bytes from 192.168.1.3: icmp_seq=4 ttl=64 time=0.223 ms
      64 bytes from 192.168.1.3: icmp_seq=5 ttl=64 time=0.208 ms

      --- 192.168.1.3 ping statistics ---
      5 packets transmitted, 5 received, 0% packet loss, time 4106ms
      rtt min/avg/max/mdev = 0.208/0.235/0.271/0.025 ms
      ```

      Network connectivity between the VM and the BareMetal server has been established with zero packet loss.

## How to delete the resources you created {#clear-out}

To stop paying for the resources you created:

1. [Delete](../../compute/operations/vm-control/vm-delete.md) the VM.
1. You cannot delete a BareMetal server. Instead, [cancel](../operations/servers/server-lease-cancel.md) the server lease renewal.
1. Delete the private connection if you no longer need it:

    {% list tabs group=instructions %}

    - Management console {#console} 
    
      1. In the [management console](https://console.yandex.cloud), select the folder where you created the infrastructure.
      1. Navigate to **BareMetal**.
      1. In the left-hand panel, click ![icon](../../_assets/console-icons/vector-square.svg) **VRF** and select `my-vrf`.
      1. Under **Private connection to cloud networks**, click ![image](../../_assets/console-icons/ellipsis.svg) and select ![CircleXmark](../../_assets/console-icons/circle-xmark.svg) **Disable connection**.
      1. In the window that opens, confirm the deletion.

      The connection status will change to `Deleting`. Once all links are deleted, the connection will disappear from the list.

    {% endlist %}