Advertisement

05.09.2008 at 08:16PM PDT, ID: 23391250
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Simple solution required to redirect internet users to a welcome page.

Asked by TheFoot in Perl Programming Language, Linux Programming, Apache Web Server

Tags:

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, TheFootStart Free Trial
[+][-]05.11.2008 at 06:03AM PDT, ID: 21542361

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.11.2008 at 08:02AM PDT, ID: 21542604

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 07:50AM PDT, ID: 21598291

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Perl Programming Language, Linux Programming, Apache Web Server
Tags: linux internet gateway welcome page redirect perl iptables
Sign Up Now!
Solution Provided By: Adam314
Participating Experts: 2
Solution Grade: B
 
 
[+][-]05.27.2008 at 07:23AM PDT, ID: 21652120

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906