#1  
Old 24th June 2009, 00:51
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default wlan welcomepage

Hi,

In a ctmagazine from 2007 I found a nice cgi/iptables script to redirect every first visit to a welcome page.

When I'm new, my mac is not on the list, and I browse for example to http://www.howtoforge.com I'm redirected to the welcomepage.
After visiting the welcome page the mac is added to the allowed list and you can visit the pages on the web.

This works except
after visiting the welcomepage I can browse every page I want (like ispconfig.org) except the domain I tried to visit when the mac wasn't on the list.
I have to close the browser and restart to browse to http://www.howtoforge.com in this example

How to fix this?
Reply With Quote
Sponsored Links
  #2  
Old 24th June 2009, 17:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

Can you post the script here?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 24th June 2009, 20:09
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default

Code:
iptables -t nat -A PREROUTING -p tcp -i $INTERFACE --dport 80 -j REDIRECT --too-ports 80
cgi script
Code:
#!usr/bin/perl -w
use warnings;
use strict;
use CGI qw/:standard/;
my $URL = "http://192.168.0.1/index.html";
my $INTERFACE=eth0;
my $remote_ip = $ENV{'REMOTE_ADDR'};
open(LS, "sudo arp - na |");
while(<LS>){
   chop
   if($_ = ~/$remote_ip/) {
      my @lijst = split(/ /);
      system("sudo iptables -t nat -I PREROUTING -p tcp -i $INTERFACE -m mac --mac-source $lijst[3] - j ACCEPT");
      print "Status: 302 Moved\nLocation: $URL\n\n";
   }
}
close(LS);
Reply With Quote
  #4  
Old 25th June 2009, 16:58
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

I wonder if that has anything to do with your browser's cache. Have you tried to clear the browser cache?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 25th June 2009, 20:07
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default

Hi,

thanks for your reply.
Cleared the cache. Problem still there.
Also adding some vars like ?bla=1 to the url doesn't matter.
Is there a way to fix this problem?
Reply With Quote
  #6  
Old 26th June 2009, 04:46
id10t id10t is offline
Senior Member
 
Join Date: Nov 2008
Posts: 242
Thanks: 2
Thanked 22 Times in 22 Posts
Default

Browsers tend to cache DNS info as well as images/files/etc. Try creating a new user or new profile for the after check...
Reply With Quote
  #7  
Old 28th June 2009, 00:08
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default

same problem on fresh pc install.
Reply With Quote
  #8  
Old 12th August 2009, 21:05
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default

other suggestions?
Reply With Quote
  #9  
Old 19th August 2009, 10:24
davin.master davin.master is offline
Junior Member
 
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

nice script and provide some other use full scripts like this.
__________________
Latest CMS Development with PHP Application Development
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting WLAN connection in Linux... sandeep_talan Installation/Configuration 1 26th May 2009 23:46


All times are GMT +2. The time now is 07:06.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.