Hi.
I have an internet gateway setup as follows:
Ubuntu Linux (Dapper)
Webmin (for configuring iptables etc)
DHCP Server
NAT Masquerading
iptables firewall.
I need to be able to redirect internet users passing through this box, to a remote welcome page (with a link to continue to destination), if they have not made a request for the last x hours.
I realise that there are solutions such as CoovaChilli/Radius, but this is too much for my requirements. Also I am a beginner as far as linux is concerned this is my first chance to play with linux, and do not want to have to try and work out and support a big package like radius etc.
I see my easiest solution as this:
1) A new http request is received on one of the LAN interfaces.
2) Using iptables (NAT PREROUTING) the request is forwarded to the local server (Apache I guess?)
3) The web page checks the log (text file or database table?) for that MAC address, and verifies the last timestamp.
4) If the last timestamp was greater than x hours ago, redirect the user to the remote welcome page, and record the timestamp in the log.
5) If not, then still update the timestamp and forward the request to its proper destination.
Now, I am an experienced web dev with some experience as a network admin, but it is all ms techs (windows, asp, vb, js etc).
I need firstly verification that my solution will work and is do-able, and also that there isn't a better/simpler way. Secondly I need please some example scripts (in Perl?) that will get me started in achieving this. Hell if anyone can provide the whole script.. feel free :)
Thanks, TheFoot
Start Free Trial