Installing a Mikrotik CHR virtual router
In Yandex Cloud, you can deploy a virtual Mikrotik Cloud Hosted Router from a ready-made VM image. To install Mikrotik Cloud Hosted Router and check its operability:
- Prepare your cloud.
- Create a VM with Mikrotik Cloud Hosted Router.
- Log in to your VM and change your password.
- Create a test VM.
- Check the connection between the router and test VM.
If you no longer need the resources you created, delete them.
Prepare your cloud
Sign up for Yandex Cloud and create a billing account:
- Go to the management console
and log in to Yandex Cloud or create an account if you do not have one yet. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and it has theACTIVE
orTRIAL_ACTIVE
status. If you do not have a billing account, create one.
If you have an active billing account, you can go to the cloud page
Learn more about clouds and folders.
Required paid resources
Alert
If using a Mikrotik Cloud Hosted Router image without a license, the router throughput is limited to 1 Mbps. To remove this limit, install a license
The cost of using a virtual router and test VM includes:
- Fee for the disks and continuously running VMs (see Yandex Compute Cloud pricing).
- Fee for using a public IP address (see Yandex Virtual Private Cloud pricing).
Create a VM with Mikrotik Cloud Hosted Router
-
On the folder page in the management console
, click Create resource and selectVirtual machine instance
. -
Under Boot disk image, in the Product search field, enter
Cloud Hosted Router
and select a public Cloud Hosted Router image. -
Under Location, select an availability zone to create your VM in. If you do not know which availability zone you need, leave the default one.
-
Under Computing resources, navigate to the
Custom
tab and specify the required platform, number of vCPUs, and the amount of RAM:- Platform:
Intel Ice Lake
. - vCPU:
2
. - Guaranteed vCPU performance:
100%
. - RAM:
2 GB
.
- Platform:
-
Under Network settings:
- In the Subnet field, select the network and subnet to connect your VM to. If the required network or subnet is not listed, create it.
- Under Public IP, keep
Auto
to assign your VM a random external IP address from the Yandex Cloud pool or select a static address from the list if you reserved one in advance.
-
Under Access, select SSH key and specify the VM access data:
- Under Login, enter the username. Do not use
root
or other names reserved by the OS. -
In the SSH key field, select the SSH key saved in your organization user profile.
If there are no saved SSH keys in your profile, or you want to add a new key:
- Click Add key.
- Enter a name for the SSH key.
- Upload or paste the contents of the public key file. You need to create a key pair for the SSH connection to a VM yourself.
- Click Add.
The SSH key will be added to your organization user profile.
If users cannot add SSH keys to their profiles in the organization, the added public SSH key will only be saved to the user profile of the VM being created.
Note that you only need this data for VM creation. You cannot use the data for router access.
- Under Login, enter the username. Do not use
-
Under General information, specify the VM name:
mikrotik-router
. -
Click Create VM.
It may take a few minutes to create a VM. When the VM status changes to RUNNING
, you can log in.
Alert
Set a complex administrator password immediately after VM creation.
Change the administrator password on the router
The router is created with a public IP address, so you need to change the default administrator password for security reasons.
- In the management console
, select the folder. - In the list of services, select Compute Cloud.
- Copy the
mikrotik-router
VM public IP address and open it in your browser. - Enter the VM internal IP address in the IP Address field.
- On the page that opens, enter the new administrator password, confirm it, and click Apply Configuration. You can make other setting later.
Create a test VM
Create a test VM in the subnet that hosts the router, to test connectivity between the router and VM.
-
On the folder page in the management console
, click Create resource and selectVirtual machine instance
. -
Under Boot disk image, in the Product search field, enter
Ubuntu
and select a public Ubuntu image. -
Under Location, select the same availability zone as the one the
mikrotik-router
VM is in. -
Under Computing resources, navigate to the
Custom
tab and specify the required platform, number of vCPUs, and the amount of RAM:- Platform:
Intel Ice Lake
. - vCPU:
2
. - Guaranteed vCPU performance:
20%
- RAM:
1 GB
- Platform:
-
Under Network settings:
- In the Subnet field, select the network and subnet hosting the
mikrotik-router
VM. - In the Public IP field, select
No address
.
- In the Subnet field, select the network and subnet hosting the
-
Under Access, select SSH key and specify the VM access data:
- Under Login, enter the username. Do not use
root
or other names reserved by the OS. To perform operations requiring superuser permissions, use thesudo
command. -
In the SSH key field, select the SSH key saved in your organization user profile.
If there are no saved SSH keys in your profile, or you want to add a new key:
- Click Add key.
- Enter a name for the SSH key.
- Upload or paste the contents of the public key file. You need to create a key pair for the SSH connection to a VM yourself.
- Click Add.
The SSH key will be added to your organization user profile.
If users cannot add SSH keys to their profiles in the organization, the added public SSH key will only be saved to the user profile of the VM being created.
- Under Login, enter the username. Do not use
-
Under General information, specify the VM name:
test-vm
. -
Click Create VM.
Check the connection between the router and test VM
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.
Make sure that a network connection has been established between the router and test VM:
- Open the router's administrative interface in the browser.
- Click Terminal.
- 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. To learn how to work with the router, see the Mikrotik documentation
Delete the resources you created
To stop paying for the deployed resources, delete the mikrotik-router
and test-vm
VMs.
If you reserved a public static IP address, delete it.