I’ve been using Mikrotik RouterOS for awhile now, both using their hardware and their virtual image (Cloud Hosted Router). It’s a great product for routing and firewalling, while it’s not a NGFW it’s an absolutely amazing router and their L2/L3 switches are also a great value for the price.

So anyway, I often setup images of the latest CHR in Proxmox VE for testing things. I create vmbr bridges in Proxmox to point-to-point link multiple CHRs, and can lab out complex network setups. Since CHR is free with a 1mbps throughput limit, it’s perfectly adequate to lab with only the free VMs.

So here’s the script I use to download and setup a Proxmox VM template for the latest version of RouterOS, from which I can clone and add network interfaces to.

Make sure to paste in the latest download link from the Mikrotik download site. You want the latest stable Cloud Hosted Router - Raw Image. As of this writing, it’s ROS V7.11.2.

wget "https://download.mikrotik.com/routeros/7.11.2/chr-7.11.2.img.zip"
unzip chr-7.11.2.img.zip
qm create 940 --name "temp-mikrotik-ros-7.11.2" --ostype l26
qm set 940 --net0 virtio,bridge=vmbr0
qm set 940 --serial0 socket --vga serial0
#Yes, really, this is how littke RAM it needs
qm set 940 --memory 256 --cores 2 --cpu host
#Import the disk as scsi0, default boot order, resize up to 8G
qm set 940 --scsi0 local-zfs:0,import-from="$(pwd)/chr-7.11.2.img",discard=on
qm set 940 --boot order=scsi0 --scsihw virtio-scsi-single
qm disk resize 940 scsi0 8G
#Make it a template
qm template 940

If you followed my Easy Mode Cloud-Init Templates tutorial, 940 will be a number that fits well with that numbering scheme.