We are providing free dialup access to our internet service in Zimbabwe. We really and truly get nothing out of it, but we are trying to redirect their browser to start on our home page before they continue to browse so we can get some mileage. Often when I connect in a hotel using their service, my browser opens to the hotel�s home page or the service provider�s homepage then let�s me browse as normal. Anyone out there with any ideas?
You can do this fairly easily with squid.
1) Write a squid redirector that only redirects if the user's IP address is NOT in a hash table (you can do this in C with Berkeley DB pretty easily).
2) Add a script to the Radius server that clears the user's IP from the hash table when s/he logs out. This will reset things for the next user who logs-in.
3) Make the redirect page add the user's IP to the hash table.
So, all users are redirected by default. When they visit your advertising page, they are added to a list of "good" users (i.e. those who have seen you page). Finally, when they log out their IP address is removed from the list so that the next user is back to being redirected by default.
The only hard part here is (2). We do this using a home-brew Radius proxy that opens up each packet and looks at the acctstatustype and framedaddress attributes. You could do it either with a true radius proxy (i.e. freeRadius) or with a script that runs on the VOPRadius server.
--Ernest
