Until recently, the budget satellite access to the Internet was extremely asymmetric (the request ran over land networks, the answer "fell from the sky"). Now, one well-known three-color campaign offers a bidirectional set at quite reasonable prices. A scope, first of all, for the organization of access to a network in places where laying of the land line is either impossible or too expensive.
The customer was tasked with providing access to the hunting base, located 60 kilometers from the city. Departure to the place showed the presence of cellular networks, but 3G there was only declared by the icon on the phone’s display, but in fact it was completely absent. Attempting to negotiate with OpSoSami about the forwarding of optics from the base station, seen far away, led to a commercial offer of 700 thousand rubles for the installation and 69 thousand per month of monthly fee for the channel, which could not but rejoice. In serious meditations, I drove into the search line "Satellite Internet" and, lo and behold, I realized that this was salvation.
For the project was purchased:
1) Kit for receiving satellite Internet - 50 000.00 rubles.
2) CyberPower UT450EI UPS - 4,500.00 rubles.
3) Mikrotik RB951G-2HnD router - 3,850.00 rubles.
4) Mounting change - 1 500,00 rub.
5) USB-modem - lying in a drawer.
I will not describe the process of installation and setup of the kit, because it differs little from the installation of a conventional television set and receiver.
The receiver has a 10/100 RJ-45, which we connect to the router. The process of setting up HotSpot-a is described in many sources, I did this for this manual .
Well, then - the most interesting. Since laziness, as is known, the engine of progress and handles to bring each user was too lazy, he decided to automate the process by sending the Login / password pair via SMS.
First you need to download and install the user-manager package on Mikrotik. Immediately after the reboot, the control panel will be available at http: //IP.of.you.router/userman
Login: admin without password. Immediately change. To work RADIUS server on Mikrotik create a virtual router. We open the terminal and enter
/tool user-manager router add customer=admin disabled=no ip-address=127.0.0.1 name=virtual shared-secret=123456789
Result:
Create a profile trial1
Intentionally made so that each user works at the highest possible speed. The system is very flexible, has a lot of features described in the documentation.
Next, configure the HotSpot-a profile to work with RADIUS
And the router's RADIUS server itself.
Add a rule to the top of the NAT table
/ip firewall filter add chain=input comment="allows user manager to work with local hosts" src-address=127.0.0.0/24
This completes the server setup. Getting down to the iron part. We plug a modem into the USB connector, make sure that the router sees it. System → Ports
Set Secret, turn on message receiving mode. Tools → SMS
We send a test message to the modem number, make sure that it is received
/tool sms inbox print
Remove the test message
/tool sms inbox remove 0
Add a message processing script. System → Scripts
Code
/tool sms set receive-enabled=yes :local smsPhone :local smsMessage :local logMessage delay 2; :foreach i in=[/tool sms inbox find] do={ :set smsPhone [/tool sms inbox get $i phone]; :log info $smsPhone :local date [/system clock get time] :local hour [:pick $date 0 2] :local min [:pick $date 3 5] :local sec [:pick $date 6 8] :local pass 27394 :set pass ($hour * $min * $sec) :if ($pass = 0) do {:set pass 6524} #:log info $pass :set logMessage "$date. Get SMS. Genegating $smsPhone->$pass" /tool user-manager user remove [/tool user-manager user find username=$smsPhone] /tool user-manager user add customer=admin disabled=no username=$smsPhone password=$pass shared-users=1 phone=$smsPhone /tool user-manager user create-and-activate-profile customer=admin profile=trial1 $smsPhone :set smsMessage "Login: $smsPhone Password: $pass" :log info $smsMessage :if ([:len $smsPhone]>10) do { /tool sms send usb1 $smsPhone message="$smsMessage" } /tool sms inbox remove $i delay 10 # delay 1; }
System → Sheduler create a new task that will run this script every minute.
Download the hotspot start page from the router, embed information about the number to which you want to send SMS
Check the operation of the system. That's all. Made in 15 minutes on the knee but it works, do not kick much.
Plans to figure out how to send an SMS from the authorization page, so as not to force the user to enter his cell phone number twice.
Source: https://habr.com/ru/post/325344/
All Articles