MikroTik Router Integration and Configuration on GNS3

GNS3 is a network simulator software used by hundreds of thousands of network engineers worldwide to emulate, configure, test and troubleshoot virtual and real networks. GNS3 can talk a large number of network vendors including MikroTik. MikroTik introduces Cloud Hosted Router (a RouterOS version) that is used to run as virtual machine and a virtual machine can easily be integrated with GNS3. So, network administrators who are fond of MikroTik Router can now configure, test and troubleshoot their MikroTik network with GNS3 so easily. In my previous article I discussed how to install and configure GNS3 in Windows Operating System and in this article I will show how to integrate and configure MikroTik Router on GNS3 to simulate any MikroTik network.

MikroTik Router on GNS3

GNS3 is the best friend for those who are unable to arrange a lot of real devices and fail to configure, test and troubleshoot any complex network with MikroTik Router. GNS3 can now talk with MikroTik Router. So, emulating MikroTik Router on GNS3, a network administrator can easily do R&D and can implement it to production environment.

MikroTik Router integration and configuration on GNS3 can be divided into the following three steps.

  • Downloading MikroTik Cloud Hosted Router from MikroTik official website
  • Installing MikroTik Cloud Hosted Router on GNS3 and
  • Configuring a basic MikroTik network on GNS3.

Downloading MikroTik Cloud Hosted Router from MikroTik Official Website

MikroTik introduces Cloud Hosted Router (CHR) that can be used as a virtual machine on most of the popular hypervisors such as VMware, Hyper-V, Virtual Box, KVM as well as GNS3. So, we will download MikroTik CHR and integrate it in GNS3. The following steps will show how to download MikroTik CHR from MikroTik Official Website.

  • Go to MikroTik Official Website [mikrotik.com] from your favorite web browser and click on Software menu item. Software page will appear. Inside Software page, click on Download archive menu. Download archive page will appear where all current and historical MikroTikOS releases will be listed.
  • Expand any bugfix and stable release that you like. You will find four CHR files are available here. Among these, click on chr-version.img.zip file (such as chr-6.40.9.img.zip).
  • In a few seconds, your download will be started and within a few minutes your download will be completed.
  • Go to your download location and unzip the downloaded zip file. You will find a (.img) [chr-6.40.9.img] file now.

MikroTik CHR is now in your Desktop. In the next step, we will install MikroTik Router on GNS3 using this Cloud Hosted Router.

Installing MikroTik Cloud Hosted Router on GNS3

After downloading MikroTik Cloud Hosted Router (CHR image file) from MikroTik official website, it is time to install it on GNS3. The following steps will show how to install MikroTik Cloud Hosted Router on GNS3 as QEMU VM.

  • Run GNS3 and go to Edit > Preferences. Preferences window will appear.
  • Inside Preferences window, Click on Qemu VMS from left panel. Qemu VM templates panel will appear at the right side.
  • Inside Qemu VM templates, click on New button. You may find a warning message about The recommended way to run QEMU on Windows and OSX is to use the GNS3 VM. As we are not using GNS3 VM, just click OK button. New QEMU VM template window will appear.
  • New QEMU VM template window will ask to provide a name for the new virtual machine. Put a suitable name (example: MikroTik-6.40.9) in Name input field and then click on Next button.
  • New QEMU VM template window will ask to adjust virtual machine RAM. By default it is assigned 256MB that is enough for a test MikroTik Router. If you wish you can increase RAM size by editing RAM input filed. Click on Next button now.
  • New QEMU VM template window will ask to choose Console type. Among three console type, choose telnet from dropdown menu and click on Next button.
  • New QEMU VM template window will ask to choose Disk image for this virtual machine. Click on Browse button and choose your downloaded CHR image file. Now it will ask whether you want to copy this image file to default images directory or not. Click on Yes button and then click on Finish button.
  • Now you will find newly created MikroTik VM in Qemu VM templates panel. Click on Edit button. QEMU VM configuration window will appear.
  • Inside QEMU VM configuration window, click on Network tab. By default one network adapter is assigned for a new virtual machine. But our MikroTik Router requires minimum two network adapters. So, change Adapters value one to two and then click on OK button.
  • Click Apply and OK button to save new MikroTik QEMU VM.
  • A new appliance named MikroTik-6.40.9 (according to your provided name) will now be available in appliance list. Click on Brose all devices button from devices toolbar and choose installed appliances and you will find your new MikroTik appliance is available here.

We have successfully integrated MikroTik Router on GNS3. Now it is time to configure and test our integrated MikroTik Router by designing and configuring a basic network on GNS3.

Configuring a Basic MikroTik Network on GNS3

After installing MikroTik Router on GNS3, it is time to configure a basic MikroTik network on GNS3 and test whether it is able to talk with the real network or not. Complete network configuration on GNS3 with MikroTik Router can be divided into two parts.

  • Designing a basic MikroTik network on GNS3 and
  • Configuring the network devices to talk with real network.

Designing a Basic MikroTik Network on GNS3

Before going to start MikroTik Router configuration, we first need to design a MikroTik network on GNS3. In this article, we will configure a basic network that looks like to the below image.

Basic Mikrotik Network on GNS3
Basic Mikrotik Network on GNS3

In this network diagram, MikroTik Router’s ether1 port is connected to internet cloud which is also connected to the public network. On the other hand, MikroTik Router’s ether2 port is connected to an Ethernet Switch and two VPCSs are connected to this Switch. We will now configure this network so that MikroTik Router as well as two VPCSs is able to communicate with the public network. So, design this MikroTik network on GNS3 and follow the below section to configure it. If you face any difficulty to design this network on GNS3, feel free to visit my previous article about GNS3 installation and configuration where I have discussed how to design networks on GNS3.

Configuring GNS3 Network Devices to Talk with the Real Network

In the above network diagram, there are five network appliances. Among these Ethernet Switch is a plug and play device. So, there is no configuration for LAN Switch. But we have to configure Internet Cloud, MikroTik Router and two VPCS.

Cloud Configuration

Cloud is the virtual internet POP in GNS3. So, it has to connect to any real network adapter.  Click mouse Right Button on the cloud icon and click on Configure option.  Node properties window will appear. Inside this window, click on Ethernet interfaces tab. Inside Ethernet interfaces tab, choose your desired network adapter that you want to bind with this Cloud from dropdown menu and then click on Add button. (If you don’t find your desired network adapter in dropdown menu, click on Show special Ethernet interfaces checkbox and you will find that your desired network adapter will now be available in interface dropdown menu). Your added network adapter will be listed in the Ethernet interfaces box area. Now click Apply and OK button.

MikroTik Router Configuration

We will just do some basic configurations in MikroTik Router. Basic MikroTik Router configuration includes assigning WAN IP, LAN IP, DNS IP as well as Route and NAT configuration. The following steps will show how to perform these tasks on MikroTik Router.

  • Click mouse right button on MikroTik Router icon and click on Start option to start MikroTik Router. Again click mouse right button and click on Console option. Putty command prompt will appear that will ask for login. Provide MikroTik login value ‘admin’ and keep password blank. Now MikroTik command prompt will appear.
  • Integrated MikroTik Router has two interfaces (ether1 and ether2). We will assign WAN IP (192.168.30.2/29) on ether1 interface and LAN IP (10.10.200.1/24) on ether2 interface. So, issue below command to assign WAN IP on ether1 interface.
    ip address add address=192.168.30.2/29 interface=ether1
  • Collect a PC where MikroTik WAN IP is accessible and download Winbox from MikroTik official website.
  • Open Winbox and put MikroTik WAN IP in Connect To input box and put ‘admin’ in Login input box and keep Password field blank and then click on Connect button. Winbox will now connect with MikroTik Router.
  • Go to IP > Addresses menu item. Address List window will appear and you will find your assigned WAN IP is listed here.
  • Click on PLUS SIGN (+) and put LAN IP (10.10.200.1/24) in Address input field and choose LAN interface (ether2) from Interface dropdown menu and click on Apply and OK button.
  • Go to IP > DNS and put DNS servers IP (8.8.8.8 or 8.8.4.4) in Servers input field and click on Apply and OK button.
  • Go to IP > Firewall and click on NAT tab and then click on PLUS SIGN (+). Under General tab, choose srcnat from Chain dropdown menu and click on Action tab and then choose masqueradefrom Action dropdown menu. Click on Apply and OK button.
  • Go to IP > Routes and click on PLUS SIGN (+). In New Route window, click on Gateway input field and put WAN Gateway address (192.168.30.1) in Gateway input field and click on Apply and OK button.
MikroTik Putty Command Prompt
MikroTik Putty Command Prompt

MikroTik Router has been completed. MikroTik Router is now ready to communicate with the public network. Test with ping command from MikroTik terminal. If everything is OK, you will get result.

Assigning LAN IP in GNS3 VPCS
VPCS is a PC simulator that helps to test network configuration with ping and trace route. VPCS supports either DHCP or static IP. In this article, we will assign static LAN IP in our VPCSs (PC-1 and PC-2) and test whether it can communicate with the real network or not.

Assigning Static LAN IP in PC-1
The following steps will show how to assign static IP address in PC-1.

  • Click mouse right button on PC-1 icon and then click on Console option. PC-1 command prompt will appear.
  • Issue ip command in PC-1 terminal with this format:[ip ip_address/netmask gateway] example: ip 10.10.200.2/24 10.10.200.1
  • To set DNS, issue dns command with ip command: [ip dns dns_server_ip] example: ip dns 8.8.8.8
  • To save this IP configuration, issue save command.
  • To show IP configuration, run show ip command.
PC-1 Terminal
PC-1 Terminal

Now ping to gateway or any public domain or trace route with trace command. If everything is OK, PC-1 will be able to ping and trace route to real networks.

Assigning Static LAN IP in PC-2
The following steps will show how to assign static IP address in PC-2.

  • Click mouse right button on PC-2 icon and then click on Console option. PC-2 command prompt will appear.
  • Issue ip command in PC-2 terminal with this format:[ip ip_address/netmask gateway] example: ip 10.10.200.3/24 10.10.200.1
  • To set DNS, issue dns command with ip command: [ip dns dns_server_ip] example: ip dns 8.8.8.8
  • To save this IP configuration, issue save command.
  • To show IP configuration, run show ip command.
PC-2 Terminal
PC-2 Terminal

Now ping to gateway or any public domain or trace route with trace command. If everything is OK, PC-2 will be able to ping and trace route to real networks.

If you face any confusion to follow above steps properly, watch the below video about MikroTik Router integration and configuration on GNS3. I hope it will reduce your any confusion.

How to integrate and configure MikroTik Router on GNS3 has been discussed in this article. I hope you will now be able to design any MikroTik network on GNS3 for R&D purpose. However, if you face any confusion, feel free to discuss in comment or contact with me from Contact page. I will try my best to stay with you.

Why not a Cup of COFFEE if the solution?

mikrotik-router-integration-and-configuration-on-gns3

ABU SAYEED

I am a system administrator and like to share knowledge that I am learning from my daily experience. I usually work on MikroTik, Redhat/CentOS Linux, Windows Server, physical server and storage, virtual technology and other system related topics. Follow Me: Facebook, Twitter and Linkedin.

Your name can also be listed here. Have an IT topic? Submit it here to become a System Zone author.

9 comments

  • Avatar for mohamed mohamed

    i can’t able to get internet in mikrotik from Cloud
    i select (local are connection) in Cloud
    i have ip in (Local Area Connection)
    ip address : 192.168.20.6
    subnetmask: 255.255.255.0
    getway: 192.168.20.1
    DNS : 8.8.8.8

    i configured mikrotik to
    ip address : 192.168.20.77/24 interface= ether1
    and make link between cloud(local area connection) and Mikrotik (Ethernet 0)
    and ping to ip address 192.168.20.6 (pass)
    but when ping in ip address 192.168.20.1 (Fail)

    i am not connected in Router
    please help me to get internet in mikrotik

    • Don’t put IP in Local Area Connection. It will just be connected to your physical switch. Hope you will now be able o ping your uplink router gateway (192.168.10.1). Please watch my video carefully.

  • Sir is there any way to install MikroTik router os over Cloud or any company provide the solution like this.

    Thanks in advance

    • Why do you use cloud? If you have virtualization (cloud) system in your organization, you can install mikrotik os on it but it is always suggested to use RouterBoard.

  • Avatar for KAPIAL KAPIAL

    Grate ………explain

  • Avatar for kashif kashif

    is it necessary that my lan and mikrotik network have to be same

  • Avatar for kashif kashif

    i have LAN network ip 10.32.26.8/22
    and mikrotik ip is 10.32.24.10/22

    but unable to pinf gateway or ping any other IP

Leave a Reply

Your email address will not be published. Required fields are marked *

*