Applies to RouterOS:v3, v4
RouterOS is a stand-alone operating system based on Linux kernel. It powers MikroTik hardware devices, but is also available for virtual machines. If you are reading this document and have no prior experience with RouterOS, please use the menu on the left hand side, to learn about first steps with RouterOS. Create a new virtual machine. Step 1: Step 2: Step 3: Choose existing virtual disk. Step 4: Select the file you downloaded from mikrotik.com download page. Step 5: Step 6: By default VMWare uses 256MB RAM, adjust the size if needed, any size starting from 128MB can be used for RouterOS. Step 7: Adjust the size of the RAM. Article contains details and recommendations for RouterOS CHR virtual machine setup for The Dude server. CHR setup and VM details. Create RouterOS CHR virtual machine on one of supported. Create a new virtual machine. Video instruction. Step by Step Instruction. Step 1: Open VirtualBox management windows; Step 2: Create new guest, select Other linux (64bit) Step 3: Select amount of. Mikrotik routeros is the operating system of mikrotik routerboard hardware. It can also be installed on a pc and will turn it into a router with all the necessary features routing, firewall, bandwidth management, wireless access point, backhaul link, hotspot gateway, vpn server and more.
- 4Creating a Metarouter
- 5OpenWRT as virtual machine
- 9Configuration examples
- 10Reference
- 11Known Issues
- 11.1MIPS-BE
- 11.2PPC
Overview
MetaRouter is a new feature in RouterOS 4.0 beta 1 and RouterOS v3.21
Currently MetaRouter can be used on
- RB400, RB700 series except models with SPI flash, RB900 series except models with SPI flash, RB2011 boards
- Listed PPC boards: RB1000, RB1100, RB1100AH and RB800.
Requirements
Each Metarouter instance uses the same amount of resources as a stand-alone RouterOS installation. It means that you need a minimum of 24MB of RAM for each RouterOS virtual machine plus memory for the MetaROUTER host itself. It is suggested to have more than 24MB memory available for each Metarouter. Upcoming RouterOS versions will have ability to run virtual machines with less than 16MB per machine.
Note:It is possible to run other virtual machines with less than 24MB RAM per machine if the virtual operating system is OpenWRT. The 24MB limitation is only for virtual RouterOS installations.
Currently on one host you can create up to 8 virtual machines and up to 8 virtual interfaces. Workaround to have more than 8 interfaces in total is to use VLANs. In future versions it will be possible to add up to 16 virtual machines.
Also it is not possible to use external storage devices (Store) in the metarouter virtual devices.
Where it can be used?
The MetaRouter function is useful for allowing clients or lower-privilege users access to their own 'router' and config to configure as they like, without the need for a complete second router, or giving them access to the main router configuration.
For example; a WISP can create a virtual router for the clients ethernet port allowing them to define their own firewall settings, while leaving the WISP's wireless settings untouched.
Creating a Metarouter
As you can see, creating virtual router is quite easy, you just have to specify name of the router, how much RAM will be allocated for it and disk size that will be used by virtual router. Explanations of all other properties are available in reference manual.
Note: * be careful when using dynamic HDD size for metarouters, a proxy could fill up all your hosts storage!
Example with no settings
If you will add a new metarouter without specifying any parameters, it will be added with Dynamic HDD size, and 16MiB of RAM:
OpenWRT as virtual machine
Starting from v3.24 and v4.0beta3 MetaROUTER has the ability to import custom built images. As an example we will show how to patch and use OpenWRT as the virtual machine.
Importing image
If you don't have any specific needs, you can import our prebuilt OpenWRT image, which is downloadable MIPS image, PPC image. Upload openwrt image to the router and import it by import-image command:
As you can see OpenWRT is running, now you can start configuration process, which is explained in sections below.
Building your own OpenWRT image
If you are not satisfied with our prebuilt version of OpenWRT, then you can build and use your own image.
First step is to install svn and get the latest source code from openwrt.org
Note: Patch 1.2 was made against older kernel then in current trunk and some extra steps should be taken to apply it to OpenWRT. For example r29684 can be used without modifications
Now you have to patch downloaded source with our patch
Note: Patch v1.2 adds newer kernel support which makes it possible to compile with latest OpenWRT revisions. This patch also adds PowerPC support (ability to run OpenWRT image on RB1000 and RB1100).
When source is patched, you have to set up configuration options
Go to Target System menu and choose Mikrotik MetaROUTER MIPS or Mikrotik MetaROUTER PowerPC from the list depending for which platform you are building the image.
Other options depends on what is your requirements (include for example IPv6 and ppp support or not), you can also stick with defaults.
If you see any error messages while trying to launch menuconfig, like
It means that required libraries are not installed, check the output and install all required libraries.
When you are done with build configuration, type
It will take a while to build everything so you can go and have a cup of tea.
After the build process is done, upload newly built image to the router and import it as described in section above.
Warning: On newer GCC versions you may be required to add this patch from OpenWRT [1]
For more options and build instructions look in OpenWRT's documentation
Adding Interfaces
First, you need to add a new interface to your virtual router. This is done in the interface menu.
The interface command has the following options:
Description of each option can be found in reference manual.
Let's add one interface:
On the host physical router the interface appears as a virtual interface:
Connecting to the virtual machine
To connect to your virtual machine, use the console command:
You will see your newly added virtual interface here:
To disconnect from the metarouter virtual machine console, hit CTRL + A and then Q to Quit back to your Host console (if you are using minicom, hit CTRL + A twice):
Configuring a virtual network
Right now you saw that the virtual interface is visible in the HostInterfaces menu as vif1 and also in the metarouter interfaces menu as ether1. You can add an IP address on both interfaces, and set up networking. Creating a bridge between the virtual interface and a physical interface allows traffic to pass.
Mikrotik Routeros Virtual Machine Configuration
Configuration examples
Creating isolated Metarouter for client
This Example will show how to use Metarouter feature to create a isolated router on top of the WISP client site router. The setup for the example is shown on the diagram below:
1. Adding a Metarouter for client:
2. Adding Metarouter Interfaces for the new created Metarouter:
3. Creating a Bridge Interface for bridging metarouter interface together with ethernet interface where the client is physically connected:
4. Adding IP configuration for the new Metarouter interface which will be used for connecting between Metarouter and Metarouter Host system:
5. Connecting to Metarouter using the Console
6. Configuring Metarouter to make it easy for client to understand the configuration:
Reference
General
Sub-menu:/metarouter
Menu specific commands:
Property | Description |
---|---|
console(console <vm-id>) | connect to specified virtual machine's console |
import-image(import-image file-name=<image-file>) | import custom built image (available starting from v3.24 and v4.0b3) |
reboot(reboot <vm-id>) | reboot specified virtual machine |
shut-down(shut-down <vm-id>) | shut down specified virtual machine |
start(start <vm-id>) | boot up specified virtual machine |
Configurable properties:
Property | Description |
---|---|
disk-size(unlimited|0..4294967295[kiB] ; Default: unlimited) | Disk size that will be allocated by virtual router. |
memory-size(16..256[MiB] ; Default: 16) | Amount of memory that will be allocated by virtual router. |
name(string ;) | Name of the virtual machine. |
Read only properties:
Property | Description |
---|---|
used-disk(integer[kiB] ;) | currently used disk space by virtual router. |
disk-reads(integer;) | number of disk reads |
disk-writes(integer;) | number of disk writes |
state(booting|running|rebooting|shutting-down|stopped|disabled;) | current state of virtual machine |
Interface
Sub-menu:/metarouter interface
Configurable properties:
Property | Description |
---|---|
dynamic-bridge(string;) | If set, dynamic interface will be automatically added as port to specified bridge interface. |
dynamic-mac-address(mac;) | mac address of dynamically created interface |
static-interface(none|name-of-iface;) | Assign physical interface on the router to static virtual interface. This binds physical interface of the host directly to the guest instance. |
type(dynamic|static;) | Set if interface is either static or dynamic.
|
virtual-machine(string;) | specifies to which virtual machine this interface will be bound |
vm-mac-address(mac;) | interface mac address that appears in VM |
Mikrotik Routeros Virtual Machine Troubleshooting
Known Issues
MIPS-BE
Issues and possible workarounds for MetaROUTER feature on RouterBOARDs with MIPS-BE architecture
Random freezing
Issue has been resolved in RouterOS 6.x
PPC
Issues and possible workarounds for MetaROUTER feature on RouterBOARDs with PPC architecture
Not enough resources
Only listed routers are affected: RB1100AH
When attempt is made to create MetaROUTER guest on the router error message is given that there is not enough resources on the router to create guest.
This problem is resolved in 5.12 and later RouterOS releases. If you are using a newer release and still encounter the problem on the router you have to reinstall the router using Netinstall tool.
RouterBOARD RB1100AHx2 reports similar message, but MetaROUTER feature is not currently supported on this router.
All other routers form this architecture that support MetaROUTER feature are not affected.
Other issues that do not fit the description most probably are caused by RouterOS misconfiguration and do not have a common denominator and have to be checked case by case.
In the previous article, I once discussed Tutorial How to Learn Mikrotik without RouterBoard with
VMWare. This time almost the same is still discussing How to Learn Mikrotik Without RouterBoard but not using VMWare but VirtualBox. Oya, before I explain first what is VMWare and VirtualBox. So this software can run both operating systems are virtual in the operating system on your PC / laptop us. For example, we want to run Linux Ubuntu on Windows 7 PC us. Did you understand?
Now let me explain why this time I use VirtualBox instead of VMWare
. The reason is that of the advantages of
VirtualBox than VMWare:
1. VirtualBox is FREE Software, While VMWare Workstation Does Not
2. VirtualBox is more simple and easy to use
3. VirtualBox is lighter than VMWare
4. Etc., Etc .. Etc…
Okay, now let me explain what we will do next. Here we use VirtualBox to run RouterOS Mikrotik and Windows XP virtually. The goal is that we can still learn and Configure Mikrotik without having to have its RouterBoard. This I do because I again have a state task and do not take Mikrotik RouterBoard. So if you want to experiment hard. That’s why I try to use this Virtual Machine.
Things we need are:
1. PC / Laptop connected to the Internet. Want to connect using Modem, Wifi, or other up to you.
2. Latest VirtualBox software, please download
here.
3. Mikrotik RouterOS Installer File, Pleasesearch
here.
4. File Installer (ISO) Windows XP, Please yourself yes.
5. Winbox Mikrotik is here
.
Here I use Windows XP to make configuration easier. If you want to use other windows just, please. Or want to use Linux also a problem. But here I demonstrate how to use Windows XP SP3.
Immediately, the steps are as follows.
Installation Steps:
1. Please Download and Install VirtualBox
2. Create a new VM for Windows XP, adjust the resources (RAM, Harddisk) with your PC spec
3. Boot the VM with Windows XP installer (ISO)
4. Run VM Win XP it -> Perform the Win XP installation process to complete
5. Create a new VM for Mikrotik -> Do the same as in Win XP
6. Boot the VM with the installer RouterOS Mikrotik (ISO)
7. Run the Mikrotik VM -> Perform Mikrotik RouterOS installation process to complete.
Network Configuration Steps:
In accordance with the above topology, we use 2 Ether on Mikrotik.
Ether1 for connection to Client (Host-only) -> IP address 10.10.10.2/24
Ether2 for connection to Internet (NAT) -> Automatic IP address from DHCP Client