Thanks.
I found a solution to work with hotspot placed in NATted network . Basically using external captive portal.
This is my working configuration. According with your request.
What we need :
1 - a web server with FQDN or public static IP ( for facebook app registration )
2 - a MT appliance on any network ( NAT or private IP )
Step 1 - web server configuration.
Install a LAMP server ( you can use a virtual appliance hosted on some company like RackSpace )
Install OpenVpn server with IP 10.8.0.1 ( or what you want )
Install Xinetd service. Configure to forward all traffic from port 8728 to 10.8.0.2 ( the ip of MT ) port 8728
Put inside the directory of web server ( usually /var/www ) this files : user.php , routeros_api.php , login.php
Step 2 - MT configuration.
Install Hotspot in MT using wizard
Create a new interface OVPNClient , connect to OpenVpn server ( configured to send static ip , like 10.8.0.2 )
Enable Api service on standard port 8728
Create a user inside MT that use api , read and write permission
Create a Hotspot user profile with name facebook ( according limit with yours )
Using external captive portal page script ( found on wiki.mikrotik.com ) , login.html and put on hotspot/login.html. Modify with address of your web server as redirect.
Walled Garden the IP of web server .
How it work.
A client connect to hotspot.
redirect to web server
clic on facebook button
user.php write a new user inside MT using VPN
login.php make a redirection to hotspot with access .
Have fun !!!
ToDo:
Grant access only friends of page.
p.s. remember , work only for PC and Laptop. I working on smartphone/tablet solution …
user.php :
<?php $user=$_GET['user']; $nama=$_GET['nama']; $pass=$_GET['user']; require('router_class.api.php'); $API = new routeros_api(); $API->debug = true; if ($API->connect('web_ip','user_api','password')) { $API->comm("/ip/hotspot/user/add", array( "name" => $user, "profile" => "facebook", "limit-uptime" => "00:60:00", "comment" => $nama, "password" => $pass, )); $READ = $API->read(false); $ARRAY = $API->parse_response($READ); print_r($ARRAY); $API->disconnect(); } ?>
login.php :
\