I have the following setup at home:


Question: Is there any way to show a default webpage when a user loggs to WIFI for the first time?

I saw my ISP doing that when you have a delay in paying your bill. It shows that page for whatever page you are trying to view and after you hit "I understand", the page goes away and doesn't come back.

  • 1
    Certain routers support this...it's called a "captive portal". However, most SOHO routers don't have this as it's more designed for commercial use.
    – Nathan C
    Dec 28, 2013 at 14:23

3 Answers 3


Sure, I run Meraki gear at home and it's easy to do this with their built in features to allow users on a particular SSID to authenticate with various methods. e.g. Facebook login, paywall, click-through, sms auth

In your setup, your gateway computer can run something like m0n0wall or pfsense with their captive portal feature to configure what you want.

  • I'm already having iptables doing the NAT. What kind of configuration are you talking about? But think that I have a password free WIFI connection on the router, so that anybody can join. Dec 28, 2013 at 14:50
  • Configuration of the functionality you want - a splash page with users clicking "I understand"
    – larsen161
    Dec 28, 2013 at 15:19
  • Do you know any link of the actual implementation? Dec 28, 2013 at 15:26

It is possible, but not without great difficulty.

You need ipset, and a scriptable web server.

First, you create an "IPset" to record the IP addresses of the computers that already saw the captive portal

ipset create AlreadySaw hash:ip timeout $timeout

Next, you create the set of rules.

The first rule captures traffic from hosts not inside the "AlreadySaw" IPset:

-t nat -A PREROUTING -m set ! --match-set AlreadySaw src -j REDIRECT

The second set of rules resets the timeout of packets passing through the gateway:

-A FORWARD -m state --state ESTABLISHED -j Estab
-A Estab -j SET --add-set AlreadySaw src --exist
-A Estab -j ACCEPT

Finally, create a webserver that listens on ports :80 and :443, which will present the user with a 'captive portal', and upon the user successfully doing something asked by the 'captive portal', will then execute the following command:

ipset add AlreadySaw %IP%

... where %IP% is the source IP Address, which should be detected by the 'captive portal''s script.


The difficult part, of course, is in making the 'captive portal''s script. That, I leave to you as homework :)


You can use coovachilli, which is a ready built access controller with captive portal. The site is coova.org with useful intro. And the installation tutorial on ubuntu is here : https://help.ubuntu.com/community/WifiDocs/CoovaChilli. Ready built binaries are available from coova.org, so you don't need to compile it from source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.