Hello to all
I have wireless network in my company where is guest network using Mikrotik hotspot. Now we try to build User friendly password generation
and we thought abaut sms sending passwords to our costumers.
Is there any chance to do it with user manager in mikrotik?
thank you
here is the sample of working code
/tool sms set receive-enabled=yes
:local smsPhone
:local smsMessage
delay 2;
:foreach i in=[/tool sms inbox find] do={
#Password generation
: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
:log info $date
#End password generation
:set smsPhone [/tool sms inbox get $i phone];
:log info $smsPhone
#Create voucher
/tool user-manager user remove [/tool user-manager user find username=$smsPhone]
:log info “2”
/tool user-manager user add customer=admin disabled=no name=$smsPhone password=$pass shared-users=1 phone=$smsPhone
:log info “3”
#TODO set profile!!!
/tool user-manager user create-and-activate-profile user=$smsPhone customer=admin profile=hour
:log info “4”
#End create voucher
:set smsMessage “Login: $smsPhone Password: $pass”
:log info $smsMessage
:if ([:len $smsPhone]>10) do {
/tool sms send usb3 $smsPhone message=“$smsMessage”
}
:log info “5”
/tool sms inbox remove $i
:log info “6”
delay 10
}
kpc
March 31, 2015, 8:33pm
3
hi mr samir
can i have your email address?
my email is amirreza.keshvari@gmail.com .
i have hotspot on my network,i want guest insert mobile number in text box and click submit buttom and system auto send username and password to that mobile number,
please help me
samir494:
here is the sample of working code
/tool sms set receive-enabled=yes
:local smsPhone
:local smsMessage
delay 2;
:foreach i in=[/tool sms inbox find] do={
#Password generation
: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
:log info $date
#End password generation
:set smsPhone [/tool sms inbox get $i phone];
:log info $smsPhone
#Create voucher
/tool user-manager user remove [/tool user-manager user find username=$smsPhone]
:log info “2”
/tool user-manager user add customer=admin disabled=no name=$smsPhone password=$pass shared-users=1 phone=$smsPhone
:log info “3”
#TODO set profile!!!
/tool user-manager user create-and-activate-profile user=$smsPhone customer=admin profile=hour
:log info “4”
#End create voucher
:set smsMessage “Login: $smsPhone Password: $pass”
:log info $smsMessage
:if ([:len $smsPhone]>10) do {
/tool sms send usb3 $smsPhone message=“$smsMessage”
}
:log info “5”
/tool sms inbox remove $i
:log info “6”
delay 10
}
Thats ok script. But ruter has SMS option only for one “allowed number”. Does have some another option in this script for generate usernames?
To save the cost of SMS to the user, you may have corresponding phone number to login and the message text to be chosen as a password.
Auto activation!
Nagobi
December 2, 2015, 1:59am
7
Have a nice day Samir!
I see your script and i think this what i want, can you help me? i want authorization via sms (generated and send voucher via usb modem).
1 - User connect to Hotspot
2 - See login page
3 - Write his number in to login page and press submit button
4 - Receive password via sms and login with him
5 - Phone number write in log to disk with date&time authorization
Sorry for my English, i study now)
my email: nagobi@icloud.com
my Skype: posians
Recently We done the SMS Solutions for Mikrotik Hotspot using the radius
User Connected to FREE-WIFI AP
When he trying to browse automatically redirected to Login Page
He Registered himself entering their mobile Number and name
He will get OTP for Authorization after success
He will Get the SMS of Username and Password with 30 Min Free usage
After that he need to refill using Recharge Coupon or Payment Gateway.
Nagobi
January 29, 2016, 5:18pm
9
Good news!
How you can do it? sms send via usb stick in mikrotik or another service? captive portal hosting on mikrotik or another place?
Developed using with freeradius Server, captive portal & SMS Every thing work from the same server
bax
February 2, 2016, 11:39am
11
It will be very nice if you make some tutorial … maybe on wiki
How do you run the script? by the scheduler?
Thanks.
imagica
February 7, 2016, 5:09am
13
Yes am also interested in this solution. For SMS sending i want to use SMS gateway api.
something new on this thing? Would be interested too
could you please give me this script ?
i need the users enter their mobile No. and get their generated password through SMS,
i know that the GSM modem is needed.
how can i do that ?
Hello, i´m interested, can you tell me more about it and cost please?.
Too001
October 9, 2016, 4:59pm
17
Hi,
How can one get the code(cost). Can you also integrate other forms of payment to the system. Thanks
czolo
October 11, 2016, 6:20pm
18
We have something similiar. We are sending a link in SMS. User click on the link, and a web browser autheticate him into the system. Of course there is possibility to collect phone numbers and use it for operators data retention.
It seems #rajeshrouthu just showing up to us what he did. didn’t come for help. I am looking for this solution too. Any guys can help??
elitebb
January 31, 2017, 2:53pm
20
Yes , I think he did great research for what he did or paid someone who know how to do that . You can find some solution on internet or find someone .