Community discussions

MikroTik App
 
bokad
Member Candidate
Member Candidate
Topic Author
Posts: 152
Joined: Tue Oct 18, 2005 7:34 pm

Automatic billing/account creation and hotspot user manageme

Tue Oct 18, 2005 10:43 pm

I'm starting a small WISP and have chosen RouterOS hotspot as my gateway/user management. I was looking for any free/simple ways to accept credit cards and automatically create accounts on the MikroTik.
I've come up with a solution that some of you may be interested in.
If this has already been done, let me know!!!

What is is:
Quick web based interface to MikroTik RouterOS

Requirements:
Windows 2000 or better
A paypal account
Apache webserver and PHP, both free

What it does:
---Account Creation Module---
Allows user to select one of three account types (24 hours pass, 1 or 2 hours, 1 month)
Passes appropriate price and product information to PayPal
Once the user pays at PayPal (they don't need a paypal account) they are redirected to a page where they can create a new account or add credit to their old one.
Automatically creates/updates the user account
Allows user to check status and time remaining on their account

---User Management Module---
Quick and easy listing, creating, modifying, removing, of users.

Bonus:
Very easy to setup, one or two hours
No RADIUS server needed
No dedicated box required runs on any machine
No merchant gateway account necessary

The Bad:
Very ugly UI right now
Poorly written PHPSL (PHP as a second language)
Based on telnet (problem with PHP SSH module, hopefully fixed soon)
Probably buggy and insecure

Has this already been done? Is there interest in something like this? I wrote it to fit my need of running an automated hotspot without forking over alot of cash or spending time learning the free linux solutions.
 
rikerconsulting
just joined
Posts: 21
Joined: Sat Apr 30, 2005 12:11 am
Contact:

Re: Automatic billing/account creation and hotspot user mana

Wed Oct 19, 2005 9:44 pm

I would be interested in hearing more about this. Please e-mail me at mikrotik@rikerconsulting.com. Thank you.

~ Jason M. Weber
 
cabana
Frequent Visitor
Frequent Visitor
Posts: 71
Joined: Fri Feb 18, 2005 9:18 pm

Wed Oct 19, 2005 9:51 pm

I would as well, tonycaban@caban.org.uk
 
mosesjere
just joined
Posts: 7
Joined: Thu Sep 15, 2005 4:13 pm

Thu Oct 20, 2005 1:02 pm

 
jaytcsd
Member
Member
Posts: 335
Joined: Wed Dec 29, 2004 9:50 am
Location: Pittsboro IN
Contact:

Thu Oct 20, 2005 2:03 pm

I think anyone running a hotspot would be very interested, we've been looking for a solution for some time now.

jay@netsurfusa.net
 
proweb
newbie
Posts: 43
Joined: Sat Oct 08, 2005 10:04 pm

me to brooo

Thu Oct 20, 2005 5:09 pm

me to....please mail me prowebmasterku@yahoo.co.id
dont forget
 
shanen_au
just joined
Posts: 21
Joined: Tue Aug 02, 2005 5:47 am

Fri Oct 21, 2005 1:21 am

Me to please - onlysunnys@hotmail.com
 
User avatar
chipxsd
newbie
Posts: 41
Joined: Thu Apr 28, 2005 7:34 pm
Location: San Francisco

Fri Oct 21, 2005 12:11 pm

Oh pleeeezee, count me in! email: klemen.verdnik@gmail.com

I just want to know how you managed to get to the hotspot users database with PHP?
 
egg
just joined
Posts: 23
Joined: Sat Jul 03, 2004 12:23 pm

Fri Oct 21, 2005 12:18 pm

Mail me too pls kalin7 at gmail dot com
 
mosesjere
just joined
Posts: 7
Joined: Thu Sep 15, 2005 4:13 pm

Fri Oct 21, 2005 1:25 pm

But when are you sending? We are waiting
 
User avatar
infomate
Member Candidate
Member Candidate
Posts: 114
Joined: Sat May 21, 2005 2:30 pm
Location: Dumaguete City, Philippines

Fri Oct 21, 2005 3:00 pm

I would suggest that you post this on the How to - sticky. so it can be consolidated with the other how-to's.

More power!

Robert S.
 
daiceman
Frequent Visitor
Frequent Visitor
Posts: 92
Joined: Tue Mar 01, 2005 9:43 pm

Fri Oct 21, 2005 10:16 pm

Me also?

bowtieguy at gmail dot com
 
bokad
Member Candidate
Member Candidate
Topic Author
Posts: 152
Joined: Tue Oct 18, 2005 7:34 pm

Sat Oct 22, 2005 3:56 pm

Apologies that I haven't contacted any of you yet. I just got a bunch of equipment in and I've had a whole lot of sleepless nights. As soon as I can get some basic documentation together I'll post/send the info. Glad to see there is a market for this. Anyway, until I can get some stuff together a good starting place is installing Apache 2 for windows (http://httpd.apache.org/download.cgi), PHP 5 (http://www.php.net/downloads.php) and then looking at the PHP scripts for telnet (http://www.geckotribe.com/php-telnet/) and Paypal integration (http://www.micahcarrick.com/v2/content/view/1/3/).

My function for adding the user then looks like this:

function AddUser($name, $pass, $profile, $comment, $uptime, $bi, $bo, $disabled) {
$comment="\"".$comment."\"";
$pass="\"".$pass."\"";
$command_temp="ip hotspot user add name=".$name." password=".$pass." profile=".$profile;
$command_temp=$command_temp." limit-uptime=".$uptime." limit-bytes-in=".$bi." limit-bytes-out=".$bo." comment=".$comment;
$command_temp=$command_temp." disabled=".$disabled;
return $command_temp;
}

You would use a web form to gather the info, this function aggregates in to the proper RouterOS command, and then then returned for it to be passed on to the telnet program and executed.
 
rikerconsulting
just joined
Posts: 21
Joined: Sat Apr 30, 2005 12:11 am
Contact:

Wed Nov 02, 2005 9:01 pm

So has anyone got it to work correctly yet and care to share the wisdom?
 
User avatar
infomate
Member Candidate
Member Candidate
Posts: 114
Joined: Sat May 21, 2005 2:30 pm
Location: Dumaguete City, Philippines

Thu Nov 03, 2005 2:10 am

Still clueless :roll:

Robert S.
 
User avatar
engineer
Frequent Visitor
Frequent Visitor
Posts: 53
Joined: Mon Feb 28, 2005 6:13 pm

Thu Nov 03, 2005 9:45 pm

Still clueless and hoping for more info/results :)
 
wildbill442
Forum Guru
Forum Guru
Posts: 1055
Joined: Wed Dec 08, 2004 7:29 am
Location: Sacramento, CA

Fri Nov 04, 2005 9:04 am

Apologies that I haven't contacted any of you yet. I just got a bunch of equipment in and I've had a whole lot of sleepless nights. As soon as I can get some basic documentation together I'll post/send the info. Glad to see there is a market for this. Anyway, until I can get some stuff together a good starting place is installing Apache 2 for windows (http://httpd.apache.org/download.cgi), PHP 5 (http://www.php.net/downloads.php) and then looking at the PHP scripts for telnet (http://www.geckotribe.com/php-telnet/) and Paypal integration (http://www.micahcarrick.com/v2/content/view/1/3/).

My function for adding the user then looks like this:

function AddUser($name, $pass, $profile, $comment, $uptime, $bi, $bo, $disabled) {
$comment="\"".$comment."\"";
$pass="\"".$pass."\"";
$command_temp="ip hotspot user add name=".$name." password=".$pass." profile=".$profile;
$command_temp=$command_temp." limit-uptime=".$uptime." limit-bytes-in=".$bi." limit-bytes-out=".$bo." comment=".$comment;
$command_temp=$command_temp." disabled=".$disabled;
return $command_temp;
}

You would use a web form to gather the info, this function aggregates in to the proper RouterOS command, and then then returned for it to be passed on to the telnet program and executed.
Basically you setup a HTTP server like he recommended, create a webform so the user can enter information such as: name, billing address, rate plans, etc. Use the above script to take the entered data in the webform and create the user in the mikrotik's hotspot server by generating the RouterOS syntax and entering it via telnet.. He also provided a link to integrate paypal to accept payments.

I think it would be easier, scalable, and more secure if you used an external RADIUS server and designed the webform around RADIUS and then set the mikrotik up to get authentication from the RADIUS server.

One security issue I notice right away is telnet being used to enter in client data, because it sends authentication, as well as all other data in plain text.

RADIUS has secure authentication protocols, and really doesn't require much to run... just RAM and some harddrive space..

The thing is you still need an externel box to run the webserver... If you got that then why not just use RADIUS?

Not trying to slam your efforts, just trying to offer some constructive critisism and think of the cost savings/benefits of the suggested system.

The real value would be creating the web interface and RAIDUS server for "out of the box" mikrotik integration.
 
bokad
Member Candidate
Member Candidate
Topic Author
Posts: 152
Joined: Tue Oct 18, 2005 7:34 pm

Sat Nov 05, 2005 11:07 pm

re: Telnet...I don't recall if I mentioned in the original write up, but the SSH implementation in the current PHP package for windows is broken.
In my environment the server was directly connected to the MikroTik so there was no threat of someone sniffing the traffic.

My original goal was to provide a free billing and user management hotspot solution on windows. There's stuff out there for Linux but it can be complicated and everyone already has a windows box sitting around that can do double duty. There are no good free RADIUS servers for Windows and the "cheap" ones start at $600. To do what you describe requires the RADIUS server to work with an SQL database. None of the free RADIUS servers for windows support SQL databases. It is possible to manipulate a flat text file, storing non-radius attributes as comments in the file, etc... however, FreeRadius for windows only reads the user file on startup. The Multitech free RADIUS server will reread the user file every minute, but it does not support some of the MikroTik custom attributes.

I got pretty far in to the telnet interface before leaving it to work on a solution with text based RADIUS user files. When I quit, the user could sign himself up and pay with CC and also credit time to an existing account. It would check to see the user account didn't already exist, etc... The main problem is that it was slow because each time a telnet command was issued the program would have to pause to ensure it had recieved the response before continuing. This made each executed command take at least a second. It may not seem like much, but some of the operations required multiple commands to be run.

Wireless Orbit is getting ready to rollout a new version of their hotspot management service that will support Mikrotik. They charge a very reasonable ~$40/month per AP. Some seem to be wary of a remotely hosted authentication solution but I've been testing it over a bad satellite link and it is working fine. They provide far more redundancy than I ever could. Unfortunately, this will noit come out until the end of November and I need to find something in the Interim. I'm planning to use the homegrown telnet solution until that time.

If I ever do come up with something complete and documented enough to share, I will be sure to post it here.
 
hotnet
just joined
Posts: 3
Joined: Thu Nov 03, 2005 12:25 pm
Location: austalia
Contact:

Mon Nov 07, 2005 1:34 am

Hi Bokad

We are starting a small WISP here to and planning to setup several "Local Hotspots" with RouterOS and linked up with backbone links exclusively via wireless, I would be highly interested in what you are doing too because we were planning to give the billing and authentication to a third party company.But it would be good if we can do it in house.My background here is mainly R&d in antennas for 0 to 30dbi and been doing antenna designs for several years now. Ive setup serveral APs with backbone links covering approxmatly 80sq km and 100% of our antennas are made here, from parabolics to omini for 2.4ghz to 5.8 peer to peer and APs


Cheers!!!
 
rikerconsulting
just joined
Posts: 21
Joined: Sat Apr 30, 2005 12:11 am
Contact:

Tue Nov 08, 2005 3:21 pm

Bokad, I would highly suggest just posting what you have so far under GNU or something, then everyone can contribute to the project. You could probably even get it set up under a SourceForge project.

I understand everything else but the hangup I have is a lack of understanding quite how to work with PayPal. Even spending time on Micah Carrick's site I'm just not "getting" that part.

~ Jason
 
User avatar
engineer
Frequent Visitor
Frequent Visitor
Posts: 53
Joined: Mon Feb 28, 2005 6:13 pm

Tue Nov 08, 2005 7:23 pm

Has anyone tried this RadiusManager Software? The only thing I could not get from the website if how they integrate the billing stuff. Also, a time limiting option would help. I have sent a query to them...havnt received a reply yet.
Waiting...will post asap.

http://www.dmasoftlab.com/index.php?cont=radman
 
User avatar
engineer
Frequent Visitor
Frequent Visitor
Posts: 53
Joined: Mon Feb 28, 2005 6:13 pm

Tue Nov 08, 2005 7:50 pm

Dont bother with the link above....

Here's the reply:

Hello!

Radius Manager doesn't handles credit cards. It is normally used for
ISP's which Mikrotik Access Points. Ask us for more questions if something
is not clear enough.

Regards,
Viktor K.

Who is online

Users browsing this forum: erlinden, Mellip and 32 guests