You are on page 1of 11

INSTALATION GUIDE AND USE OF

MIKROTIK RouterOS
ON GNS3

REQUIREMENTS:
- Installer GNS3, you can download from their official website:
https://www.gns3.com/software/download
- Oracle VM VirtualBox Installer, you can download from their official website:
https://www.virtualbox.org/wiki/Downloads
- Disk Image Mikrotik RouterOS x86, is downloaded on their official website:
http://www.mikrotik.com/download
- RouterOS configuration tool Winbox on previous downloads page.

First Step:
- Download installation programs:

1- GNS3

You need user registration to proceed with the


download.

2- Oracle VM VirtualBox

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 1


stevenvegar@gmail.com May, 2016
3- Mikrotik RouterOS

You can choose between versions


available for download, using the last
published is recommended.

4- Mikrotik WinBox

Using the latest update available is


also recommended.

Done.

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 2


stevenvegar@gmail.com May, 2016
Second Step:
- Install GNS3 with all the defaults.
- Install Oracle VM VirtualBox with all the defaults.

Third Step:
- Start VirtualBox and create a new virtual machine with the disk image Mikrotik RouterOS.

The configuration of the RouterOS virtual machine is:


- Type:Linux.
- Version: Other Linux (32-bit).
- Memory: 256 Mb (Its a recommendation, at least 32 Mb).
- New virtual Hard Disk.
- Hard Disk size: 512 Mb (its a recommendation, at least 128 Mb).
- System Boot Order: CD/DVD ROM Hard Disk.
- System Processor: Enable PAE/NX.
- Enable all network adapters Connected to: Not connected.

To install the RouterOS disk image, you must start the Virtual Machine from the .ISO image
downloaded from the Mikrotiks.page
- In the virtual machine settings in the "storage" tab, select the empty disc storage, on
attributes, then indicate the path of the disk image you downloaded earlier.

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 3


stevenvegar@gmail.com May, 2016
Fourth step:
- Install Mikrotik RouterOS in the virtual machine.

To proceed with the installation, start the virtual machine. You should start from boot disk
image and display RouterOS installation options.

Select all options with "a" or choose the packages you want to install with the spacebar key.
To start the installation press the "i" key. It ask if we want to save some configuration, we give
the "n" key to indicate we dont want to save any information, so the system will format the
hard drive of the virtual machine. The last question is that if we want to continue, press the
key "y" to start the installation.
Within seconds, the RouterOS system will be installed in the virtual machine.

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 4


stevenvegar@gmail.com May, 2016
After that, we turn off the virtual machine by closing the window on the X in the upper right
corner and choose the "Turn off machine" option.
Now, in the settings of the virtual machine, go to the "storage" tab and select the disk image
RouterOS, section attribute, where we chose the image file earlier, click on "delete virtual disk
drive, this will remove the image of the virtual drive. Finally, in the "System" tab, modify the
boot order and leave the hard drive as the first boot device.
To verify that the procedure was successful, we start the virtual machine from the hard drive.
The system will create the "Software-ID" for the installation of the license.
Once the installation process finish, the RouterOS system is ready for use.
Recall that the default user for login is "admin" and the password blank.

Fifth step:
- Install the virtual machine Mikrotik RouterOS on GNS3.

We turn off the virtual machine, closing the X in the corner or the "system shutdown"
command.
Start the GNS3 program normally.
Being the first time we run it, we will ask how we want to use, click on the "Local Server" option
and in the box "Do not show this again". Click the "Next" button and it ask the type of virtual
machine we want to install, de- select the first option and leave blank the rest, click "Finish"
button.
Then it automatically opens the window "Preferences". Go to the "VirtualBox" section and
verify that the route "VBoxManage" is this:
C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
If not, browse for the path and define it, then click on the "Apply" button.

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 5


stevenvegar@gmail.com May, 2016
Then go to the "VirtualBox VMs" section and you click on the "New" button to install a new
router. GNS3 automatically find our virtual machine where we installed the MikroTik RouterOS.
If you receive an error message appears that says "Unable to find VBoxManage path", repeat
the previous step, looking for the file path and saving the changes with the "Apply" button.

Click the "Finish" button and GNS3 now have installed our Mikrotik router. But before use, we
must make several changes in the configuration. For that, click on the "Edit" button on bottom.

In this window we can modify the characteristics of our router.


- Change the symbol to a router.
- Change the category for "Routers".
- The RAM is the same as we install the virtual machine.
- Select the "Start VM in headless mode" option, that is to not open a console window every
time you start the router.

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 6


stevenvegar@gmail.com May, 2016
Then, in the "Network" tab must to enable 4 interfaces that we have installed on our virtual
router. Place the number 4 in the first box.
To save the changes click the "OK" button.

With this we have installed our MikroTik RouterOS router in GNS3.

Sixth step:
- Install loopback interfaces.

We have installed our router in GNS3, but we can only access it via the console. To use
WinBox and configure our router must install at least one loopback interface. We can use a
tool included in GNS3, loopback - manager.cmd.
- Open the Windows console (CMD) with administrator privileges.
- Enter to the path or folder where the GNS3 files are installed:
C:\Program Files\GNS3 >
- Run the program loopback-manager.cmd
- To install a loopback interface, press option 2.
- Close all open programs and restart the computer to the interface install takes effect.

If you see this error, "devcon.exe" is not recognized as a command, its because our Windows
does not have the program needed to install the device. To fix this, download the "devcon.exe"
file from the following address :
Windows 32bits: http://originaldll.com/file/devcon%20(2).exe/24149.html
Windows 64bits: http://originaldll.com/file/devcon64%20(2).exe/24150.html

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 7


stevenvegar@gmail.com May, 2016
After downloading, copy it and paste into GNS3 installation folder and change the file name
to simply "devcon" or "devcon.exe".

After reboot the computer, go to Control Panel, Network and Sharing Center and go to options
on the left enter "Change adapter settings". We find a new type of interface "Loopback Adapter
Microsoft" or "KM -TEST Microsoft Loopback Adapter". To identify it change the name to
GNS3.

Also you can install a loopback interface with the Microsofts method:
https://support.microsoft.com/en-us/kb/839013

Seventh step:
- Connect the virtual router with WinBox.

Open the GNS3. We asked for the name of our new project.
Then in the section "Routers" on the left, we find our virtual router MK1 and drag it to the work
area. Then we go to the section "Switches" and move to the work rea one "Ethernet Switch".
On it press right click and select "Configure". Choose any port and give the "Delete" button 8
times to remove all ports. Now we create a new port using the "Add" button but in the port type
select "dot1q". Then create another port but with the type "access".
In the left pane, go to end devices and choose the computer called "Host", this simulates our
computer, take one to the work area.
Now select the link button on the left to add a new "link" and connect the router MikroTik MK1
to the switch port number 1. Then connect from our "host" port "GNS3" to port number 2 of
the switch.
The port type "dot1q" has the feature that allows multiple devices communicating through it,
but within the same VLAN tagging (native). The "QinQ" port allows "trunking" multiple vlans,
and the access port is used for end devices, which do not transmit data from other devices,
but only the data of themselves.

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 8


stevenvegar@gmail.com May, 2016
This is how it should be configuring the switch ports:

So, this is our initial topology, only to have access via WinBox.

Now right click on the MK1 router and select "Start". If you have an open VirtualBox, you will
se the virtual machine starts automatically, because we are running it from the GNS3.
Finally open the WinBox and wait a few seconds while your router appears.

We entered through the MAC address because we dont have any configuration on the router.
With this setup we can have access to Mikrotik and configure anything we want.

Eighth step:
- Order a license for our virtual router.

We can use our router without any problem only for 24 hours, because it does not have a valid
license installed. By default, the installation image brings a license level 0, which has time
limit.
To use the router without time limit, we will request a level 1 license through the Mikrotiks
website.

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 9


stevenvegar@gmail.com May, 2016
First, go to the router and on the System tab -> License, is the license status, we currently
have level 0. To increase the license level, we need the "Software ID" which will be entered
on Mikrotiks page.

Now we enter the address https://www.mikrotik.com/client/ and enter in our Mikrotiks account,
in case you have no account with the registry you can create one for free. Once we enter, go
to the part of "Generate a NEW software KEY" and click on "make a demo key". On the next
screen asks us for Software-ID, which is taken from the license details from our WinBox,
copy and paste it and select "Next" button.

Now we will get the license code, select all the key and copy it (Ctrl + c).

Then we return to WinBox and go to license information, click on the "Paste Key" button and
if is properly installed the license, it will give a message that says "for the changes take effect
must restart the system", select yes for the license data apply. We wait for the router to restart
and check the license status again and see if everything went well.
As we see, as we increase the level of the license and now we can use it without the time limit.
This is the licensing process, with all levels is similar.

Nineth step:
- Create a cloud in GNS3 and connect the router to the Internet.

To use the cloud in GNS3 and functioning properly must connect to internet through our
interface computer output.

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 10


stevenvegar@gmail.com May, 2016
We must create a new loopback interface, exclusively for use outputted internet. Once created
correctly, open the "Control Panel" of Windows, go to "Network Connections" and then
"Adapter Configuration". First let's rename the new loopback interface to differentiate, we will
call it "GNS3 Internet". Then we identified the interface you get internet on our computer, either
wired (Ethernet) or wireless (Wi-Fi). Press the right click on the interface and select
"Properties". In the tab "Sharing" select the first box, which allows you to share the internet
connection through itself and select the loopback interface "GNS3 Internet". Go out with the
"OK" button to save the changes. If all went well, the description of the interface will read
"Shared".

Now in GNS3 create a cloud and go to the configuration window, add a new interface, the
loopback interface, "GNS3 Internet". Recall that it must be connected to the router via switch,
we can not connect them directly because we will get a connection error, because it is not
supported connect a physical interface with a virtual directly. With this we have connected the
router to the Internet.
To have the connection to the router, we must create a "DHCP client" to provide an IP address,
configured from the interface we have connected the cloud and if everything is correct, we will
have an IP and automatically connection to internet is configured.

Recomendations:
- To have multiple virtual routers, it is best to install each one separately, do not use the
VirtualBox option "clone" because it also doubles the MAC addresses of the router and
can create connection problems.
- We can have all virtual routers we want, if we change PC or want to share the router, the
VirtualBox option "Export" is used and we make an .ova file containing the router and can
"Import" on another PC.
- If you have problems starting or stopping the router from GNS3, we can see the state of
the virtual machine in VirtualBox, either on, off or aborted.

I hope this information will be useful for testing and study of configurations.
#MikrotikRules Again demonstrating that MikroTik routers are the best.

Steven Vega Ramrez - MTCTCE - MTCRE San Jos, Costa Rica 11


stevenvegar@gmail.com May, 2016

You might also like