Just felt like sharing, don’t know if anyone else has covered this or not but I suppose it couldn’t hurt to put my own solution up here. I am assuming you have the ability to create dns records and that you have some spare hardware to run a webserver with php. Feel free to suggest easier/more graceful solutions. If you break your stuff using this go cry to mamma about it.
Setup
One mikrotik device hosting multiple hotspots on different subnets.
Problem
Need an easy way for users to access the logout page as some browsers block the status popup, users close the status popup, etc.
Solution
Setup dns for logout.mycompany.com to point to 10.0.0.1 (Doesn’t have to be this ip I just felt like using it.)
Setup apache web server on 10.0.0.1/30 with php. (apt-get install apache2 php5 in ubuntu)
Make sure that the web server machine has a static route to the private ip networks via the mikrotik with the hotspots on it. (I configured the mikrotik with 10.0.0.2/30 and set the web server to route all private ip traffic via this link)
So now you have this kind of setup [LogoutServer]10.0.0.1—10.0.0.2[Mikrotik]x.x.x.x—x.x.x.x[Hotspots] where the mikrotik is the gateway between the hotspot networks and the logout server.
Create an address list in the mikrotik firewall containing 10.0.0.1
In the masquerade/src-nat rule for the hotspot network, under advanced/dst. address list enable this list with the not (!) ticked.
Create a virtual host on the apache server answering requests on 10.0.0.1 and logout.mycompany.com with an index.php file containing the following:
<?php
$visitorip = $_SERVER['REMOTE_ADDR'];
$findme = '.';
$pos1 = strripos($visitorip, $findme);
$shorty = substr($visitorip, 0, $pos1+1);
$shorty.="1";
// comment out header below and use these for checking what ip this program is getting
//echo "$visitorip";
//echo "<br />";
//echo $shorty;
header("Location: http://$shorty");
?>
To quickly explain, this php file will look at the ip of the connecting client, strip the last octet, and replace it with 1. Then it redirects to that address. For example, if one of my hotspots was configured on the 192.168.0.0/24 network with .1 being the mikrotik, any client on this network going to 10.0.0.1 or logout.mycompany.com should be redirected to 192.168.0.1.
Profit.