[2.0-RC3-IPv6] Captive Portal Port 8000 not reachable



  • Hi all,

    I am running 2.0-RC3-IPv6 (amd64) and I have an issue that is reported here : http://redmine.pfsense.org/issues/1700  (though not for this version)

    I tried to beat the system by manualy adjust the /var/etc/lighty-CaptivePortal.conf to bind to all addresses again instead of only the localhost.

    However, after I restart the captive portal this conf file is overwritten.
    I even tried to chmod it 444 but that doesn't work either.

    This is the part that is currently my problem (i think) –>

    
    ## bind to port (default: 80)
    server.bind     = "127.0.0.1"
    server.port  = 8000
    $SERVER["socket"]  == "127.0.0.1:8000" { }
    $SERVER["socket"]  == "[::1]:8000" {
     }
    
    

    This makes the captive portal in-accessible from outside the localhost.

    How can I "fix" this until the bug is officially fixed? Any ideas anyone?
    Removing the lines is no use as the file is overwritten every time.

    Oh , i forgot to mention that this issue might only appear on the IPv6 release.. but i cannot confirm that.



  • @CrisvG:

    (though not for this version)

    That is for that version, 2.0-IPv6 is really 2.1-IPv6 as classified in redmine and as it will be for release. You can edit the file that generates that in /etc/inc/captiveportal.inc.



  • @cmb:

    @CrisvG:

    (though not for this version)

    That is for that version, 2.0-IPv6 is really 2.1-IPv6 as classified in redmine and as it will be for release. You can edit the file that generates that in /etc/inc/captiveportal.inc.

    Hi ,

    I managed to make it work. Unfortunatly before i read your reaction.

    This is what I did (not sure if its best practise , but it works)

    I have altered the /etc/inc/system.inc file

    Old

    
     if($captive_portal == true) {
                    $lighty_config .= "server.bind  = \"127.0.0.1\"\n";
                    $lighty_config .= "server.port  = {$lighty_port}\n";
                    $lighty_config .= "\$SERVER[\"socket\"]  == \"127.0.0.1:{$lighty_port}\" { }\n";
                    $lighty_config .= "\$SERVER[\"socket\"]  == \"[::1]:{$lighty_port}\" { \n";
    
    

    New

    
     if($captive_portal == true) {
                    $lighty_config .= "server.bind  = \"0.0.0.0\"\n";
                    $lighty_config .= "server.port  = {$lighty_port}\n";
                    $lighty_config .= "\$SERVER[\"socket\"]  == \"0.0.0.0:{$lighty_port}\" { }\n";
                    $lighty_config .= "\$SERVER[\"socket\"]  == \"[::1]:{$lighty_port}\" { \n";
    
    

    This did the job for me. Now the /var/etc/lighty-CaptivePortal.conf file is not overwritten to the "default" settings anytime i make the change there.



  • I had opened a bug report about this on redmine.pfsense.org since i found out as well this.

    The solution might be more involved and can be followed through that ticket.



  • Instead of editing the file and having lighty bind to all addresses you could add a port forward rule to redirect the traffic on the captive portal enabled interface to the localhost.



  • @bardelot:

    Instead of editing the file and having lighty bind to all addresses you could add a port forward rule to redirect the traffic on the captive portal enabled interface to the localhost.

    This is a good idea and I have configured my server for it. I will test it later :-)
    BTW: It seems like the configurations about Hard timeout and Radius host cannot be saved. Every time I return to edit page, it would shown as 60min and empty. Is this a bug?



  • Yeee, the method I mentioned before can work perfectly. :-)
    However, it seems Captive Portal cannot save most configuration. Why? I think I should open a new thread on this.


Log in to reply