1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Captive Portal config help

Discussion in 'EWRT Firmware Project' started by dellsweig, Feb 26, 2005.

  1. dellsweig

    dellsweig Network Guru Member

    just uloaded this firmware (EWRT) on a WRT54G running DD-WRT. No problem.

    I am trying to configure the captive portal - nocatsplash. I enabled the option and put in a target web page. I assume that any wireless client being served by this AP will be re-directed to this URL - this is not happening.

    Anyone out there ever try to get this working??
  2. dellsweig

    dellsweig Network Guru Member

    Ok - I have this working now. It appears to only capture sessions being routed out to the WAN. No problem. I setup a WRT54G on a different subnet and connected it to my switch via the WAN port.

    I connect to this captive wireless network. When I access the Internet - I get the captive portal - splash.html. This captive portal sample requires me to accept the screen twice before it will forward me - configuration issue or bug??

    I want to change DocumentRoot to something in the new writable filesystem (/opt). The web config will not allow me to do this - does anyone know of a way around this. I want to configure my own splash page.
  3. bummpr

    bummpr Network Guru Member

    Please Help


    Can someone please help guide us on how to make ewrt with NoCatSplash work. I have it loaded on my WRT54G...I just can't find any documentation or guide to configure it to work.

    Please help!
  4. mcoan

    mcoan Network Guru Member

    Captive Portal Help

    Irving of Peerless networks posted this reply at:

    ---->>Re: [Firmware] WRT54G Captive Portal with EWRT .3

    Hi guys, Irving here of Portless networks. Hopefully I can help clear up some confusion. I am working on an updated FAQ and these are all good frequently asked questions.

    First off, let me explain the three different filesystem types in Ewrt and how they are used:

    / (root) - r/o squashfs. This is the main filesystem containing all Ewrt data and you can only mount this filesystem readonly. /etc is contained here and is readonly as well.

    /tmp - r/w memfs. /tmp is a filesystem held in RAM, meaning that if you fill it you will run out of RAM. the contents of /tmp are lost with every reboot. Some files from /etc are symlinked to /tmp/etc, and the /tmp/etc versions are written at boot time based on nvram data.

    /opt - r/w jffs2. This is the new one we added for 0.3. /opt uses the leftover flash for a non-volatile journalled filesystem. you get about 1 meg on a 54G and 5 megs on a GS with Ewrt. This is a good place to store files like your custom splash pages and other content you wish to survive a reboot. /opt gets wiped when you reflash newer version of Ewrt, because the partition boundaries change.

    So: to change your /tmp/etc/nocat.conf permanently, you have to change the nvram variables. You can do a "nvram show | grep NC_" on the command line or go to Access Restrictions -> Captive Portal in the web gui.

    Hopefully that will answer your first question, and this will go in the FAQ.

    Second question: We saw this bug during our 0.2 development but haven't seen it since. turn up your verbosity in nocat to 9 and cat /tmp/services.out. email us the info to the ewrt-devel @ portless.net list.

    third question: We've captured WDS clients with 0.2 no problems, but we haven't tried it with 0.3. Again, try the steps above. Let us know if this works with 0.2 for you.<<----

    To which I replied:

    So, keeping in mind that 99% of us are Windows users and know nothing about Linux except for Linus's name, and
    referring to the web GUI in this user's example:

    1. Gateway Name: Is this your router SSID? Or what?
    2. Home Page: So, this is NOT the location for our custom splash page, since it's stored in "/opt - r/w jffs2". What is this domain for, then?
    3. Allowed Web Hosts: What should we set this to?
    4. You write, "can do a "nvram show | grep NC_" on the command line or go to Access Restrictions -> Captive Portal in the web gui." From the above GUI example, are you saying we will change Document Root to "/opt - r/w jiffs2"? I think one user mentioned above that whenever he changes the root location here, it defaults back to that displayed in the link above.
    5. Should we leave Exclude Ports, Login Timeout, and Verbosity at their default values since most of us haven't a clue what these mean?

    If any of you have any ideas for me, please let me know.

  5. glhines

    glhines Network Guru Member

    Thanks to the information provided by mcoan, I've been able to crack this nut. Here's how:

    First, you're going to need to get an SSH client and an SCP client if you use Windows. I recommend PuTTY and PSCP, respectively. You can find them both at http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html -- they're free and open source.

    Next, of course, you need to update the router's firmware. I'm sure you've figured this one out already.

    Now for the more involved part. First, I'll show you how to get the existing splash page and contents off the router so you can base your own splash page off of them. Next, I'll show you how to copy your modified splash page to the router. And finally, I'll show you how to make your router recognize the location of the modified splash page.

    To get the existing splash page off of your router, open up a command prompt (Start -> Run. Type "cmd" and hit Enter.) and navigate your way to the location of the pscp.exe file you downloaded. For example, if you kept the pscp.exe file in the C:\scp\ folder, you'd type this:

    cd C:\scp\ <Enter>
    (Note: Don't type the "<Enter>" part. That's where you hit the enter key.)

    Now you need to copy the files to your local computer. I'm going to assume you want them to end up at C:\scp\htdocs\ -- you can put them anywhere, but be wary of putting them anywehere there's a space in a directory name... that's asking for trouble. Type the following at the command prompt:

    pscp.exe -l root -r C:\scp\ <Enter>
    (Be sure to change the IP address in there to the IP address of the router, if necessary.)

    It will then ask for the router's password (the same password as the login to the Web interface). Type in your password and it will show the files as they're being copied. Unless it gives you an error, it worked.

    Next, go ahead and modify the existing splash page to your heart's content. (How to modify the splash page is beyond the scope of this post.) Go back to your command prompt and make your way to the C:\scp\ directory again. Then type in the following command:

    pscp.exe -l root -r C:\scp\htdocs\ <Enter>
    Again, it will ask for the router's password. And again, it will show the files as they're being copied. Unless you run into an error, the copying was successful.

    That's all you need to do to copy the files to the router. Using the above command, you've taken the C:\scp\htdocs\ directory and copied it over to the router at /opt/htdocs. Now you have to make sure the router is looking in the right place for the splash page. As dellsweig found, just changing the Document Root variable in the Web GUI doesn't seem to work. This is pretty easily fixed.

    Open up putty.exe. (You only need to double-click on this one.) Enter the IP address of the router in the Host Name (or IP Address) field. Make sure the SSH radio button is selected and click on the Open button.

    It will ask for the login name. Use "root" for the login name the same password as before for the password. (Note: It will not show anything as you type in the password, but it's still accepting what you type.)

    Once the prompt--"ewrt ~#"--comes up, type in the following:

    cd /opt/htdocs <Enter>
    ls <Enter>
    If you see a list of the splash page files, you've succeeded thus far.

    Now, type in:

    nvram show | grep NC_ <Enter>
    It should display several variables and their values. The key variable here is NC_DocumentRoot. We need to change this variable to point to the right place. So type in the following command:

    nvram set NC_DocumentRoot=/opt/htdocs/ <Enter>
    If this works, it will bring up another prompt--"ewrt /opt/htdocs#"--immediately below the previous one. (Generally speaking, with Linux, if it doesn't complain, that means it worked.) Now hit the up arrow key twice (which will bring up the grep command you typed in earlier) and hit enter. If all went well, you should see that the NC_DocumentRoot value has changed to the appropriate value.

    Close the putty.exe window and click OK to accept closing the session.

    That's it. You're done!

    I must thank mcoan for posting that information. Without the hint to check the NVRAM, I wouldn't have gotten this to work.

    As for your other questions, mcoan, I'm afraid I can't really answer any of them. I'll be sure to post here again if I find out the answers.
  6. mcoan

    mcoan Network Guru Member


    One word: "AWESOME." Just what the doctor ordered. I like your step-by-step instructions and will ask that PortLess include them in their FAQ.

  7. mcoan

    mcoan Network Guru Member

    So, thanks to GLHines, I have a custom splash page all up on my router! However, it makes me click the Login button twice. Bug? Or something I've done wrong?

  8. glhines

    glhines Network Guru Member

    It may be a bug, but I haven't encountered it when setting up a router yet (I've already set up a few this way). It may be a configuration setting or perhaps something in the markup.

    Can you post the modified splash.html file, or at least the relevant portions of it? I'd be happy to look over it to see if there's anything wrong.
  9. mcoan

    mcoan Network Guru Member


    Nah, I don't want the page made public, but I had the same problem with the splash I took off the router...the one for Portless Networks. Send me your email addy and I'll email my splash to you for your private review. Email me at mrjohnsonsdog@msn.com. Thanks.

  10. mcoan

    mcoan Network Guru Member

    No response from the developers at PortLess Network or GLHiines as to the problem with the "double login" required. Darnit. But, just for future reference, following is a copy of an email I received from user Dellsweig, who got his EWRT-3beta splash page to work (but with double login required) at the same time as I did. But he's since had to discontinue using it:

    > No, I have not resolved the splash page/login issue. But I have been
    > having some stability issues with EWRT as well. I had the WAN
    > interface fail on 2 separate WRT54G's. I returned one and it failed
    > again. All were 2.2 hardware.
    > The WAN light on the front would flash VERY rapidly - not like the normal
    > on/off you would see when it is connected to the cable modem..
    > I could not ping out the WAN interface either. Did not matter if I assigned
    > static values for the WAN or let DHCP do its thing. The only thing in
    > common for these failed routers was EWRT.
    > I did factory resets - cleared NVRAM, used the linksys factory upgrade tool
    > to re-flash 3.x.x, then put DDWRT back on and the device was OK again....
    > I have fallen back to DD-WRT and will wait till ERWT does his next
    > release.
    > I really want the captive portal but I cant put this device in a
    > commercial establishment (Deli) without backup/restore
    > capability....
    > As for the splash twice issue - I can live with that - I don't see
    > anywhere in the HTML code why this would occur. It must have to do
    > with the way the iptables are mangled before the passthough occurs.
    > I spoke to Brian (DDWRT) - he is adding chillispot (another captive portal
    > thing) into DDWRT. He has a build but wanted to do more testing before he
    > gave it to me.
    > I think the thing I like the most about EWRT is the R/W file system and the
    > ability to have the captive portal web code local on the router. Chillispot
    > will require an external web server. I am not sure if this has to be on the
    > local LAN....

    NOW I'M CURIOUS: Are other folks running EWRT-3beta experiencing either stability problems as described above, and/or the "must login twice" issue?

  11. Bry

    Bry Guest

    i followed all the instructions--all went very well; i now have a customized web page based on the portless html page. thanks to all who contributed for the procedure! i am also running my VoIP from the router and no problems. so now that i've got this far ... what's the next step for the splash page?

    Brian in Miami
  12. glhines

    glhines Network Guru Member

    mcoan, sorry I haven't gotten back to you. Been busy, busy, busy.

    Anyway, you can e-mail me the splash page at <greg at gonzoaccess.com>. By the sound of it, however, it may not be the HTML but simply an issue with the hardware or firmware.

    If I can't find any problems with the markup, I might recommend flashing the firmware back to Linksys's own then back to EWRT. It may not work, but it may be worth a shot.
  13. mcoan

    mcoan Network Guru Member

    Well, I'm up and running by taking the splash.html page for Portless Networks. I used Microsoft FrontPage to modify it with my logo and used Notepad to change the disclaimer text. But users STILL have to login TWICE in order to be redirected to the web site of their choice (same as with the orig. Portless login page). Guess I'll have to live with it for now: I wrote the developers at portless.net and told them about this forum but they won't answer.

    I have NOT had any of the stability problems mentioned by user Dellsweig.

    Taos, NM
  14. mrmuse

    mrmuse Guest

    Refused connection????

    After upgrading the linksys to Firmware Version: Ewrt 0.3 beta 1 and following the step by step, I tried to run:

    pscp.exe -l root -r C:\scp\

    and this is what I get: Fatal: Network error: Connection refused

    Without any documentation I have no idea where to start looking for the problem. Hoping someone can help.

    I know this is an old thread, but I thought I would give it a shot...

    Thanks in advance

  15. joe_p

    joe_p Network Guru Member

    Same problem

    I recently went through this nice tutorial as well and was able to almost get in once, but it kept saying I had the wrong password, so I unplugged and plugged back in my router and now come up with the same problem as above. Any help would be great on this. I'll come back and post if I find the issue. I also plan on posting a link and the tutorial on my blog.

    Update: I am now getting a password prompt, but it is not authenticating it. I know I am typing in the correct password because I use it to also log into the web interface. Any ideas?

    Update: I have no idea why it went from the Connection Refused to the password prompt, but now I get the password problem. I was putting "-l admin" instead of "-l root" and then trying my password. I got in and copied them over. Thanks again for the awesome tutorial. It took me 2 days to find, but now I'm on my way.
  16. joe_p

    joe_p Network Guru Member

    Update: Problems

    Ok, so I finally got everything going and then it crapped out on me and wouldn't let me connect. I reset the router and it does now. I updated the /opt/htdocs with my splash page and updated the nvram.

    Problem: even though I updated the nvram, everything else works right except the splash page root. It still points to the /usr/share/nocat/htdocs root. I can't get it to change and I can't modify those pages because it's a read-only fs. Would someone please help me figure out what's different and why I can't change the document root over to /opt/htdocs?

    I'm running a WRT54G v.2.0 with Ewrt 0.3 beta 1 firmware.
  17. joe_p

    joe_p Network Guru Member

    Fixed the issue. You have to run "nvram commit" after you've modified everything, and then run "reboot" to reboot the router. That will commit the nvram changes with the document root and after you've added your splash pages, reboot the router using that command and you're good.

    Other than that missing info, this page was the best thing that helped me get my splash page going. Thanks everyone.
  18. pmaior

    pmaior Network Guru Member

    An new info on the double login ?

    Hi all.
    First post in this forum.

    I used the step by step instructions above on a version 3.03 wrtg router.

    The instructions were excellent, it was my first attempt at any type of linux commands.

    I got the splash page to work , but also experienced the double login issue.

    I noticed that it seemed to only require one login attempt when using firefox, and my wife said she only had to login once on her laptop, so I think it may be a browser setting issue.

    I am testing this at home for later use in a restaurant environment.

    Thanks for the great setup instructions, this is a very cool firmware upgrade.

    What other features can I take advantage of in a commecial hot spot setting ?

    I did not notice any other settings in the GUI but I am not that familiar with it.

    I realize this is an old thread , but hoping someone will respond with some good news.

  19. jagboy

    jagboy Network Guru Member

    i noticed this too. that firefox is only one login. dd-wrt btw has this feature built in......
  20. pmaior

    pmaior Network Guru Member


    Do you mean captive portal ?

    I have not seen that in the threads for dd-wrt.

    What version do I need to get to try this ?

    Also , will it flash over the ewrt, or do I need to reset to defaults and clear nvram ?

    I'm off to serach the dd-wrt section.


Share This Page