Building large lab with Mikrotik on Unetlab

In my trainings I use Unetlab environment. I recommend to everyone use Unetlab and get rid of GNS3, because difference in performance and support of different vendors is huge. Last year Mikrotik announced their RouterOS license for virtual machines, called Cloud Hosted Router (CHR).  I’m going to show how to setup CHR in Unetlab in few steps during 5 minutes.

First of all – we need to get chr image of latest Mikrotik RouterOS http://www.mikrotik.com/download, download the VMDK image.

Then copy it with scp to your Unetlab server, in my case

scp Downloads/chr-6.34.1.vmdk root@10.0.1.189:/home

Then run these commands on Unetlab server in CLI to create valid image for Unetlab and place it to right directory.

 

# /opt/qemu/bin/qemu-img convert -f vmdk -O qcow2 chr-6.34.1.vmdk hda.qcow2
# mkdir -p /opt/unetlab/addons/qemu/mikrotik-6.34.1
# mv hda.qcow2 /opt/unetlab/addons/qemu/mikrotik-6.34.1/
# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions

 

When this is done, you should be able to see mikrotik image on adding of new node window –

2016-02-13 04.16.32 pm

Don’t forget to setup VNC as default connection type to device.
When router is added, we can setup new network pointing to Pnet0 bridge, connect chr router to our office network, assign to it IP address and login and manage from Winbox.

The final result with 2 CHR routers connected to each other with access to it from my office network is shown on two pictures below.

Access directly to mikrotik CHR:

Mikrotik CHR unetlab

Topology :

2016-02-13 05.31.24 pm

Here is mine topology, which I use on Mikrotik trainings with students :

2016-02-16 05.22.40 pm

 

Here is a video tutorial showing steps of configuration:

  • Haha Haha

    how do you configure the VNC to work on unetlab ? thanks

    • alexnvis

      Hi, I’m using Chicken VNC software – https://sourceforge.net/projects/cotvnc/

      • TiaanVenter

        HI,
        How can I add Splynx to Unetlab? I want to virtualise Splynx server and then add to unet lab for testing

  • jsn0w

    Mikrotik doesn`t start up…. I used chr.-6.34.4.vmdk – last version. Could smb help?

  • jperez

    Please could you tell my how implement a bridge on UnetLab like AP111?

    • alexnvis

      Hi, you just add a new network and call it bridge.
      If you want to connect your Lab device to real network, you have to chose Pnet0 brigde.
      Check mine video tutorial – https://www.youtube.com/watch?v=Vy6CzYdrLJc

  • hendra

    i cant start mikrotik, and this is log on my unl server :

    Apr 29 09:22:04 unl01 ovs-vsctl: ovs|00001|vsctl|INFO|Called as ovs-vsctl del-port vunl1_1_0

    Apr 29 09:22:04 unl01 ovs-vsctl: ovs|00002|vsctl|ERR|no port named vunl1_1_0

    Apr 29 09:22:04 unl01 kernel: [233019.197720] IPv6: ADDRCONF(NETDEV_CHANGE): vunl1_1_0: link becomes ready

    Apr 29 09:22:04 unl01 kernel: [233019.232864] IPv6: ADDRCONF(NETDEV_UP): vunl1_1_0: link is not ready

    Apr 29 09:22:04 unl01 ovs-vsctl: ovs|00001|vsctl|INFO|Called as ovs-vsctl del-port vunl1_1_1

    Apr 29 09:22:04 unl01 ovs-vsctl: ovs|00002|vsctl|ERR|no port named vunl1_1_1

    Apr 29 09:22:04 unl01 kernel: [233019.248213] IPv6: ADDRCONF(NETDEV_CHANGE): vunl1_1_1: link becomes ready

    Apr 29 09:22:04 unl01 kernel: [233019.290304] IPv6: ADDRCONF(NETDEV_UP): vunl1_1_1: link is not ready

    Apr 29 09:22:04 unl01 ovs-vsctl: ovs|00001|vsctl|INFO|Called as ovs-vsctl del-port vunl1_1_2

    Apr 29 09:22:04 unl01 ovs-vsctl: ovs|00002|vsctl|ERR|no port named vunl1_1_2

    Apr 29 09:22:04 unl01 kernel: [233019.306450] IPv6: ADDRCONF(NETDEV_CHANGE): vunl1_1_2: link becomes ready

    Apr 29 09:22:04 unl01 kernel: [233019.344892] IPv6: ADDRCONF(NETDEV_UP): vunl1_1_2: link is not ready

    Apr 29 09:22:04 unl01 ovs-vsctl: ovs|00001|vsctl|INFO|Called as ovs-vsctl del-port vunl1_1_3

    Apr 29 09:22:04 unl01 ovs-vsctl: ovs|00002|vsctl|ERR|no port named vunl1_1_3

    Apr 29 09:22:04 unl01 kernel: [233019.398957] IPv6: ADDRCONF(NETDEV_UP): vunl1_1_3: link is not ready

    • alexnvis

      I have no idea, never had message like this :-(

  • Antonios Daragiannis

    hi,

    i cant start putty it says connection refused.

    If i run the vnc_wrapper.bat is says invalid server specified.

    Any help ?

  • Konstantin

    Hi, when add one Mikrotik device, there is no problem, but when for example 2 to associate them with each other fails as I understand because of the same Mac addresses. UNetLab version: 1.0.0-12 QEMU version: 2.4.0. To change the Mac address on the interface Mikrotik fails

  • Andri Muhyidin

    hemmm, i can’t start my qemu mikrotik… connection refused

  • Davi Nunes

    how can I set up so that the labels so that it is similar to “ether x”, like the mikrotik interface name labels are?

    • nbctcp

      /interface ethernet
      set [find mac-address=50:00:00:05:00:00] name=ether1
      set [find mac-address=50:00:00:05:00:01] name=ether2
      set [find mac-address=50:00:00:05:00:02] name=ether3
      set [find mac-address=50:00:00:05:00:03] name=ether4

  • Guram Bachi Tochilashvili

    I Add mikrotik device (DEFAULT is VNC), but Cant Console with VNC and Telnet.

    Why ?

    • Takie_dela

      Did you check VNC settings in VmWare? Free version don’t support it

  • Alexander Allvapekz

    router doesnt start. unetlab installed on vmware esxi.