Mikrotik Hosting and Mikrotik5-PDO User Guide PDF
Mikrotik Hosting and Mikrotik5-PDO User Guide PDF
By mikrotikcloud.com
Create database
2. Choose as utf8_unicode_ci
ห น ้ า 1 | 96
1. Press the button choose file
ห น ้ า 2 | 96
When the import is successful, you will get the image above.
1. for-sale-2019-mikrotik5-PDO-09-Dec-
2019/link/include/config.inc.php
2. for-sale-2019-mikrotik5-PDO-09-Dec-2019/include/
config.inc.php
ห น ้ า 3 | 96
3. Open the file and edit the information. To be the same as in
your database
There are 2 files which must be edited. There are 4 lines as in the
picture.
Login page
Search the url in the web browser
http://localhost/for-sale-2019-mikrotik5-PDO-09-Dec-2019/admin/login.php
ห น ้ า 4 | 96
Username = admin
Password = 12345
ห น ้ า 5 | 96
Next step, create a group as shown below.
When finished, there will be a new group according to the name that
we have set.
ห น ้ า 6 | 96
Create user API
ห น ้ า 7 | 96
API port settings
Go to ip => services
ห น ้ า 8 | 96
1. Click on API
ห น ้ า 9 | 96
Cloud IP usage of mikrotik routers
Go to ip=>Cloud
Check the picture above and press the Force Updete button when
the system updates.
ห น ้ า 10 | 96
Add a router mikrotik and management.
ห น ้ า 11 | 96
** After entering both values, you can click the Test Connect button
to check the IP and API ports. It will show the values in the red
square.
ห น ้ า 12 | 96
Pin password will be used only when opening the security site.
When all the information is filled in, click the "add" button to finish
creating the job site.
To do this example, I have created 4 job sites and set a PIN password
to divide the administrator level into 3 levels, as shown below.
ห น ้ า 13 | 96
Go to the security site page.
ห น ้ า 14 | 96
Set both pins to be the same and click the save button. For example,
I would set it to "abcd".
When successful, will log out to login again. Enter the information.
Username = admin
Which will be able to manage all the sites, as shown in the green
status
Username=admin
ห น ้ า 15 | 96
Password=1111 and 2222
The difference is
Username=admin
ห น ้ า 16 | 96
The difference is Number of job sites that can be maintained And
manage that site
Username=admin
ห น ้ า 17 | 96
Go to the security site page.
ห น ้ า 18 | 96
After the system has saved the value You will be logged out. When
you want to login, must use
Username=admin
Password=12345
system/index.php
ห น ้ า 19 | 96
Profile creation in hotspot with the API
ห น ้ า 20 | 96
Take a look at the winbox. In the created profile there will be a script
at On Login. Complete the profile creation process.
ห น ้ า 21 | 96
Give an example of the Generate User.
ห น ้ า 22 | 96
After successfully adding the user, go to the Hotspot Databases User
List page.
We can customize Card or Export CSV. For the first time, you may
open the website popup.
ห น ้ า 23 | 96
ห น ้ า 24 | 96
From the QR code image. When you scan, you will get
http://172.0.0.1/login?username=test529&password=673
If different from the example Please edit it on the Hotspot Edit Card
page.
ห น ้ า 25 | 96
And allow you to go to winbox settings to enable HTTP PAP
Once you have created the user in the database, you can export the
user directly on the hotspot databases user list page.
ห น ้ า 26 | 96
Create a script to set the expiration date for users on
Hotspot.
Make the correct settings. If more than 1 profile, click the button 7.
Scripts in winbox
ห น ้ า 27 | 96
When the user login, there will be a comment showing the date and
time.
ห น ้ า 28 | 96
Create a Host to use on Hotspot.
I will explain the server creation for the client to use, such as
checking the expiration date,register, change password , Top-up days
And to bring the API file installed in it
You may use different programs to create a different server from the
example. But the connection with mikrotik is the same
ห น ้ า 29 | 96
ether3hotspot is in bridge1
Network is 172.0.0.0/23
ห น ้ า 30 | 96
Follow the steps in the pictures above 1,2 and 3.
ห น ้ า 31 | 96
2. Specify the desired IP address. If you are going to use the old IP
address, do not need to change it. Here I want
Changed to 172.0.0.5
3. Configure upload / download For the server, which will control the
speed of ip binding
4. When every step is completed, click the OK button and close this
window.
ห น ้ า 32 | 96
When finished, IP 172.0.0.89 will still be used. Please disconnect the
LAN cable connected to the server or restart the PC.
When you turn on or plug in a new LAN then get the desired IP
ห น ้ า 33 | 96
The next step is to bypass to use the internet without login.
ห น ้ า 34 | 96
Check the accuracy of the ip bindings page.
The next step is to bypass the ip of the server to enable clients in the
hotspot to access even if they are not logged in.
ห น ้ า 35 | 96
Follow the steps in the image above and press OK to finish. Walled
Garden IP Procedure
ห น ้ า 36 | 96
In step 4. Is port 80 of the router at URL 172.0.0.1:81/
ห น ้ า 37 | 96
Next, click on the Action button.
ห น ้ า 38 | 96
Completed Redirect from 172.0.0.1:81 => 172.0.0.5:81
ห น ้ า 39 | 96
That you have to fix are 3 files as in the picture above
ห น ้ า 40 | 96
For registering with Thailand ID card Or e-mail.
ห น ้ า 42 | 96
When accessing the hotspot login page with other devices
ห น ้ า 43 | 96
Can go to change password page, sign up page ,Top-up Page, check
the expiration date page Without login
ห น ้ า 44 | 96
Create a registration system for users on Hotspot.
ห น ้ า 45 | 96
2. Create User in the profile.
**** We have to set the script on the Hotspot Add Script For Expire
User page by specifying the expiration date of the user in the profile
named Register = 1d.
ห น ้ า 46 | 96
3. Disable user
ห น ้ า 47 | 96
In the hotspot folder, edit the login.html and info.html files.
ห น ้ า 48 | 96
In info.html, edit lines 94-95 and 132-133.
When finished editing Import the files into the winbox files.
Complete the configuration process.
ห น ้ า 49 | 96
Set the correct value and click OK.
ห น ้ า 50 | 96
Will log in automatically to page 172.0.0.1/status
If the user is not logged in, you will need to go to winbox settings to
enable HTTP PAP.
ห น ้ า 51 | 96
Set up login with Facebook.
Go to https://developers.facebook.com/apps/
ห น ้ า 52 | 96
Must be HTTPS only
ห น ้ า 53 | 96
ห น ้ า 54 | 96
Check URL
ห น ้ า 55 | 96
App ID to enter values in hotspot login and API
ห น ้ า 56 | 96
Facebook login By API
For social login that closes trial and use with api with control
bypass web
The advantage is
1.user can not use on facebook If not pressing the facebook
login button
2. Control the time to bypass facebook website.
The disadvantage is
There was a delay in connecting to facebook api It may take 5-10
seconds after the api server is bypass the web.
***But you can bypass the facebook website to fix the time delay
issue.
Enter the APP settings on the social setting page. Click the + APP
button.
ห น ้ า 57 | 96
1. App id obtained from facebook
3.profile for user *** You must specify a Script For Expire User.
Or create a script to reset the uptime every day by copying the script
below to the new terminal in winbox
/system scheduler
\n:global prof;\r\
etprof\" )] do={\r\
ห น ้ า 58 | 96
\n[ /ip hotspot user reset-counters \$stu];\r\
\";\r\
\n}}" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=Dec/20/2019 start-time=00:00:00
For settings in winbox, I would like to give an example only for the
hotspot server profile page.
ห น ้ า 60 | 96
Open the login.html file in the hotspot / Facebook login By API folder
for editing.
Edit the information to be yours. Then import the file into winbox.
ห น ้ า 61 | 96
Facebook button while still not bypass web site
ห น ้ า 62 | 96
The system will create a walled garden on the mikrotik router.
*** Which, if you have this Disable Script, can fix the delay
time bypass web
ห น ้ า 63 | 96
When the facebook web site is bypass, there will be a
facebook login button. Come up to login
ห น ้ า 64 | 96
Like function
Post Function
ห น ้ า 65 | 96
When all the steps have been completed, the system will notify You
click the OK button.
ห น ้ า 66 | 96
The API on the social user page will display a list of users.
The advantage is
The disadvantage is
Copy the file name login.html to override the old login.html and
open the file.
ห น ้ า 68 | 96
Edit all 3 lines and import into files in winbox
Enter winbox to enable Trial and set the 3 boxes below according to
usage.
ห น ้ า 69 | 96
Then copy the script below to put in the New Terminal
add dst-host=*facebook.com
add dst-host=*fbcdn.net
ห น ้ า 70 | 96
Finished
The login button will come, no need to wait. The behavior is the
same as login by API.
ห น ้ า 71 | 96
User created
ห น ้ า 72 | 96
ห น ้ า 73 | 96
PPPoE server with user notifications
1. When expiring, will disable and remove the specified date and
time.
2. When expired Will change the profile for the user automatically so
that the system redirects to the page to notify the customer
expiration date
When the specified time has elapsed Will change the profile back to
its original value and then disable and remove respectively.
ห น ้ า 74 | 96
Add ether6 and ether7 to bridge1.
ห น ้ า 75 | 96
Create new Address 172.0.0.1/24 interface bridge1
ห น ้ า 76 | 96
Create an IP Pool for Remote. Give the client connected by
PPPoE Client. Length 172.16.0.1 – 172.16.0.254 named pppoe-
remote-pool.
ห น ้ า 77 | 96
Create a Hotspot Server for Bridge1 (172.0.0.0) that must be created
because Mikrotik's Web Server will work.
If redirecting at other servers is not necessary to create a
Hotspot server
ห น ้ า 78 | 96
Create a NAT for the Network 172.16.0.0/24 (pppoe-remote-
pool) can access the internet
ห น ้ า 79 | 96
Enable Web Proxy
ห น ้ า 80 | 96
Create web proxy access for expired and redirect to the web
server (Mikrotik IP 172.0.0.1) in front of the desired page
(block.html, rename if necessary).
Create NAT Rule redirect from Port 80=>8080 Proxy) for pppoe-
expired-pool
ห น ้ า 81 | 96
Specify Filter Rule to Reject Expired IP (pppoe-expired-pool)
ห น ้ า 82 | 96
Create an folder named error and a file named block.html and drag
the folder to Path Hotspot.
ห น ้ า 83 | 96
Download file=https://drive.google.com/file/d/1y1uXwptp_-
TjWBDnchwLP2HWjAbJvVCP/view?usp=sharing
ห น ้ า 84 | 96
Go to edit the "pppoe expired" profile on the PPP profiles page in
winbox. At the DNS Server
ห น ้ า 85 | 96
สร้ าง user pppoe ตามต้ องการที่หน้ า pppoe add user
Tested into the pppoe client system for the first time.
ห น ้ า 86 | 96
ห น ้ า 87 | 96
ห น ้ า 88 | 96
The IP received is in the pppoe-remote-pool.(172.16.0.1-
172.16.0.254)
ห น ้ า 89 | 96
Get the specified internet speed
The first login will have a comment showing the date and time that
the user
ห น ้ า 90 | 96
After normal use To build Scripts to manage expiration dates And
alert when the end of use day
ห น ้ า 91 | 96
When expired, the system will change the profile and comment and
will log out (disconnect) until reconnecting.
ห น ้ า 92 | 96
When reconnecting, you will see a new IP set up as an IP band.
pppoe-expired-pool (172.16.1.1-172.16.1.254)
ห น ้ า 93 | 96
Will redirect the page to expire when accessing the web site.
ห น ้ า 94 | 96
When the second script is due, work will change the profile and
comment back to the original.
ห น ้ า 95 | 96
When the script deletes the user
ห น ้ า 96 | 96