Community discussions

MikroTik App
 
User avatar
StubArea51
Trainer
Trainer
Posts: 1739
Joined: Fri Aug 10, 2012 6:46 am
Location: stubarea51.net
Contact:

Re: Metarouter images

Tue Aug 14, 2018 10:56 pm

I think Metarouter running something else than RouterOS is a long abandoned concept...
Unfortunately I think yo're right...we all got so excited when CCR came out that it could be an inexpensive hypervisor but I don't think it will happen.
 
starter48
just joined
Posts: 1
Joined: Tue Dec 12, 2017 6:19 am

Re: Metarouter images

Wed Aug 15, 2018 5:14 am

This is lede for metaroute:
https://github.com/cuihaoleo/lede-mr-mips
Any pre-built images available?
For RB2011: viewtopic.php?f=15&t=128998 it does work with ROS v6.42.6
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 829
Joined: Tue Aug 03, 2004 9:01 am

Re: Metarouter images

Wed Aug 15, 2018 12:21 pm

Even MetaROUTER running RouterOS inside of itself seems to be a long-abandoned concept. The problems with stability are endemic to MetaROUTER itself and don't have anything to do with the OpenWRT patches. There are so many unaddressed stability bugs that affect MetaROUTER both on mipsbe and ppc that it is unusable even for RouterOS-as-guest.

For when I need a good value single-board-computer, I still use RouterBoards, but simply replace RouterOS with OpenWRT entirely. In some cases this means I install 2 RouterBoards for a customer instead of 1: one RouterBoard to run RouterOS and do routing, and a second RouterBoard to run OpenWRT and whatever custom applications the client needs. Twice as expensive, but at least it is completely stable. It would be nice to be able to put everything on one device, but v7 is still vaporware and MetaROUTER on v6 has so much bit-rot at this point that I don't see that happening anytime soon.

-- Nathan
 
talz
newbie
Posts: 49
Joined: Wed Mar 15, 2017 9:01 pm

Re: Metarouter images

Wed Oct 31, 2018 10:59 pm

hi guys.

I work for a company that heavily uses mikrotiks, and as one of the only software developers that works for my company, I've written tons of code using the mikrotik scripting language. Unfortunately, it is by far the worst programming/scripting language I have ever had the displeasure of working with. I could write a book on all the things that it does, or is missing that annoy me. I have been looking for a way to run Python on a mikrotik forever, and was aware that you could replace RouterOS with OpenWRT completely, but we have too many techs that know how to use RouterOS, and don't know how to use Linux, to be able to remove RouterOS from our devices completely.

Recently, I was able to get OpenWRT running in metarouter, and actually install Python2.7. I was then able to use some python routeros libraries to talk to the host mikrotik device using the mikrotik API! In theory, that means I can replace all my mikrotik scripts that run on the device itself with Python scripts that run in metarouter, and Python can perform all the logic, like checking if WAN links are up or down, changing routes between WAN links, sending email alerts about rogue DHCP servers, and whatever else needs doing.

Nathan's comment about MetaRouter not being stable is concerning however. It would be amazing if I could use Python, but not if it means we're going to have stability issues. So far, in my testing, I haven't come across any obvious stability issues, but I've only been play around with metarouter for the past day or two.

What kind of issues are common with running OpenWRT on metarouter?
 
nicolino
just joined
Posts: 12
Joined: Tue Dec 15, 2015 12:49 am

Re: Metarouter images

Wed Oct 31, 2018 11:38 pm

Hey Talz,

Nice to see you are also trying to leverage this great (but unfortunately abandoned) feature.

If your read through the entire thread you will find the most common issue is the metarouter guest OpenWRT kernel crashing, causing the host (yes, your actual, real, physical MK router) crash as well.
Believe it or not.

I think there was one OpenWRT version not crashing but with some other issues I don't recall right now.

Hope you hit the correct version and results are stable for your implementation. Please stay around and share any good or bad news you might have.

Regards, thank you!
Nico
 
talz
newbie
Posts: 49
Joined: Wed Mar 15, 2017 9:01 pm

Re: Metarouter images

Wed Oct 31, 2018 11:51 pm

Interesting...

It seems like I actually ran into that yesterday. I think I was using http://openwrt.wk.cz/trunk/mr-mips/open ... 079.tar.gz.
It worked for a bit, and then my RB493 started booting up, and then losing power after a few seconds and rebooting.
My 493 wasn't new - it was just out of the box of our old devices, so I figured there was probably something wrong with it, but this would explain it.

I later tried openwrt-mr-mips-rootfs-31411-basic.tar.gz, and that seemed to be working fine. I don't think it has died once today.
 
talz
newbie
Posts: 49
Joined: Wed Mar 15, 2017 9:01 pm

Re: Metarouter images

Thu Nov 01, 2018 12:27 am

This may already be covered at some point in the previous 8 pages of this thread, but this has been my experience over the past 24 hours trying to get Python running in Metarouter on RB493AH:

Working Image: http://openwrt.wk.cz/trunk/mr-mips/open ... sic.tar.gz
RouterOS Version: RouterOS v6.40.9

Had no problems copying the image to my 493, going to MetaRouter, importing it, and starting it up.
I created a dynamic interface for it under Metarouter --> Interfaces, and added vif1 to my LAN bridge on the 493.
This let OpenWRT grab an IP using its DHCP client, which was already running.
It did NOT configure a DNS server automatically however - not sure why, so I added "nameserver 8.8.8.8" to /etc/resolv.conf.
I don't know if I just missed something, or if it's some sort of bug - I didn't really look into it too hard.

At this point, I had internet, which let me download and install python 2.7, and its requirements:
wget http://openwrt.wk.cz/trunk/mr-mips/packages/libpthread_0.9.33-104_mr-mips.ipk
wget http://openwrt.wk.cz/trunk/mr-mips/packages/zlib_1.2.5-1_mr-mips.ipk
wget http://openwrt.wk.cz/trunk/mr-mips/packages/libffi_3.0.10-1_mr-mips.ipk
wget http://openwrt.wk.cz/trunk/mr-mips/packages/python-mini_2.7.3rc2-2_mr-mips.ipk
wget http://openwrt.wk.cz/trunk/mr-mips/packages/python_2.7.3rc2-2_mr-mips.ipk

opkg install *.ipk

rm -v *.ipk

This should give you working python2.7.
To talk to the host mikrotik using Mikrotik API, you have a few choices:

  1. https://github.com/rtician/routeros
  2. https://github.com/socialwifi/RouterOS-api

Option 1 is a project that doesn't seem to have any SSL support (can't use the Mikrotik API SSL protocol), so it should work out of the box.
Option 2 is slightly harder to get to work.

In both cases, the problem you'll likely run into is SSL. OpenWRT keeps things lean, and doesn't include SSL support out of the box.
As far as I can tell, normally, you can install SSL using opkg without much effort. Unfortunately, http://openwrt.wk.cz/trunk/mr-mips/packages/, which is a repository of pre-built packages that will work on the MIPS CPU the RB493AH has, does not appear to have the SSL package. This means:
  • You can't use wget to download anything that starts with https (SSL encrypted web pages)
  • You need to modify RouterOS-api to disable SSL support, or it won't run

To get around the fact that you can't download anything from HTTPS, I just downloaded stuff on a different computer, and used SCP to copy it over to OpenWRT.
Note: OpenWRT's tar also didn't seem to like extracting some of the packages I was downloading, so if you have a .tar.gz file you need to extract, you might need to extract it on a different machine and scp it as an extracted folder.

To get around RouterOS_api having built-in SSL support, which causes "import routeros_api" to fail (complains about importing of _ssl), you need to disable ssl. Find and modify api_socket.py in that project, and do 2 things:
  • Comment out "import ssl"
  • In get_socket(), right before this line
    • if ssl_context is None and use_ssl:
    add this:
    • if ssl_context or use_ssl: raise Exception("SSL not supported on OpenWRT")

It's probably enough to just comment out the import line, but I added a bit of extra code in case I ever forget, and try to use api_ssl.
At this point, as long as your current working directory has the routeros_api folder in it, you should be able to import routeros_api and use it.
If you want to install routeros_api system-wide, you can either move the entire routeros_api dir anywhere that's in python's sys.path (I haven't tried this, but it'll probably work), or use Python's SetupTools.

To use SetupTools, which is actually required in order to install a bunch of packages from PyPi, you can do this:
  • Download the setup tools zip file from https://pypi.org/project/setuptools/#files on any other machine
  • Extract it
  • SCP the extracted folder to OpenWRT
  • cd into that folder on openwrt
  • Run "python setup.py install"
  • Delete the setup tools folder to save space - it's now installed system-wide

At that point, you can go back to the RouterOS_API directory, and run "python setup.py install" on that, which will install it system-wide.
If it complains about failing to import "six", you can download that from pypi and install it with "python setup.py install" just like everything else.

Having setuptools installed will let you download and install many of the packages found on pypi's website.
It seems like most packages work, as long as they don't have C binaries that need to be compiled first - OpenWRT doesn't have a gcc compiler pre-installed.

You can even download and install pip from pypi, and it seems to work fine, except for the fact that the pypi repos are ssl-protected, and with OpenWRT not having SSL support, pip fails to fetch anything.

SSL isn't totally essential for what I'm trying to do, but my 493 should have plenty of hard drive space for it (about 70MB free - I would think it would fit), so it would be nice to have. Unfortunately, as far as I can tell, the only way to get it working is to use the toolchain to cross-compile ssl binaries on a different system, and move them to OpenWRT, unless someone out there is nice enough to do this and put them online. I haven't tried this yet - maybe I will at some point.

Essentially, what this lets you do is install any packages from github or pypi that are pure python. If you need to do mikrotik discovery using MNDP, or talk to a mikrotik using mac telnet, have a look at https://github.com/pjoe/py-mactelnet. Its MNDP script is pure python, and works great. It's mac-telnet script uses netifaces, which is a C module, making it not work out of the box, but as far as I can tell, the only thing netifaces does is make it easier for the mac-telnet script to grab the MAC and IP of the interfaces on OpenWRT, which can be done without netifaces, so it probably wouldn't take much effort to remove the dependency on netifaces.

If this is interesting to anyone, but they're having trouble following my rushed explanation, let me know, and I'll try to clarify.
 
nicolino
just joined
Posts: 12
Joined: Tue Dec 15, 2015 12:49 am

Re: Metarouter images

Thu Nov 01, 2018 1:48 am

Interesting, Talz... very!

I've been mostly playing around with the API via PHP annd externally only, but I like the idea of having my custom app "inside" the Routeros either to use python instead of embedded scripting or to develope some custom feature.

I follow you on the missing SSL libs, you can always start from scratch and build your own OpenWRT patching as instructed in the official metarouter documentation or using some of the modified patching scripts available on this thread for newer kernels. With that, you can get whatever openwrt packages you want pre-installed, all of them, or just build your own repo and be so nice to put it on the internet available for all the dums like me not being able to build a system on my own! :P (true story)
 
td32
Member Candidate
Member Candidate
Posts: 111
Joined: Fri Nov 18, 2016 5:55 am

Re: Metarouter images

Thu Nov 01, 2018 1:51 am

i think you can get the ssl packages directly from the openwrt website, available with each release
example
https://archive.openwrt.org/chaos_calmer/15.05/ar71xx/mikrotik/packages/
 
nicolino
just joined
Posts: 12
Joined: Tue Dec 15, 2015 12:49 am

Re: Metarouter images

Thu Nov 01, 2018 3:29 am

i think you can get the ssl packages directly from the openwrt website, available with each release
example
https://archive.openwrt.org/chaos_calmer/15.05/ar71xx/mikrotik/packages/

But would those work for the patched kernel? Also, how would you manage dependencies? Sorry about my ignorance, I'm most likely asking silly questions...
 
talz
newbie
Posts: 49
Joined: Wed Mar 15, 2017 9:01 pm

Re: Metarouter images

Thu Nov 01, 2018 6:06 pm

i think you can get the ssl packages directly from the openwrt website, available with each release
example
https://archive.openwrt.org/chaos_calmer/15.05/ar71xx/mikrotik/packages/

The release we are working with is Attitude Adjustment (12.09), so I guess the repo for that would be:

https://archive.openwrt.org/attitude_ad ... 09/ar71xx/

I don't see any SSL packages in that repo.
There are packages with the word "ssl" in the name, but those are just SSL modules for specific software, which I assume would all depend on a system ssl package that needs to be installed, which I can't find.

Edit: I think I found it. openssl-util_1.0.1e-1_ar71xx.ipk. I'm gonna give it a try.
Edit 2: opkg says "Packages for openssl-util found, but incompatible with the architectures configured"

What's the relation between MIPS, and AR71xx?
We use a lot of devices like 493s, 751s, 750s, 912s, and 52HPn grooves, all of which are MIPSBE.
If we need to use gcc to compile binaries, do they need to be AR71xx? MIPS? MIPSBE?

Almost all software I write is for regular x86_64, so I don't usually have to deal with different CPU architectures.

It looks like the RB493AH has an AR7161 CPU, which I guess falls within AR71xx.
What's an architecture? A CPU can have more than one architecture? It sounds like it, since the repo is for AR71xx, but it is complaining that the architecture doesn't match.
 
td32
Member Candidate
Member Candidate
Posts: 111
Joined: Fri Nov 18, 2016 5:55 am

Re: Metarouter images

Thu Nov 01, 2018 9:15 pm

what about this
http://openwrt.wk.cz/trunk/mr-mips/packages/openssl-util_1.0.1-1_mr-mips.ipk
 
talz
newbie
Posts: 49
Joined: Wed Mar 15, 2017 9:01 pm

Re: Metarouter images

Thu Nov 01, 2018 10:29 pm

Bloody safari!

I did a search in my safari browser on that page for ssl. Turns out it only showed me words that started with ssl! Anything separated by a - or a _ was considered a new word, so it found some ssl packages, but not the main openssl package!

I totally missed it.

Trying it now. It installs fine with opkg, assuming you grab its dependencies as well:
opkg install libopenssl_1.0.1-1_mr-mips.ipk openssl-util_1.0.1-1_mr-mips.ipk zlib_1.2.5-1_mr-mips.ipk

Initially, wget still couldn't download https stuff, but that's probably because by default, that openwrt image comes with wget-nossl.
Installing the regular wget from that same repo fixed the issue, and wget works fine with https now.

Unfortunately, it doesn't appear that this fixes Python's inability to use ssl. Doing "import ssl" complains about a missing _ssl module. My iMac has a _ssl.so file that lets it import "_ssl", but I can't copy it over since that's compiled for a different architecture. Maybe one of the other packages has this. I'll look around some more.
 
moham96
newbie
Posts: 33
Joined: Thu Dec 21, 2017 3:08 pm

Re: Metarouter images

Mon Mar 18, 2019 8:03 pm

Hi,
why doesn't mikrotik push their changes to mainline linux and official openwrt instead of releasing a patch for each version ? I hope Mikrotik engineers can provide us with an answer.
this will ensure that the metarouter will always be supported,and maintained by linux kernel experts, all bugs will be ironed and fixed upstream.
sending patches to mainline linux is a bit of a long process but it's well worth it.

Regards
 
User avatar
flaviojunior
Trainer
Trainer
Posts: 21
Joined: Thu Nov 17, 2016 6:27 pm
Location: Brazil
Contact:

Re: Metarouter images

Wed Mar 20, 2019 3:12 pm

Any news about update MetaRouter on RouterOS?
It's a very good feature that we can you to use Zabbix, PRTG........... and another thousands features all in one.
I used QoS Reflector on PRTG, it's a script on python running on a linux that reflect UDP packages from PRTG and with it he calculate the Quality of the Link.
But to install Python on a OpenWRT I can run the image on a 750 router because of the size, the only router today that could do it is 2011. Now we are using small PCs to use the QoS Reflector on our clients, but I want to use again RouterOS MetaRouter for it.
Points:
Make all routers ARM, MMIPS and Tile work with MetaRouter (All hEX, 3011, 4011, 1100AHx4, CCRs)
And put the Image on a external drive (USB, SDCard...)

Maybe:
Create a way to clone the running image
Replication on diferent routers to make HA

Will be a new product of mikrotik, Virtualization HA.
 
sav
just joined
Posts: 1
Joined: Thu Jan 02, 2020 2:29 pm

Re: Metarouter images

Thu Jan 02, 2020 3:04 pm

Hi everyone! I'm new around here as well I'm new in using Mikrotik features.

Now I wanted to try Metarouter. So I tryed to install OpenWRT as it is shown here https://wiki.mikrotik.com/wiki/Manual:Metarouter
But every time I'm trying get it done I see an error like this - import failed: file in archive goes out of root directory: ./www/

I've been doing exactly as it written in Wiki so I have no any idea why I got that error.
Could anyone give me an explanation what I did wrong.

My Router is RB2011, RouterOS ver.6.46.1
Last edited by sav on Thu Jan 02, 2020 4:49 pm, edited 1 time in total.
 
kovalr
just joined
Posts: 8
Joined: Wed Apr 26, 2017 9:13 pm

Re: Metarouter images

Thu Jan 02, 2020 4:12 pm

Hello,
On my Mikrotik I run Openwrt as Metarouter.
Lede project Reboot (17.01-SNAPSHOT, r4046-beaa2ecc10).
I need openssl tools.
Here my errors when I trying to use openssl command:
Error relocating /usr/bin/openssl: COMP_zlib_cleanup: symbol not found
Error relocating /usr/bin/openssl: BIO_f_zlib: symbol not found
My SSL libraries has the same version
root@LEDE:/# opkg info libopenssl
Package: libopenssl
Version: 1.0.2t-1
Depends: libc
Status: install user installed
Architecture: mips_mips32
Installed-Time: 1574142675

root@LEDE:/# opkg info openssl-util
Package: openssl-util
Version: 1.0.2t-1
Depends: libc, libopenssl
Status: install user installed
Architecture: mips_mips32
Conffiles:
 /etc/ssl/openssl.cnf 06baa8f15992bacd3e5b113cd571d828c0544d0482ccd2e15969fe819957271d
Installed-Time: 1577460901
Can someone share image with working openssl ?
 
Ariansat
just joined
Posts: 2
Joined: Mon Aug 13, 2018 4:21 pm

Re: Metarouter images

Sat Jan 04, 2020 10:56 pm

Hi everyone! I'm new around here as well I'm new in using Mikrotik features.

Now I wanted to try Metarouter. So I tryed to install OpenWRT as it is shown here https://wiki.mikrotik.com/wiki/Manual:Metarouter
But every time I'm trying get it done I see an error like this - import failed: file in archive goes out of root directory: ./www/

I've been doing exactly as it written in Wiki so I have no any idea why I got that error.
Could anyone give me an explanation what I did wrong.

My Router is RB2011, RouterOS ver.6.46.1
Hi , i have same Problem and use CRS125 i can not import any MetaRouter Image and everytime show me "Couldn't continue - import failed: file in archive goes out of root directory: ./jffs/ (6)
and i test other mips file and this have same Problem some time ./jffs/ and some time ./www/ i think this is for new firmware, i use v6.46.1 and try to downgrade to v6.45.6 but not accepted by routerboard, if we use same Version and have same problem i think this is for Firmware problem
 
Ariansat
just joined
Posts: 2
Joined: Mon Aug 13, 2018 4:21 pm

Re: Metarouter images

Sat Jan 04, 2020 11:14 pm

Metarouter Work Just to v6.45.6 if they have any problem most be Downgrade to this Version
 
anakin475
just joined
Posts: 2
Joined: Wed Jan 15, 2020 9:37 am

Re: Metarouter images

Wed Jan 15, 2020 10:40 am

Metarouter Work Just to v6.45.6 if they have any problem most be Downgrade to this Version
I wonder, why's that so? I'm running 6.46.1 on 951Ui-2HnD, lots of bugs were fixed and a new features were added since back then. Do they completely discontinued support for Metarouter after 6.45.6 or do they plan to enable it in future releases? Why to even include Matarouter ability in releases after 6.45.6 when it's not working? It's at least weird. Or there's something we don't know...
 
petrcz
just joined
Posts: 1
Joined: Thu Feb 20, 2020 10:28 am

Re: Metarouter images

Thu Feb 20, 2020 10:42 am

Metarouter Work Just to v6.45.6 if they have any problem most be Downgrade to this Version

Hi, it's the firmware problem. I saw exactly the same error on 6.46.3.
To work-around it, I had to downrade to 6.45.8, import the OpenWRT image and upgrade back to 6.46.3. It's working now.

Has anyone tried 7.0beta5? I tried it in VirtualBox - the MetaRouter menu isn't present at all here.
 
Yongki
just joined
Posts: 5
Joined: Wed Jun 06, 2018 7:55 am

Re: Metarouter images

Tue May 12, 2020 1:02 pm

can anyone give me the latest update about the device that support metarouter?
i'm searching that RB2011UiAS-2HnD-IN can run metarouter how about the same processor but different model CRS109-8G-1S-2HnD-IN? can CRS109-8G-1S-2HnD-IN run metarouter as well?
thankyou for your replat. sorry for my bad english.
 
nicolino
just joined
Posts: 12
Joined: Tue Dec 15, 2015 12:49 am

Re: Metarouter images

Tue May 12, 2020 5:47 pm

Has anyone tried 7.0beta5? I tried it in VirtualBox - the MetaRouter menu isn't present at all here.

If you tried it on a VM, then it's the CHR image for x86 architecture, no Metarouter support there.
 
rrwakc
just joined
Posts: 10
Joined: Mon Jan 04, 2016 4:54 pm

Re: Metarouter images

Tue Jul 20, 2021 1:17 am

Did anyone managed to make a stable minimal metarouter with mqtt broker (OpenWrt or other).

Although last mention of it was 5 years ago.
Now with the arrival of Mikrotik KNOT would really make sense as an all in one home automation device.

The problem seams to be, that it has only 16MB of flash and 64MB of RAM.
And the system reports 14/16 and 50/64 are already used.

(5MBs of flash is taken by meta router image to install so I am assuming thee is a way around that)
 
pe1chl
Forum Guru
Forum Guru
Posts: 10195
Joined: Mon Jun 08, 2015 12:09 pm

Re: Metarouter images

Tue Jul 20, 2021 4:27 pm

Metarouter is not available on new-style devices with 16MB flash!
It is only available on older devices with 64 or 128MB flash.
Hopefully sometime we will get a new style Metarouter that allows users to run their own daemons in a low-privilege chrooted environment in a folder on the flash.
That would allow to run such functions even on a router with little free space.
Unfortunately it does not appear that MikroTik is already considering that....
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Metarouter images

Tue Jul 20, 2021 8:32 pm

Did anyone managed to make a stable minimal metarouter with mqtt broker (OpenWrt or other).
Use CHR or x86 to.... ops, but at that point you can directly virtualize OpenWRT...
 
Chiara
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Thu Jul 23, 2015 3:47 pm

Re: Metarouter images

Fri Sep 09, 2022 4:28 pm

Running a RouterOS v7.5 on a RB951Ui, any chance to run some image with ASTERISK 17 or 19?
Anyone can share a prebuild image, I've followed official docs but point to year 2010 image:

https://wiki.mikrotik.com/wiki/Manual:Metarouter
http://www.mikrotik.com/download/metaro ... rootfs.tgz

Thanks, BR
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Metarouter images

Fri Sep 09, 2022 5:52 pm

Metarouter is supposed to be removed from v7. But it's true that I also still see the menu in 7.5.
 
User avatar
dynek
Member Candidate
Member Candidate
Posts: 222
Joined: Tue Jan 21, 2014 10:03 pm

Re: Metarouter images

Fri Sep 09, 2022 6:01 pm

It's a bit sad. I used metarouter to run avahi, and I can't run containers (mipsbe & ppc)

Who is online

Users browsing this forum: No registered users and 9 guests