Syed Jahanzaib – Personal Blog to Share Knowledge !

February 16, 2015

Expanding Possibilities / Howto add 3rd party packages in Mikrotik KVM/Metarouter!

Filed under: Mikrotik Related — Tags: , , , — Syed Jahanzaib / Pinochio~:) @ 2:22 PM

As asked by few friends, i thoughts its a good idea to share it with all.
Last Update: 5th March, 2015, 08:43 am

 

1- Whatis Metarouter
2- Howto install Metarouter in Mikrotik Routerboard
3- Howto install APACHE web server in METAROUTER to host your web files.
4- Howto install ASTERISK 1.8 with GUI [Feb 2015]
5- Howto setup NTP to solve DATE Time synch issue [5th March, 2015 8:43am]
6- Howto disable firewall [17th Mrach, 2015 13:00 hrs]

1- What is METAROUTER?

as defined by Greg

Metarouter is a way to have logical routers running on your existing routerboard. In essence, you create a virtual router on your RB, then you assign some interfaces to it. You then can hand this virtual router off to a customer hand allow them to administer it without effecting any of the core functions necessary on the device. .”

Also on METAROUTER you can use openwrt image to host tiny linux and its few apps in it. like APACHE, asterisk etc. web server was in highly demand by local cable operator who wanted to host NON payment/reminder page to be shown at there clients.

Currently MetaRouter can be used on

  • RB4xx, RB7xx series, RB900 series, RB2011.xx boards
  • Listed PPC boards: RB1000, RB1100, RB1100AH and RB800.

 

Hardware Software Used in this guide:

Routerboard Model = RB2011UiAS-2HnD
Mikrotik ROS version = 6.27

2- Howto install METAROUTER in Mikrotik Routerboard

First download OPENWRT image into mikrotik. Open New Terminal, and issue following command …

/tool fetch url=http://openwrt.wk.cz/trunk/mr-mips/openwrt-mr-mips-rootfs-31411-basic.tar.gz

Now import the openwrt downloaded in above step,

As showed in the mage below …

2- Import Image

Now we need to add virtual network interface into this machine. We also have to provide valid network configuration with internet access so that it can download required software later. For this demonstration purposes I added manual IP , but you can use virtual bridge and use your mikrotik DHCP serve to allow internet access to the metarouter machine or whatever you prefer to establish network connectivity.

In the below pic, I selected ETHER2 which is LAN interface of mikrotik host.

add interface

 

.

Now double click on newly created machine and select CONSOLE and press enter key few times to get command prompt.

6- Open Metarouter CONSOLE zaib

.

Edit the network configuration file.

vi /etc/config/network

Press “i” to enter edit mode.

and configure the network as per your local need.

 

 

7- edit interface settings.

Add DNS server entry for resolving internet hosts …

vi /etc/resolv.conf

dns

 

After setting network configuration, save and exit. enable/restart the network services so changes can take effect.

/etc/init.d/network enable
/etc/init.d/network restart

Now try to ping any internet site to verify the connectivity. On successful attempt, you should get reply.

.

8- ping successfull

.

 

3- Howto install APACHE web server in METAROUTER to host your files.

Install APACHE web server with OPKG (like yum or apt-get)

Edit the opkg file

vi /etc/opkg.conf

Change a string in first line, as it should be like below one …

src/gz snapshots http://openwrt.wk.cz/trunk/mr-mips/packages

Now update opkg (like you do in ubuntu to update apt-get)

opkg update
opkg install apache

its better if you restart your mikrotik routerboard with reboot command so that all changes should take effect properly otherwise you MAY see few errors on accessing apache.

Now start apache service

apachctl start

(or restart as required)

Access via browser

10-apache works

html index files are placed at

/usr/share/htdocs


4- Howto install ASTERISK 1.8 with GUI

Make metarouter machine with following image,and setup proper networking.

/tool fetch url=http://ms1.nserver.us/openwrt.wk.cz/kamikaze/openwrt-mr-mips-rootfs-18961.tar.gz

Edit /etc/opkg.conf and use following repository

src/gz snapshots http://ms1.nserver.us/openwrt.wk.cz/kamikaze/packages/mr-mips
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /jffs

Save and exit. then update opkg , install asterisk , and start it.

opkg update
opkg install asterisk18 asterisk18-codec-alaw asterisk18-chan-iax2 asterisk-gui
/etc/init.d/asterisk enable
/etc/init.d/asterisk start

Upon successful start you can see following ports (5038 and 8088 started) as showed below …

root@metarouter:~# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:5038            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8088            0.0.0.0:*               LISTEN

Now you can access asterisk GUI via

http://ipofmetarouter:8088

Default ID Password is

Id = admin
Password = ast-owrt

You can change the password and other stuff in /etc/asterisk/manager.conf

Note: in RB750 , client faced issue that after rebooting / power on off the host router, web page of asterisk doesnt work and time out. on RB2011 there was no such issue with same image.


5- Howto setup NTP to solve DATE Time synch issue

Mikrotik itself and most hardware devices supported by OpenWrt do not have a hardware clock.Therefore use NTP package to solve the date time synch issue,

opkg update
opkg install ntpd
/etc/init.d/sysntpd disable
/etc/init.d/ntpd enable
/etc/init.d/ntpd start

# To view if NTP is started properly or not
netstat -l | grep ntp

Note: It will take some after reboot to synch time with the internet, make sure internet is operational in metarouter.


 6- Howto disable firewall [17th Mrach, 2015 13:00 hrs]

/etc/init.d/firewall stop
/etc/init.d/firewall disable
reboot

 




To be continued ….

Regard’s
Syed Jahanzaib

16 Comments »

  1. Very Good

    Like

    Comment by Frank Gabriele — February 16, 2015 @ 4:27 PM

  2. Sir g i was waiting for this for a long time and 2nd thing i have no words to say for this free knowledge sharing blog but only can do for u is pray that god reward u jannah for this effort………

    Like

    Comment by Kashif Jamil — February 16, 2015 @ 5:03 PM

  3. is is too much awsome Sir:

    Like

    Comment by UmmarHussain — February 18, 2015 @ 12:40 AM

  4. could’t change metarouter not enough resources

    Like

    Comment by Mohammad — February 22, 2015 @ 11:29 PM

    • I have this messge couldn ‘t change metarouter not enough resources

      Like

      Comment by Mohammad — February 22, 2015 @ 11:30 PM

  5. salam sir,
    sir if u have some time to please look at this project http://mum.mikrotik.com/presentations/US12/tomas.pdf which is for bandwith based loadbalancing.
    seems it works better than PCC loadbalancing. if u can make post it in this form with ur way then we are glad ti implement that.
    hope u will do this

    Like

    Comment by rehmat ali — February 23, 2015 @ 8:52 PM

  6. Hi,
    visit www below
    http://blog.pascom.net/voip-guys/asterisk-tutorials-16-asterisk-voicemail-basics/

    Like

    Comment by Adam — April 22, 2015 @ 12:17 AM

  7. hi dear admin i need ur help to make my shareing server i am a internet cable provider 03133999727 call me or mesege me i will calling plz help me bro

    Like

    Comment by Anees — April 28, 2015 @ 3:02 PM

  8. Reblogged this on SUMONCHAI .

    Like

    Comment by LAO — September 15, 2015 @ 2:13 PM

  9. thank u sir

    Like

    Comment by adexss — December 2, 2015 @ 2:45 AM

  10. please upload solution for Mikrotik x86 KVM

    Like

    Comment by Asif Siddiqui — January 18, 2016 @ 2:33 PM

    • Yes please! !!

      Like

      Comment by Marco V Rojas Garcia — June 11, 2016 @ 1:27 PM

  11. thanks u sir it is very helped me

    Like

    Comment by Laxmana Chary — May 6, 2016 @ 3:18 PM

  12. Man, this is super useful. Do you perhaps have the buildroot you used? There’s a couple packages not in your package repo that I want to use, maybe I could build them myself?

    Also, how did you get the patches up to date with the newer versions of openwrt. I’d love to have it work with latest trunk, but I’m not sure where to start.

    Like

    Comment by David Kowis — August 9, 2016 @ 8:52 AM

  13. Dear Sir,
    Thanks for wonderful tutorial. I’m try apache-tomcat on mikrotik, but facing some problem.
    thanks in advance.

    Like

    Comment by Mitra — June 10, 2017 @ 8:28 PM

  14. how should i connect gsm sim with this setup

    Like

    Comment by deepak — March 23, 2020 @ 1:29 PM


RSS feed for comments on this post. TrackBack URI

Leave a comment