Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Does FreeRadius allow voucher creation?

    Scheduled Pinned Locked Moved Captive Portal
    3 Posts 2 Posters 503 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Dmc
      last edited by

      Might be a silly question - is voucher creation limited to LocalServer or do we have the option in FreeRadius

      Thank you!

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @Dmc
        last edited by

        @dmchavoc

        Vouchers are login codes that are created in a set. The set defines the duration of the codes it contains.
        As soon as a code is sued and validated, it's marked as 'activated' and the counter, defined by the set starts running.
        When the time is up, the voucher is marked as used, and can no longer be used.

        When you activate vouchers in pfSense, you can see a third line showing up on the captive portal login page, that is the place to enter the voucher code. It is advisable to create your own 'html' login page, so only the voucher code is requested from the portal user.

        If you make you html (php) login page, you could omit to show up the password text field, and in the code hard code it to for example "123456".
        Just leave the "User name" and rename it "Voucher".

        Now you can use FreeRadius, and set up a user :

        74386810-ec46-40bc-9b43-a250fb307b42-image.png

        ( the password is also set to 123456 here)

        and pick the time setting you want :

        0b00de48-6885-4d19-ab10-9e6e099f13b8-image.png

        As soon as the Voucher code "Voucher-code-secret" is used, the user can spend 30 minutes online before he gets kicked of the portal for this month. (The Forever option gave me errors ...)
        You, as the admin, you generate new and cleanup old "voucher" codes for example;ones a month.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        D 1 Reply Last reply Reply Quote 0
        • D
          Dmc @Gertjan
          last edited by

          @Gertjan said in Does FreeRadius allow voucher creation?:

          activate vouchers in pfSense, you can see a third line showing up on the captive portal login p

          Thank you @Gertjan, at first this went little over my head but your solution is genius.

          It is all about perspective, essentially hard-coding the password into the code and renaming the field name from user to voucher. This is great approach.

          I am going to think about this a little more to fine-tune it further.

          To give you some insight, I am essentially operating a coworking space with about 250 users. Ideally, I would like to give each user their unique credentials which i would like to expire and only renewed once i receive subsequent months payment.

          Users are restricted to two devices (hence Radius) but it seems like a hasttle having to manually update their exprations. I thought perhaps i can mass print my vouchers in advance and distribute them as soon as payment is received.

          However, vouchers are not expired by date, rather time and do not allow machine limitations.

          Back to the drawing board.... seems like ill have to take the bullet for this administration task.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.