Captive Portal Does Not Appear

  • I have been running Pfsense as a test using the live CD and created by portal pages etc, they all worked great from the live CD.

    Now I have pfsense up and running from the harddrive, I uploaded my portal pages but they are not appearing when you open a web browser and try to access a page.

    The only way to authenticate is to open manually?

    What have I missed here?

    I just end up with an error in the webpage "the server stopped responding".


  • Umm…

    I think it has something to do with the PHP I am using - it seems to slug everything up to a halt?

    If I change the portal index for a default page, it works fine.

    I am using a different PC to the one I was using with the live CD.

    The PHP is not too way out there - It just calls a PHP script which checks browser type and then outputs a different bank of html depending on if it's a mobile browser or PC.  Nothing huge at all.

    Could the PHP be causing this issue?  Any way to speed the PHP up?


  • The more I play with this, the wierder it is being.

    With just a simple form now, the form displays very quickly when you open a browser, but clicking submit takes ages to redirect to your original webpage, timing out again again.  It does authenticate though.

    Do you think this could be a performance issue?  It is an Intel(R) Celeron(R) CPU 3.06GHz, with 512MB ram.  Not an amazing machine, but I have successfully setup some Pfsense captive portals on machines with lower spec than this before!

  • has nothing to do with the machine, or anything with the firewall from the sounds of it. I suspect CP is blocking something you're trying to do because you aren't allowing it through (like hit an outside web server) and the browser sits there waiting for it to time out. Packet capture on the client system and see what it's trying to hit.

  • Thanks.

    When I do the packet capture at the bottom of the Pfsense screen, I see nothing that would worry me I don't think.

    The .cap file you can download has (what look like) corrupt lines.

    What happens now is that the captive portal page appears very quickly and almost instantly.

    When you click the submit button, I have a waiting image div appear while the form submits.  The page sometimes will go through to your chosen landing page, or more often than not, it sits for ages and times out.  However, it does authenticate as I can then manually visit the landing page or another web page and the client shows up in the captive portal status.

    What ever is causing it to wait happens after the authentication part?

    I do reference to an external site, but have allowed that host name.  I have also disabled that part of the page completely and it had no effect.

    Any ideas?


  • I have installed Pfsense on a second PC I had spare, and I get the same issue.

    Even if I simplify my portal page to a very simple HTML form, usually the first time it will go through the portal quickly, but the then the next few times (randomly) it just times out or takes an age.

    There seems to be no pattern.  It can work quite quickly one moment and then not the next.

    What I do is kick the user off the captive portal and then open a new browsing tab to test it again.  This is when it takes ages.

    Is there a reason why maybe the first will work, but not subsequent?

    I am not too sure how to use the packet capture to my benefit to be honest, although it seems to hang just after authentication.

    In the index.php file in /usr/local/captiveportal/index.php (not the captive portal page uploaded), I can add a couple lines of php down the bottom inside the last elseif { }, which is where the form is sent in my case.  These lines of code simply open and append a file, and this happens immediately, so I know the form gets through to the end of the index.php immediately, it is just the redirect from there that seems to take ages?  I wondered if it was a DNS issue maybe, although it behaves the same if I use a known IP address to a web page (I have used google IP and also the IP of my internal printers config page)?

    Also, I have put a link on my captive portal page which javascript causes to appear when the submit is pressed, this link says "If you are not redirected in 15 seconds, click HERE" and the <a href="">is $PORTAL_REDIRURL$.  If I think the captive portal is taking too long to redirect, I click that link it is goes immediately to the page.

    Also, if I open CMD on my XP machine, and ping -t (which is my printer), with the portal closed, no reply as expected (-t causing it to ping constantly).
    As soon as I click submit, literally milliseconds later, the ping responds, but the redirect still doesn't occur and the page times out (unless I click my</a> <a href="">or enter a new URL?

    Any clues at all?

    Thanks :-)</a>

  • Isn't the 'Redirect to original URL' called as javascript?

    Have you checked the javascript debugging while waiting for the page to load?

Log in to reply