douweng1935 2015-12-22 08:30
浏览 588
已采纳

通过Web App进行Mikrotik路由器管理

I need help in building a project. Let me first describe my project -

I want to build a Web application (using php / php framework(laravel) , html, css, javaScript, bootstrarp ) that will help ISP owner to manage their router (most of them use Mikrotik router).

Reason to build this App:

Most ISP provider here use Mikrotik router to manage their internet business. But managing the router using Winbox ( a desktop based windows software that is build to manage Mikrotik router) seems complex to them. Just for creating new ip to assign a new user, blocking a user if he/she do not pay bills and managing bandwidth they need to operate winbox every time which they find difficult. My approach is to build a web application that will ease their work.

The features I want to provide are-

  1. Creating new IP address and addressing them to user (internet user / end user)
  2. Manage bandwidth of an IP address
  3. Block / Lock any particular IP address automatically (in this case any particular user) who have not paid their monthly bill on certain date of a month
  4. Re-enabling blocked IP address on paying their dues automatically
  5. Showing daily graph of bandwidth received and used

  6. Recording client history (client IP address, Monthly rent, Name, Address etc.)

  7. Recording payment history of client
  8. Auto bill calculation / due calculation
  9. Auto sort out of due users of months

I am able to do 6 - 9 features as described but I have no idea how to implement 1 - 5 features !

Problem That I am facing :

a. I don't know how to connect to a MikrotiK router via web application b. If some how i can access to the MikrotiK router using router IP address , I don't know how to create new IP address on that router database c. how to manage bandwidth via web application d. how to block / lock ip address !

Points I get myself :

I think using management vlan (router Ip address) i can access to that router form command promt using ssh/telnet. After that what would be the command to create, lock/block, manage bandwidth of an IP address ? IF all this things can be done using command prompt, how can I make it for my web application ?

Can anyone please help me with this, referring any link?? I googled but only thing I find is Mikrotik router management manual !

  • 写回答

3条回答 默认 最新

  • dongzhuo2371 2016-05-05 08:24
    关注

    I did part of what you are asking for a customer weeks ago. Your question is to broad, very extensive, it will take months to accomplishes the job.

    Start your project with the basic that you can find at http://wiki.mikrotik.com/wiki/API_PHP_class, then you can grow your application and post specific questions about your problems in places like stackoverflow or reddit.

    Follow a sample to connect to the API, then execute commands and then disconnect.

    $API = new RouterosAPI();
    $API->debug = true; // turn debug on to learn more about your api
    if ($API->connect($server , $username , $passwd, $port)) {
    
        // wireless registration table
        $API->write('/interface/wireless/registration-table/print',false);
        $API->write('=stats=');
        // print output here
    
    } else {
    
        // connection fails
    }
    $API->disconnect();
    

    Ref.:

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP