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

    Captive Portal - Voucher valid on the first device

    Scheduled Pinned Locked Moved Captive Portal
    5 Posts 4 Posters 2.4k 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.
    • M
      marcelopadilha
      last edited by

      Hi

      Whe are using PFSense to control internet access on the hospital.

      The vouchers are issued to patients at the hospital admission.

      We know that employees copy vouchers and use the Internet when they should be working.

      Question: How to make the voucher is only valid on the first device that is used?

      Thanks

      Marcelo Padilha

      1 Reply Last reply Reply Quote 0
      • C
        Chrismallia
        last edited by

        Did you try

        Disable concurrent logins
        If this option is set, only the most recent login per username will be active. Subsequent logins will cause machines previously logged in with the same username to be disconnected.

        1 Reply Last reply Reply Quote 0
        • C
          Chrismallia
          last edited by

          also try

          Enable Pass-through MAC automatic addition with username

          it should bind the user/Vouchers to the mac

          1 Reply Last reply Reply Quote 0
          • S
            sebastiannielsen
            last edited by

            Try this:
            For the voucher time limit (when creating roll), set 1 minute. (so the voucher is almost immediately invalid after using up, making each voucher single use).
            Then set a hard time limit (session time limit) of how long you want the users to be able to access the internet. (Eg, if you want to give patients 6 hours of internet, set hard timeout to 360).

            This would then mean you can enter the voucher at login, then its "spent", and the user may surf the internet for 6 hours. If the user logout prior to this, then the time left is forfeit.

            More info here (see section "Troubleshooting" about "users still active after voucher expire"):
            https://doc.pfsense.org/index.php/Captive_Portal_Vouchers

            You need to test it however that it works the way you want, since there have been changes between the versions of pfSense.

            –---

            If this doesn't work, I would suggest creating a custom authentication page, that contains code to also mark each voucher as "spent", so each voucher code can only be used once. This can be done efficently by having all valid vouchers in a list, and deleting vouchers as they become spent.

            1 Reply Last reply Reply Quote 0
            • M
              MohamedMagdi
              last edited by

              Thanks sebastiannielsen, but this solution wont let me change the voucher time so all vouchers will be expired after "Hard timeout" period i just wanted to make vouchers with various amount of times
              so isn't there any other solution ??

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