Skip to content

Mikrotik Local Bandwidth Management System, Using Mikrotik API

Notifications You must be signed in to change notification settings

ahmadafif-codaff/anmik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANMIK

Mikrotik Local Bandwidth Management System, Using Mikrotik API

This software is for a local bandwidth management system using the Mikrotik API. Bandwidth management is targeted for each IP address obtained from Mikrotik DHCP, using a simple queue method.

Features

  1. Generate Firewall filter rule.
  2. Make package for client (category for package : Premium, Regular, Kuota).
  3. Make client using simple queue method.
  4. Bandwidth management.
  5. Client usage graph.
  6. Reboot Mikrotik.

Requirement

If you want to use this software, the requirements :

  • Web Server
  1. Operating System (Linux is Recomended).
  2. PHP version >= 7.4.
  3. Apache web server or similar.
  4. Enable htaccess.
  5. MySQL DBMS.
  • Mikrotik Router board
  1. Clock speed CPU 650 MHz.
  2. Router OS v6.3.
  3. Enable API port.

Installation

For instalation follow this :

  1. Get ANMIK master. You can get the master file with :
    • Download ANMIK master package ANMIK then extract at web server folder or
    • Open terminal in your web server directory then clone this repository with :
    git clone https://github.com/ahmadafif-codaff/anmik.git
    
  2. Edit file example.config.php in "app/config" folder, fill in the DB_HOST, DB_USER, DB_PASSWORD according to your DBMS, and fill in MIKROTIK_HOST, MIKROTIK_USER, MIKROTIK_PASSWORD according to your Mikrotik Router, then save the change and rename file example.config.php to config.php.
  3. Make database "anmik" then import database anmik.sql from "db" folder. If you are using a Linux server, change "DB Folder" to full access with command "chmod 777 -R db" (This is used for the purpose of creating, modifying and checking data in the "usage.json" file in the "db" folder).
  4. Open the web browser, then follow links http://localhost/anmik/autoinput ("anmik" change to directory where you place master file). Every time your PC restart run this link (make the link is autorun is recomended).

How to use?

If the web server has been installed correctly, then :

  1. Open the web browser then follow links http://localhost/anmik/login ("anmik" change to directory where you place master file). You will be directed to the login page.

  2. Login to ANMIK using username : anmik, and password : Anmik123. If login correctly you will be directed to the dashboard page.

anmik-dashboard

  1. On the ANMIK web server, click the ip/dhcp-lease menu and all connected client routers will be displayed. (Please note that the connected client router must be connected to the Mikrotik router in router hotspot mode and by getting the IP dynamically. This is used to find out which routers are on and off).

anmik-dhcp-lease

  1. Still on the ip/dhcp page, if youre router client get IP dynamically (marked with a yellow background), click button check, then status will be changed to static ip (marked with a white background). This is used to prevent the IP address from being used by other client routers.

anmik-static-dhcp-lease

  1. Then move to the firewall page by clicking ip/firewall menu, click generate firewall button to quickly create the firewall. This is used to block internet access for unauthorized IP addresses.

anmik-firewall

Update on firewall : You can see the client using the IP in the firewall list

anmik-firewall-client-name

  1. Open the package page and make a package according to what will be used.

anmik-paket

  1. Make client with clicking client menu, then create a client according to the client router IP and the package the client will use. When you first create a client, the system will direct you to create a client with the name Root Simple Queue, just change the date and package, then click OK, the root client will not be recorded in the ANMIK application, but will only be recorded in the Simple Queue in MIKROTIK.

Screenshot 2024-02-12 at 10 40 48

anmik-client

If remote management on your client router is active, then you can do it remotely by simply clicking on the IP address that is in the client list or dhcp lease list

anmik-client-router

  1. Go to the schedule reboot page to make the router reboot on a scheduled basis. This schedule is divided into 2 types, namely day and hour.

anmik-schedule-reboot

  1. On the schedule boost page, it is used to create a predetermined client speed increase schedule. This schedule is divided into 2 types, namely repeat and one time.

anmik-schedule-boost

  1. Press the Mikrotik reboot menu button to reboot the Mikrotik from the web server.

anmik-reboot

  1. Click the logging menu button to display the activity log. Here all activities will be shown, both data changes made by the admin or from the server itself.

anmik-log

Update

2.1.0 Your customers can see the selected packages and can see their quota usage.

  1. Open the web browser then follow links http://localhost/anmik/login_client ("anmik" change to directory where you place master file). You will be directed to the login page.

  2. To log in to the client, use the client name as the username and the target IP as the password.

anmik-username-password

anmik-client-login

  1. Then, if login correctly you will be directed to the client dashboard page.

anmik-dashboard-client