Captive Portal Voucher Support

  • Hi !

    Is it possible to integrate the voucher feature in monowall 1.3 beta also in pfsense ??


  • I also hope this will come true!

    I have try to use the vouchers file in m0n0 wall in pfsense! But failed to create the vouchers!

  • Ne1 found a solution ?

    the only reason why i have to use mono is because of the voucher system. Is there an easy way to migrate that feature to pfsense ?

  • Has anyone attempted to bring the voucher system over to pf 2.0? are there any plans to add this feature?

    Im trying to do this at the moment, but its messy and im trying to clean it up as much i can, if anyone else is interested in this, they can help out.

    A list of file names are here and the sourcecode here

    I havent accomplished much, so far I only have it included in the cp menu, so that its showing up on the gui, someone reported in this thread it didnt work for them, did you compile the voucher.c file?

    I think this is a nice feature to add to pfsense 2.0


  • :D Youre a genius!

    Thank you very much, I was making slow progress and my coding skills are 0, but atleast I got the chance to see how the inner workings of pfsense  ;D

    I have sent small donation, not much but give me a chance, Im in the middle of buying some equipment, once I have some loose cash, Ill top you up.

    Thanks once again, Ill try the next snapshot when its available.


  • ermal that would be great. Im willing to donate if your work is finnished.

    keep up

  • This work is finished.
    It is present in 2.0 snapshots if you want to use it.

    The captiveportal now is even multi-interface capable in 2.0 so what you need more :)

  • Hello Ermal,

    I found a few bugs.

    Im testing on fresh install "2.0-ALPHA-ALPHA built on Sat Jun 20 17:00:01 EDT 2009 FreeBSD 7.2-RELEASE-p1".

    1: I have uploaded a "Portal page contents" with the new required fields, as the captive portals default index.php doesnt have those details yet.

    2: Ive set up captive portal correctly and generated a few codes, when I launch the browser, I get redirected to my login screen as expected, however, after entering the access codes and hiting return I get the following error.

    Fatal error: Call to undefined function voucher_auth() in /usr/local/captiveportal/index.php on line 127

    I fixed this by adding "require_once("");" to "/usr/local/captiveportal/index.php"

    3: Once Im authenticated, the redirect page appears with an error and the redirect url appended to it.

    Warning: fopen(): Filename cannot be empty in /etc/inc/ on line 165 Redirecting to…

    This one is way over my head and I couldnt work out the code in to find a fix  :P

    Apart from the above 3 small issues, it seems to be working great so far.



    EDIT: also on "Status" > "Captive Portal" > "Active Vouchers" an error appears in the "Activated at" row with "Warning: date() expects parameter 2 to be long, string given in /usr/local/www/status_captiveportal_vouchers.php on line 106" which in turn screws up the next 2 rows across named "Expires in", "Expires at", both these values show up as "1225474073 min" and "10/12/2025 06:51:28"  :o :D I initially had created 10 x 360 mins codes and was testing with one of them.

    The rest of the captive portals status pages work fine.


  • This is awesome.  I know many have been waiting for multi-wan captive portal functionality for a long time.  Many thanks to the development team on this one.

    One question I have is if the traffic shaping feature will work with the multi-want captive portal?

  • You have the shaping of CP and it will work on multi-wan.
    Or you are asking the traffic shaper of pfSense itself and not that of the CP?

  • I just want to say thank you for this great feature! I've switched from m0n0wall because vouchers are now available in pfsense. Works great for cafe hotspots, offering free Wi-Fi access to their customers - no more leeching neighbors.

    I can report a bug with the error page, after it's accessed, the redirect to the original page is lost. I'm using custom html files, but they are the same from m0n0wall, which didn't exhibit this problem.

  • Is this working with version built 090910 ?

    not working for me anyway
    if i choose "no authentication" everyone can login and other choises noone can login..ideas?


  • Is the voucher system that's being introduced to pfSense the same time based system as I don't have a whole lot of funds but do you think a data based voucher option would be a feasible addition to this project if I were to start a bounty to that effect?

  • You can start the bounty with the specification and see the feedback.

  • @rhy7s:

    Is the voucher system that's being introduced to pfSense the same time based system as I don't have a whole lot of funds but do you think a data based voucher option would be a feasible addition to this project if I were to start a bounty to that effect?

    The pfSense (2.0) voucher is the same as the m0n0wall one. But there are probably still some bugs. Saving the captive portal settings don't log the users out, and killing the user's session doesn't seem to work very well. I also ran into a problem where I was playing with the voucher's code length and complexity and it somehow corrupted my entire voucher database.

    I didn't seem to have such problems in m0n0wall.

  • I fixed some small issues here and there so retry with next snap.

    Just next time report on the 2.0 forum the steps to reproduce your problems.

  • To be clear in advantage:
    I'm sorry but I am a complete Noob on linux.

    I would like to use the 1.2.3 captive Portal but need Vouchers.

    I've tested the 2.0-Alpha-Alpha but its a little bit too Alpha for my taste.
    (Hang in CP when enabling, result in no reaction, freezing etc…
    thats why its alpha but not suitable for use in a non testing area)

    I want to use vouchers to limit the free access to about twenty minutes or halve an hour to keep neighbors and schoolkids out.

    I've read the Commitments linked in this Topic but have no clue how to Add the Voucher Support on 1.2.3
    As I stated above I'm a noob on this.
    Is there an packet available wich adds the voucher support to the 1.2.3?
    Or can someone give me a clue howto add this by myself?

    Thanks in advance

  • I've also recently installed the 1.2.3 and am interested in vouchers.
    Is there any tool (apart from the 2.0 Alpha) that can allow time based vouchers generation from a computer in the LAN other than the pfsense box itself?

  • You could set up a RADIUS server on which users are generated with a expire time.
    Set the captive portal to authenticate against this RADIUS server and enable the option to reauthenticate every minute (might require some decent hardware if you want to do that for a large number of users).

Log in to reply