[Yandex Cloud documentation](../../index.md) > [Yandex Virtual Private Cloud](../index.md) > [Tutorials](index.md) > Additional settings and tools > Installing the Mikrotik CHR virtual router

# Installing a Mikrotik CHR virtual router

In Yandex Cloud, you can deploy a virtual Mikrotik Cloud Hosted Router on a ready-made VM image. To install the Mikrotik Cloud Hosted Router and check how it runs:

1. [Get your cloud ready](#before-you-begin).
1. [Create a VM with the Mikrotik Cloud Hosted Router](#create-router).
1. [Log in to your VM and change your password](#change-password).
1. [Create a test VM](#create-test-vm).
1. [Check the connection between the router and test VM](#test-connection).

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


## Get your cloud ready {#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}

{% note alert %}

When using a Mikrotik Cloud Hosted Router image without a license, the router throughput is limited to 1 Mbps. To remove this limitation, [install a license](https://help.mikrotik.com/docs/spaces/ROS/pages/18350234/Cloud+Hosted+Router+CHR#CloudHostedRouter,CHR-CHRLicensing).

{% endnote %}

The cost of using a virtual router and a test VM includes:

* Fee for the disks and continuously running VMs (see [Yandex Compute Cloud pricing](../../compute/pricing.md)).
* Fee for using a public IP address (see [Yandex Virtual Private Cloud pricing](../pricing.md)).


## Create a VM with the Mikrotik Cloud Hosted Router {#create-router}

1. In the [management console](https://console.yandex.cloud), navigate to the [folder](../../resource-manager/concepts/resources-hierarchy.md#folder) dashboard, click **Create resource**, and select `Virtual machine instance`.
1. Under **Boot disk image**, in the **Product search** field, enter `Cloud Hosted Router` and select a public [Cloud Hosted Router](https://yandex.cloud/en/marketplace/products/yc/cloud-hosted-router) image.
1. Under **Location**, select an [availability zone](../../overview/concepts/geo-scope.md) to create your VM in. If you do not know which availability zone you need, leave the default one.
1. Under **Computing resources**, switch to the `Custom` tab and specify the [platform](../../compute/concepts/vm-platforms.md), number of vCPUs, and amount of RAM:

    * **Platform**: `Intel Ice Lake`
    * **vCPU**: `2`
    * **Guaranteed vCPU performance**: `100%`
    * **RAM**: `2 GB`

1. Under **Network settings**:

    * In the **Subnet** field, select the network and subnet to which you want to connect your VM. If the [network](../concepts/network.md#network) or [subnet](../concepts/network.md#subnet) you need does not exist yet, [create it](../operations/subnet-create.md).
    * In the **Public IP address** field, select a static IP address from the list, or leave `Auto` to assign your VM a random external IP address from the Yandex Cloud pool.

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

    * In the **Login** field, enter a username. Do not use `root` or other reserved usernames.
    * 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.

    Note that you only need this data for VM creation. You cannot use the data for router access.

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

It may take a few minutes to create a VM. When the VM status changes to `RUNNING`, you can log in.

{% note alert %}

Set a complex administrator password immediately after VM creation. To keep access to the router, you need to change the admin password within 5 minutes after the start.

{% endnote %}


## Change the administrator password on the router {#change-password}

The router is created with a public IP address, so you need to change the default administrator password for security reasons.

1. In the [management console](https://console.yandex.cloud), select a folder.
1. Navigate to **Compute Cloud**.
1. Copy the `mikrotik-router` VM public IP address and open it in your browser.
1. On the page that opens, enter the VM’s internal IP address in the **IP Address** field. 
1. In the **Password** field, enter the new administrator password, confirm it in the **Confirm Password** field, and click **Apply Configuration**. You can apply other settings later.


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

Create a test VM in the subnet that hosts the router, to test connectivity between the router and VM.

1. In the [management console](https://console.yandex.cloud), navigate to the [folder](../../resource-manager/concepts/resources-hierarchy.md#folder) dashboard, click **Create resource**, and select `Virtual machine instance`.
1. Under **Boot disk image**, in the **Product search** field, enter `Ubuntu` and select a public [Ubuntu](https://yandex.cloud/en/marketplace?tab=software&search=Ubuntu&categories=os) image.
1. Under **Location**, select the [availability zone](../../overview/concepts/geo-scope.md) the `mikrotik-router` VM resides in.
1. Under **Computing resources**, switch to the `Custom` tab and specify the [platform](../../compute/concepts/vm-platforms.md), number of vCPUs, and amount of RAM:

    * **Platform**: `Intel Ice Lake`
    * **vCPU**: `2`
    * **Guaranteed vCPU performance**: `20%`
    * **RAM**: `1 GB`

1. Under **Network settings**:

    * In the **Subnet** field, select the network and subnet hosting the `mikrotik-router` VM.
    * In the **Public IP address** field, select `No address`.

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

    * In the **Login** field, enter a username. Do not use `root` or other reserved usernames. To perform operations requiring superuser privileges, use the `sudo` command.
    * 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: `test-vm`.
1. Click **Create VM**.


### Check the connection between the router and test VM {#test-connection}

{% note alert %}

If you use WinBox to access the router, connect to the router using the VM IP address. MAC access is not supported in Yandex Cloud.

{% endnote %}

Make sure that a network connection is established between the router and test VM:

1. Open the router's administrator interface in the browser.
1. Click **Terminal**.
1. In the terminal that opens, run the `ping <test_VM_internal_IP_address>` command.

If the packets reach the test VM, you can start configuring the router. You can find the router manual in the [Mikrotik documentation](https://wiki.mikrotik.com/wiki/Main_Page).


## Delete the resources you created {#clear-out}

To stop paying for the deployed resources, [delete](../../compute/operations/vm-control/vm-delete.md) the `mikrotik-router` and `test-vm` VMs. 

If you reserved a public static IP address, [delete it](../operations/address-delete.md).