Professional Documents
Culture Documents
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
2- Oracle VM VirtualBox
4- Mikrotik WinBox
Done.
Third Step:
- Start VirtualBox and create a new virtual machine with the disk image Mikrotik RouterOS.
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.
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.
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.
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.
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
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.
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.
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.
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.