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

    CaptivePortal with freeradius + mysql: Max-Daily-Session

    Scheduled Pinned Locked Moved Captive Portal
    32 Posts 7 Posters 24.5k 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.
    • R
      Rampage
      last edited by

      it's not enaugh to set the limit on the radius server, you also need to enable the feature on the NAS (captive portal setup) leaving fields empty.

      Then the captive portal will refer to the values specified in radcheck or radgroupcheck in your mysql database.

      the operator is :=

      sorry if i took that long to reply, but it's been a while since i last visited the forum :)

      1 Reply Last reply Reply Quote 0
      • A
        asura
        last edited by

        in sorry if im asking something silly ..

        it is possible to set an 'airtime' for every voucher? using CP or maybe thru freeradius?
        for example user will able using 30minutes for surfing and download within 2 days.

        scenario example, user using 5 minutes and then log out. login again for 10 minutes more.
        user keep going login and logout for 2 days until his time limit reach 30 minutes as i set.
        in this case user will have 2 days 'airtime' and 30 minutes quota of time (time limit)

        sorry for my bad english ..thanks in advance to everyone

        1 Reply Last reply Reply Quote 0
        • E
          eri--
          last edited by

          You need a radius server of sorts for that.

          1 Reply Last reply Reply Quote 0
          • A
            asura
            last edited by

            im installed freeradius2. after looked around for a few hours inside freeradius2.
            kill some of my times google around but i found nothing similar to what i need

            i managed to create username and password. set a limit and quota for each of them.
            but what i need is user only able to access using generate voucher without a username.
            for example:
            voucher package 1 : 30 minutes quota within 1 day (24hours) time limit(airtime)
            voucher package 2 : 1440 minutes quota within 3 days (72hours) time limit(airtime)

            im sorry if im asking to much, im very new with pfsense but im willing to learn more.
            i still do not have any idea what to do and where to start ..pls link me to any tutorial
            thanks

            1 Reply Last reply Reply Quote 0
            • N
              Nachtfalke
              last edited by

              http://doc.pfsense.org/index.php/FreeRADIUS_2.x_package

              1 Reply Last reply Reply Quote 0
              • A
                asura
                last edited by

                @Nachtfalke:

                http://doc.pfsense.org/index.php/FreeRADIUS_2.x_package

                i already read that and still i cant find the way to solve my problem..
                anyway thanks for ur kind reply

                1 Reply Last reply Reply Quote 0
                • N
                  Nachtfalke
                  last edited by

                  @asura:

                  @Nachtfalke:

                  http://doc.pfsense.org/index.php/FreeRADIUS_2.x_package

                  i already read that and still i cant find the way to solve my problem..
                  anyway thanks for ur kind reply

                  The quota and limit functions only work with username/password.
                  The problem is that username/password is stored on freeradius2 users file and the vouchers are stored on the CP itself.

                  And if you enable RADIUS authentication and CP with vouchers there is a bug in CP that if you enable "re-aithenticate every minute" on CP the CP sends the voucher code as username to the RADIUS server and the RADIUS server of course does not know this "user".
                  I described this here:
                  http://redmine.pfsense.org/issues/2155

                  So I would say it is only possible to use voucher which has time limit or you use username/password which could have time limit and/or quota.

                  1 Reply Last reply Reply Quote 0
                  • A
                    asura
                    last edited by

                    u mean there is no way for voucher on CP to work together with freeradius?

                    after time limit reached. My costumer need to get new ticket/voucher to relogin via CP.
                    i think it is impossible to create hotspot for making money using freeradius  ;D

                    1 Reply Last reply Reply Quote 0
                    • N
                      Nachtfalke
                      last edited by

                      @asura:

                      (…)
                      i think it is impossible to create hotspot for making money using freeradius  ;D

                      This statement is right if you focus on the freeradius2 package offered for pfsense.
                      but it is wrong if you use CaptivePortal from pfsense with another radius solution like daloradius or something else which focus on such things like "making money" and do accounting in this way.

                      the freeradius2 package on pfsense is more a security tool within a company or at home to secure your wireless network, your company LAN or VPN with One-Time-Password.

                      You have to find the best solution for your needs :-)

                      1 Reply Last reply Reply Quote 0
                      • A
                        asura
                        last edited by

                        @Nachtfalke:

                        the freeradius2 package on pfsense is more a security tool within a company or at home to secure your wireless network, your company LAN or VPN with One-Time-Password.

                        You have to find the best solution for your needs :-)

                        thankss ..i have noticed that.
                        mayb i need to put it on try and see how its gonna be.  ;)

                        1 Reply Last reply Reply Quote 0
                        • N
                          Nachtfalke
                          last edited by

                          Yeah, or just improve the freeradius2 code and put in some more features  ;)

                          1 Reply Last reply Reply Quote 0
                          • X
                            xbipin
                            last edited by

                            can some1 provide me the mysql schema with some sample data to use captive portal with freeradius2 on pfsense using alix and an external mysql db as im about to develop a whole web GUI in php which can be used to edit the mysql db directly without phpmyadmin etc making life easier for many such as creating new users, editing them, creating data transfer based recharges etc

                            1 Reply Last reply Reply Quote 0
                            • N
                              Nachtfalke
                              last edited by

                              
                              /usr/local/share/examples/freeradius/raddb/sql/mysql
                              /usr/local/etc/raddb/sql/mysql
                              
                              

                              These schemes come with freeradius. I think it will help you.

                              Or take a look here at chapter "Populating MySQL"
                              http://www.frontios.com/freeradius.html

                              1 Reply Last reply Reply Quote 0
                              • X
                                xbipin
                                last edited by

                                is the schema same as for freeradisu2 package for pfsense as i need it for the package which is available for pfsense

                                1 Reply Last reply Reply Quote 0
                                • perikoP
                                  periko
                                  last edited by

                                  Rampage, looks like u setup captive portal+freeradius2 and u can disconnect user based on time right?

                                  If so, may u could show me some light here, could u please read my post:

                                  http://forum.pfsense.org/index.php/topic,54923.0.html

                                  I got issue trying to make this setup works, for some reason FR2 disconnect my users before time.

                                  I my post I got all the info, any input will be appreciated, I got weeks trying to setup this.

                                  Thanks!!!

                                  Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
                                  www.bajaopensolutions.com
                                  https://www.facebook.com/BajaOpenSolutions
                                  Quieres aprender PfSense, visita mi canal de youtube:
                                  https://www.youtube.com/c/PedroMorenoBOS

                                  1 Reply Last reply Reply Quote 0
                                  • perikoP
                                    periko
                                    last edited by

                                    Hi.

                                    I setup freeradius 2.x on a Centos server 5.x and setup PF->CP for this server, the counter is not working either, I was thinking that maybe this could solve the issue but no.

                                    Does this is related to pfsense CP module?

                                    Thanks!!!

                                    Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
                                    www.bajaopensolutions.com
                                    https://www.facebook.com/BajaOpenSolutions
                                    Quieres aprender PfSense, visita mi canal de youtube:
                                    https://www.youtube.com/c/PedroMorenoBOS

                                    1 Reply Last reply Reply Quote 0
                                    • N
                                      Nachtfalke
                                      last edited by

                                      @xbipin:

                                      is the schema same as for freeradisu2 package for pfsense as i need it for the package which is available for pfsense

                                      freeradius2 for pfsense is the same code as from freeradius.org. The only difference is that we have a GUI on pfsense.
                                      Everything else is the same.

                                      @periko:

                                      Hi.

                                      I setup freeradius 2.x on a Centos server 5.x and setup PF->CP for this server, the counter is not working either, I was thinking that maybe this could solve the issue but no.
                                       
                                      Does this is related to pfsense CP module?

                                      Thanks!!!

                                      Hi periko,
                                      I think if it is not working with pfsense freeradius and not working with a standalone server that the problem must be the pfsense CaptivePortal.

                                      You should open a bug report on:
                                      https://redmine.pfsense.org/

                                      And post on the pfsense developer mailing list so that can be fixed on future versions of pfsense.

                                      1 Reply Last reply Reply Quote 0
                                      • perikoP
                                        periko
                                        last edited by

                                        I will open 1 ticket, thanks Nachtfalke.

                                        Necesitan Soporte de Pfsense en México?/Need Pfsense Support in Mexico?
                                        www.bajaopensolutions.com
                                        https://www.facebook.com/BajaOpenSolutions
                                        Quieres aprender PfSense, visita mi canal de youtube:
                                        https://www.youtube.com/c/PedroMorenoBOS

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