Mikrotik In Gns3

 

Consulting MikroTik Training Network Monitoring Design &Engineering Quality of Service Firewalls. Reserving the 1stNIC Inside GNS3. 24/7/365 MikroTikTAC Nationwide Private 4G LTE MPLS Proactive Network Monitoring Design / Engineering / Operations. Www.rickfreyconsulting.com 903-245-1557. GNS3 24/7/365 MikroTik TAC Nationwide Private 4G LTE MPLS Proactive Network Monitoring Design / Engineering / Operations. Graphical Network Simulator. Combines other open source platforms to visually and cohesively simulate network environments. Dynamips – Cisco IOS emulator. VirtualBox – Runs RouterOS and other x86 software. Qemu – Machine Emulator to run Cisco ASA, PIX, and IPS 903.

Overview

In this lab, you will install and configure GNS3 on your computer and setup your first network topology.

What is GNS3?

GNS3 is used by network engineers to emulate, configure, test and troubleshoot virtual and real networks. GNS3 allows you to run a small topology consisting of only a few devices on your laptop, to those that have many devices hosted on multiple servers or even hosted in the cloud. -- https://docs.gns3.com/docs/

For your reference, detailed installation document for all platforms is available on the GNS3 website, as the process does vary somewhat between platforms:

  • Windows: https://docs.gns3.com/docs/getting-started/installation/windows
  • Mac: https://docs.gns3.com/docs/getting-started/installation/mac
  • Linux: https://docs.gns3.com/docs/getting-started/installation/linux

Step 1 : Install VMware

Install VMware Fusion (Mac) or VMware Workstation (Windows). Normally these are paid ($$) commercial products, but SOECS has free licenses for Pacific students.

Do not use the stripped-down free VMware Player. It does not come with support for the VIX API, which allows programs (like the GNS3 network simulator) to control the operation of virtual machines.

VirtualBox is supported by GNS3. (But the instructor has not tested it.)

Step 2: Install GNS3

Note: Install GNS3 inside your native operating system. Do not put it inside your Ubuntu VM or you'll run into an eventual issue with nested virtual machines. We'll use Ubuntu for class projects and homework assignments.

  1. Go to https://www.gns3.com/
  2. Select “Free Download'
  3. Select Windows, Mac, or Linux as appropriate, and then “Download'
  4. Create your GNS3 Community Account as prompted, login, and then return to the Download page
  5. Run the installer you downloaded and accept the default options. (If prompted, permit ubridge to run as root to capture packets)

Step 3: Install GNS3 VM

After installing the base GNS3 program, you next need to install the “GNS3 VM”. It’s a Ubuntu Linux virtual machine that has all the necessary software pre-installed that allows you to simulate more complicated devices. This is why VMware was needed as the first installation step - it will be doing some of the virtualization heavy lifting.

  1. Go to https://www.gns3.com/software/download-vm
  2. Select the image for “VMware Workstation and Fusion'
  3. Extract the .zip file
  4. Launch VMware (Fusion or Workstation)
  5. Select “Import” (or “Open a Virtual Machine”) and navigate to the .ovf file ('GNS3 VM.ovf') that you just downloaded and unzipped
  6. Let VMware import it as a new VM. Accept the default location and accept the default name it offers ('GNS3 VM') since that will simplify locating it later.

Step 4: GNS3 Setup

  1. Launch GNS3
  2. Mac: You will see the prompt “uBridge requires root permissions to interact with network interfaces”. Say YES, that will allow us to connect GNS3 with the real network if we desire.
  3. Next, choose how to run your GNS3 network simulations. Your choices are:
    1. Run appliances on my local computer
    2. Run appliances in a virtual machine <- Choose this option
    3. Run appliances on a remote server
  4. Next, enter the GNS3 local server settings
    1. The default server path, binding, and port are fine here
  5. Next, enter the “GNS 3 VM” settings
    1. If you correctly installed the GNS3 VM above (downloaded it, imported it into VMware, and accepted the default name of “GNS 3”), it should be auto-detected now. One CPU core and 2048MB of RAM should be sufficient to accommodate all the virtual routers we might want to simulate at any given time. Hopefully.
  6. VMware should be automatically launched now, and start running the GNS 3 VM by itself. This is thanks to the VIX API that allows GNS3 to control VMware.
  7. Complete the setup wizard. Note: You can change these settings at any time by locating the “Setup Wizard” from the application menus.

Step 5: Install Mikrotik Router into GNS3

Out of the box, GNS3 doesn’t come with any routers, just a very basic switch, hub, and a stripped down “computer” suitable for basic network connectivity tests. That’s about it. However, by integrating with some emulator software (QEMU) and a x86/x64 virtualization engine (VMware), it has the capability to run real operating systems for routers. As in, you can give GNS3 the same binary image you'd load on the real router, and (with proper configuration...) it will 'just work'. So, rather than working with a facsimile of a router, you can interact with the real router software.

Let's configure GNS3 with the image of a real router from MikroTik, which is the same vendor as the routers that are in the networking lab in CTC 214. As a bonus, unlike certain other vendors (cough Cisco cough), their OS images are freely available and easy to download.

First, obtain the router OS image:

  1. Go to https://mikrotik.com/
  2. Click on “Software'
  3. Scroll down to their “Cloud Hosted Router” section. That’s just their marketing term for a software router (Linux + their proprietary command line interface) that could run on any old PC that has a couple of network cards in it.
  4. Look at the column labeled “Stable”, and go down to the row labeled “Raw disk image”. That’s the download link you want.
    1. For example, in August 2020 the latest stable release was 6.47.1, and the download link for the raw disk image was https://download.mikrotik.com/routeros/6.47.1/chr-6.47.1.img.zip
  5. Unzip the file

Next, configure GS3 to recognize this image as a valid router, suitable for placement into a network diagram:

  1. In GNS3, go to the Preferences window
  2. Locate the QEMU section in the panel window, and under it, the section labeled “Qemu VMs'
  3. Select “New” to create a new Qemu VM template
  4. Select “Run this Qemu VM on the GNS3 VM'
  5. Enter a name for your image - “Mikrotik 6.47.1” is a helpful and obvious name - and click Next
  6. Select the amount of RAM for your router OS - 256MB is sufficient here, and given that we will eventually want multiple routers, it’s best not to pick too large of a number
  7. Choose your console type - “Telnet” - and click Finish
  8. Choose your disk image, which is the .img file you downloaded previously. Allow GNS3 to copy it to the default images directory, and click Next.
  9. Your template is now created, but there’s a few subtle but important network settings to change. Locate the “Network” panel for the Mikrotik image you created.
    1. Currently it says 1 adapter (Ethernet) of type e1000. Change it to have 4 adaptors. No point in having a router with a single network interface! Click “Edit', select the “Network” tab, and change the 1 to a 4.
    2. Change the Name format from “Ethernet” to “Ether” to match the router CLI syntax.
    3. Finally, fix an annoying display issue. GNS3 numbers its ports starting from 0, but Mikrotik numbers its ports starting at 1. You can anticipate the frustration if you mix this up in a lab and network data is going out across the wrong wire to the wrong destination. To fix this, click on the “Configure custom adapters” button and re-name the Port names from Ethernet0,...,Ethernet3 to Ether1,..,Ether4. That will match the Mikrotik labels in the OS.
  10. Under the “General Settings” panel, change the “Category” from “End Devices” to “Routers' so this device is in the router category.
  11. Under the 'General Settings' panel, change the 'Symbol' that appears in the network diagrams. Click on Browse, and under 'Classic', find the icon for the 'Router'.
  12. Under the 'General Settings' panel, change the 'On Close' option from 'Power Off' (Harsh! Abrupt! Router OS will complain!) to 'Send the Shutdown Signal (ACPI)' which is gentle and orderly.
  13. Select “Ok” to edit the Preferences panel entirely.

Behind the scenes, GNS3 will copy the disk image for the Mikrotik router into the GNS VM (in VMware) that you installed previously. That VM contains all the necessary software and settings to virtualize this router.

Now you have a router that can be added to your network!

Step 6: First Network

  1. Create a “New Blank Project” and call it lab01.
  2. Drag two “VPCS” (Virtual PCs) onto the blank network diagram from the panel at left (found under the “Browse End Devices” button) . If prompted to 'Choose a server', select 'GNS3 VM'.
  3. Drag a “Mikrotik 6.x” router onto the network diagram from the panel at left (found under the “Browse Routers” button)
  4. Using the “Add a link” button on the left panel, wire up the network using virtual Ethernet cables! Make your network look like the network below.
    • Note: The PCs only have 1 interface, so you can’t connect the wire to the wrong port there
    • Note: The Router has 4 interfaces. The ports you plug your network wires into must be consistent with the way you configure your router in software. For now, just carefully match the diagram. In future labs, when you’re more comfortable, you can make port decisions on your own.
    • Note: Wondering why your diagram doesn’t show port labels? Press the “Show/Hide Interface Labels” button.


Lab 1 Network Diagram (Note: Subnet labels and dashed borders are for informational use only)

  1. Press the Start button to launch your two virtual PCs and router. All the links should turn from RED to GREEN.
  2. Press the Console Connect to All Nodes button to pull up a terminal to all three devices. (You could right-click on each and choose Console as well, but we need to configure all three).

At the MikroTIk console:

  1. Note: We are configuring the router first, because we can’t configure the PC network fully until the default gateway (the router) exists.
  2. Enter the default Mikrotik login of admin with a blank password.
  3. Select N when prompted to view the license file.
  4. Configure two interfaces (corresponding to the two wires plugged in)
    1. ip address add address=10.11.12.254/24 interface=ether1
    2. ip address add address=20.30.40.254/24 interface=ether2
  5. Print the configuration to confirm: ip address print

At the PC1 console:

  1. Show the help menu for available command (recall that this is a rudimentary simulated PC): help
  2. Configure an IP address: ip 10.11.12.1/24 10.11.12.254
    1. This sets up a subnet of 10.11.12/24, assigns the PC the IP address 10.11.12.1, with a default gateway of 10.11.12.254 (which is the router)
  3. Show the configuration: show ip
  4. Save the configuration to persist after power cycling: save

At the PC2 console:

  1. Configure an IP address: ip 20.30.40.1/24 20.30.40.254
    1. This sets up a subnet of 20.30.40/24, assigns the PC the IP address 20.30.40.1, with a default gateway of 20.30.40.254 (which is the router)
  2. Show the configuration: show ip
  3. Save the configuration to persist after power cycling: save

Finally, demonstrate the network is functional:

  1. Go to the PC 1 console
  2. Ping PC2 through the router: ping 20.30.40.1
  3. You should see something to the effect of 84 bytes from 20.30.40.1 icmp_seq=1 ttl=63 time=2.699 ms indicating that PC2 is responding to PC1.
  4. Press CTRL-C to exit

Lab Submission Instructions:
Take a screenshot showing:

  1. Your GNS3 topology
  2. Your PC1 terminal with BOTH its IP address information AND the successful ping(s) to PC2 clearly visible.

Upload your screenshot to the Lab 1 Canvas assignment.

When finished, press the Stop button and exit GNS3. The GNS3 VM (in VMware) should halt and exit automatically.

GNS3 Operation

Troubleshooting Tips

For all errors of the type 'Cannot connect to compute 'GNS3 VM' with request...'

  • Look in VMware to see the 'blue splash screen' where your GNS3 VM is running. It will say: 'To launch the Web-Ui: http://aaa.bbb.ccc.ddd' - Can you load that up in your web browser to verify networking with the VM is functional? That address will take you to the alternate web interface for GNS3, which runs out of the VM.
  • Under GNS3 -> Preferences -> GNS3 VM - Ensure that the port is set to 80. (This should be the same port number you see in VMware when the GNS3 VM is running)
  • For VMware Workstation Pro (on Windows): Try resetting your virtual network adaptors. Stop the GNS3 VM, and then go to Edit->Virtual Network Settings. Click 'Change Settings' and then 'Restore Defaults'. Exit VMware, exit GNS3, and then try again. This may be a temporary (but simple) fix.
  • For VMware Workstation Pro (on Windows): Try disabling and enabling any 'VMnet' virtual network adaptors. Go to Control Panels -> Network & Internet -> Network & Sharing Center -> Change Adapter Settings. Find any that are 'VMnet' and disable/enable them.
  • For VMware Workstation Pro (on Windows): Under the Edit->Virtual Network Settings, try changing your VMnet8 (or equivalent) adaptor so that it is bridged with the specific network interface you are using to access the Internet, instead of auto-detected (which may be going awry). This may be a longer-term fix, if successful.

Upgrading

The GNS3 GUI client can be updated at any time. It will automatically check for updates and prompt you.

After the GNS3 client is updated, the GNS3 VM (in VMware) also needs to be updated. Find the virtual machine console - it should automatically start when the client is started. Press ENTER (OK) to go into the main menu, and then using the arrow keys, select the 'Upgrade' option to Upgrade the GNS3 VM. Confirm that you want to upgrade, and select the most recent GNS3 version offered. This should be consistent with the version of the GUI client you just downloaded and installed. The update system will now download and install the latest VM release, after which the VM will restart.

Hi, I started studying routeros, so I have a couple of questions to ask:
1) Which version of Routeros do I prefer to use gns3? Routeros x86 img with qemu? Cloud Hosted Router with qemu / vmware?

Konfigurasi Vlan Mikrotik Gns3

2) I used the os x86 x86 image, launching it with the following command: 'qemu-system-i386w.exe mikrotik.img -m 256 -enable-kvm -net none -boot dc: images mikrotik-6.28. Big, then i have imported in gns3, with linked vm mode.
When i use the command: '/interface print detail' on every router i have always the same MAC ADDRESS on ethernet1 interface:
exemple:
[[email protected]] > /interface print detail
Flags: D - dynamic, X - disabled, R - running, S - slave
0 R name='ether1' default-name='ether1' type='ether' mtu=1500
actual-mtu=1500 mac-address=52:54:00:12:34:56 fast-path=no
last-link-up-time=jun/11/2017 11:58:02 link-downs=0


1 R name='ether2' default-name='ether2' type='ether' mtu=1500
actual-mtu=1500 mac-address=00:2B:C8:D0:DC:01 fast-path=no
last-link-up-time=jun/11/2017 11:58:02 link-downs=0
2 R name='ether3' default-name='ether3' type='ether' mtu=1500
actual-mtu=1500 mac-address=00:2B:C8:D0:DC:02 fast-path=no
last-link-up-time=jun/11/2017 11:58:03 link-downs=0
3 R name='ether4' default-name='ether4' type='ether' mtu=1500
actual-mtu=1500 mac-address=00:2B:C8:D0:DC:03 fast-path=no
last-link-up-time=jun/11/2017 11:58:03 link-downs=0
4 R name='ether5' default-name='ether5' type='ether' mtu=1500
actual-mtu=1500 mac-address=00:2B:C8:D0:DC:04 fast-path=no
last-link-up-time=jun/11/2017 11:58:03 link-downs=0
on the second router:
[[email protected]] > /interface print detail
Mikrotik gns3 labFlags: D - dynamic, X - disabled, R - running, S - slave
0 R name='ether1' default-name='ether1' type='ether' mtu=1500
actual-mtu=1500 mac-address=52:54:00:12:34:56 fast-path=no
last-link-up-time=jun/11/2017 11:49:52 link-downs=0
1 R name='ether2' default-name='ether2' type='ether' mtu=1500
actual-mtu=1500 mac-address=00:2B:C8:C5:96:01 fast-path=no
last-link-up-time=jun/11/2017 11:49:53 link-downs=0
2 R name='ether3' default-name='ether3' type='ether' mtu=1500
actual-mtu=1500 mac-address=00:2B:C8:C5:96:02 fast-path=no
last-link-up-time=jun/11/2017 11:49:53 link-downs=0
3 R name='ether4' default-name='ether4' type='ether' mtu=1500
actual-mtu=1500 mac-address=00:2B:C8:C5:96:03 fast-path=no
last-link-up-time=jun/11/2017 11:49:53 link-downs=0
4 R name='ether5' default-name='ether5' type='ether' mtu=1500
actual-mtu=1500 mac-address=00:2B:C8:C5:96:04 fast-path=no
last-link-up-time=jun/11/2017 11:49:54 link-downs=0
why on ethernet1 interface i have always same mac address ? it's normal ?
Do I have to change it?

Mikrotik Gns3 Tutorial

Can I use it without problems?

Mikrotik Network Simulator

Tutorialthanks