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

    How to Captive Portal Self Registration Using Free radius & Mysql (Tutorial)

    Scheduled Pinned Locked Moved Captive Portal
    59 Posts 28 Posters 148.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.
    • W
      whoei
      last edited by

      After replacing 127.0.0.1 for 192.168.100.1 @ radius settings by captive portal and nas /client en interface settings by FreeRadius it works!

      Is there any solution that multiple users can register from one PC without changing the mac address in DirectAdmin?

      1 Reply Last reply Reply Quote 0
      • H
        harshkukreja
        last edited by

        @khan:

        @sash99

        I have tested your config in vmware 9 environment with 2.0.2-RELEASE (i386). what i did
        1. installed pfsense.
        2. installed mysql & vhost according to your post.
        3. installed php52-mysql as i mentioned before.
        4. installed free radius2.
        5. config them all
        6. uploaded all the captive portal file.

        but everything seems ok for me. i can register & data also available in database.

        if u are interested i can upload the vmware image.

        sorry to mention before….. i file (main css "bootrtrap.min.css") missing in my captiveportal file list, for which design was not perfect. added in this post.

        can any moderator would be kind to attach this file in my main post please??

        Hi! Please help us with the vmware image to test..Thanks Harsh

        1 Reply Last reply Reply Quote 0
        • K
          khan
          last edited by

          @whoei:

          After replacing 127.0.0.1 for 192.168.100.1 @ radius settings by captive portal and nas /client en interface settings by FreeRadius it works!

          Is there any solution that multiple users can register from one PC without changing the mac address in DirectAdmin?

          sure edit captiveportal-cp_reg_suc.php remove mac chek code.

          Hi! Please help us with the vmware image to test..Thanks Harsh

          ok need some time.

          1 Reply Last reply Reply Quote 0
          • K
            kmnair
            last edited by

            @khan:

            @whoei:

            Is there any solution that multiple users can register from one PC without changing the mac address in DirectAdmin?

            sure edit captiveportal-cp_reg_suc.php remove mac chek code.

            It would be better to change the mac-check to mail-check since this will help many users register from the same machine, but with one mail ID per single user. This will prevent multi-registrations from the same mail ID.

            I have done this with pfSense 2.1 beta1 and it works well.

            I am trying to get the hostname also collected through the registration page.  But this does not work as expected.

            Also, is it possible to ask users to register and send the login-password to them through the e-mail ID collected.

            Khan, could you help please?

            Thanks for your time.

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

              please help

              after step 1, is the packages are installed via the WebGUI? Which packages?
              why when I execute step 2  /etc/rc.php_ini_setup with Shell Execute command, WebGUI in my browser not stop loading (does not produce anything)?

              thank's

              1 Reply Last reply Reply Quote 0
              • E
                eowyn36
                last edited by

                I just get this working !! It can register users, there seems to be no problem with it.

                @khan you were right about the writing privileges that you mentioned on the first page. After I gave every permission to 'radius' user vi phpMyAdmin everything worked like a charm :)

                @afry it is bit tricky to install everything. Can you check this post i think it can help you :)
                http://forum.pfsense.org/index.php/topic,62456.msg344907.html#msg344907

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

                  Thank you very much for your tutorial.

                  Got it working. Still missing some functionality but I guess I have to read the correct manuals.

                  a question for example:
                  How do you see who is online, and how to disable or throw them out?

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

                    I can´t figure out how to access phpmyadmin so i can proceed with step 2 "add for sql support"
                    probably a silly question but how can i

                    1 Reply Last reply Reply Quote 0
                    • P
                      Prakash
                      last edited by

                      Hi EveryOne,
                      Thanks to Khan,
                      I'm very much new to pfSense.
                      But I've Experimented your VMImage.
                      The Following Feature I've Implemented in Captive Portal.
                      1. Self Registration By User, The User Id is user's Mobile No.
                      2. System Generates the Password & Send to Registered Mobile No as SMS.( I prefer to use Mobile No as User may not be able to access Email).

                      I request to all for the guidance to implement following feature:
                      1. How the Validity of the Password can be Control.
                      2. System Logout Popup Window is not Open.
                      3. can Both Voucher & Radius Authentication Implemented at a time.
                      4. Is there any process to send user the Voucher No.
                      5. Is there any process to extend the validity of voucher/password.

                      Thanks in advance.
                      Prakash

                      1 Reply Last reply Reply Quote 0
                      • H
                        harshkukreja
                        last edited by

                        Hi! Khan

                        Thanks for your wonderful work which I was looking for a long time to add into my pfsense machine which I am using for providing Internet access to students in university. I ll really appreciate if you can help me with the working VMware image to enable me to test the same.

                        Regards

                        Harsh
                        harshkukreja2008@gmail.com

                        1 Reply Last reply Reply Quote 0
                        • K
                          Kababayan
                          last edited by

                          Hi Khan,
                          Tnx for your How to .. It workd perfectly on VM pfsense 2.1 with external sql from WAMP package. I just added some previlages to radius user to be able to write the whole sql, also replace email as login with username as login. I would like to add some time limit and session timout for this users how can i add it to the sql in order to successfully get accounting.

                          1 Reply Last reply Reply Quote 0
                          • K
                            Kababayan
                            last edited by

                            I was able to add time limit (Max-Forever-Session := xxxx sec)  to the users registered in captiveportal-cp_registration_form.php however Session-Timeout := xxx does not work. Just wanted those free users to force logout ever 5 min with 1 hour free time.

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

                              @Kababayan:

                              I was able to add time limit (Max-Forever-Session := xxxx sec)  to the users registered in captiveportal-cp_registration_form.php however Session-Timeout := xxx does not work. Just wanted those free users to force logout ever 5 min with 1 hour free time.

                              Did you enable session-timeout on CP GUI?

                              1 Reply Last reply Reply Quote 0
                              • K
                                Kababayan
                                last edited by

                                @Nachtfalke:

                                Did you enable session-timeout on CP GUI?

                                Yes I did check Session-Timeout(se RADIUS Session-Timeout attributes). I'll try to remove it and see what will happen.

                                1 Reply Last reply Reply Quote 0
                                • K
                                  Kababayan
                                  last edited by

                                  Okey it's working now. Time limit goes to radcheck while session timeout and idle time should go to radreply.
                                  In CP check Session Timeout. I use interim update. Tried checking and unchecking in CP's  Reauthenticate connected users every minute both are working fine with Interim, haven't tested in Stop/start yet.
                                  I will test other setting like Bandwidth-Max-Up/Down, Simultaneous-Use, Amount of Download and Upload Traffic.

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

                                    @Kababayan:

                                    Okey it's working now. Time limit goes to radcheck while session timeout and idle time should go to radreply.
                                    In CP check Session Timeout. I use interim update. Tried checking and unchecking in CP's  Reauthenticate connected users every minute both are working fine with Interim, haven't tested in Stop/start yet.
                                    I will test other setting like Bandwidth-Max-Up/Down, Simultaneous-Use, Amount of Download and Upload Traffic.

                                    Hi Kababayan!
                                    Did you have sucess?
                                    I have about 3000 users working fine on pf213x64, thanks for all in this topic (and others too).
                                    My only problem is with Max-Daily-Session, i can´t make it work!
                                    i´m disconected after time, but i can relogin. I Think because is the timeout function only, not a max-daily-session.
                                    In radius db, only the tables radcheck,radgroupcheck, radpostauth, radusergroup and reg_user have data, the others have nothing, is normal?

                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      dimoz
                                      last edited by

                                      Hi.
                                      I have configured pfsense + captiveportal + freeradius + mysql + vhosts.
                                      i would like to permit users to change their own password through a web page stored in pfsense.

                                      i have created a table in "radius" db named "resetpsw" with 2 column: "username" and "reset". every user in "radcheck" table has a record in this table with the corresponding username and a "reset" value set to "0" or to "1" to force him to reset the password. (I manually change the value in the db to force him to reimputate a new password)

                                      My problem now is to insert the correct code in the captiveportal login page to check, before authenticate him, if the username has the "reset" value to "1" and redirect him to the reset password page.
                                      Any suggestions?

                                      thanks

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

                                        @khan:

                                        Caution : this procedure was perfect for me. Please use at your own risk & make backup.

                                        You need few thing to do this

                                        step 3

                                        now rename every file & remove “.txt” from file name ie

                                        captiveportal-cp_reg_suc.php.txt to captiveportal-cp_reg_suc.php
                                        captiveportal-bootstrap.min.css.txt to captiveportal-bootstrap.min.css

                                        and so …

                                        now edit
                                        captiveportal-cp_reg_suc.php in line 104 insert your sql server ipaddress & password.

                                        Upload evry file in captive file manager except
                                        cp_portal.php
                                        cp_error.php

                                        Hi,

                                        I don't know how to access the files mentioned in step 3. Where can I find those files?

                                        Thanks
                                        sbb

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

                                          @sbb:

                                          @khan:

                                          Caution : this procedure was perfect for me. Please use at your own risk & make backup.

                                          You need few thing to do this

                                          step 3

                                          now rename every file & remove “.txt” from file name ie

                                          captiveportal-cp_reg_suc.php.txt to captiveportal-cp_reg_suc.php
                                          captiveportal-bootstrap.min.css.txt to captiveportal-bootstrap.min.css

                                          and so …

                                          now edit
                                          captiveportal-cp_reg_suc.php in line 104 insert your sql server ipaddress & password.

                                          Upload evry file in captive file manager except
                                          cp_portal.php
                                          cp_error.php

                                          Hi,

                                          I don't know how to access the files mentioned in step 3. Where can I find those files?

                                          Thanks
                                          sbb

                                          …just saw I can download the files. Wasn't logged in so i couldn't see them.

                                          1 Reply Last reply Reply Quote 0
                                          • G
                                            gbrace
                                            last edited by

                                            Hi Guys,

                                            i was introduced to pfsense by a friend of mine a few months ago and it resulted very helpfull and an awesome system.
                                            I have checked this post because i have a project same as the subject in this post.
                                            As most of you, i am trying to implement this VM posted in here. As i tested it i saw the captive portal site for self-registration and i am trying to make it a little bit different from the configuration done till now.
                                            What i'm lookin for is a self-registration with sms, a user can just put his phone number and name in the captive portal and the system after recieving this number it has to generate a password ( perhaps with voucher ) and send that code to the user to get access in internet. I want this because i have seen that most of the people that uses free wifi with self-registration puts fake informations at the captive portal so with the SMS i can minimize this fake users with fake ID's .
                                            If any one has an idea please provide some cause i'm stuck at the auto-generation codes after recieving phone number.
                                            Oh as for the implementation posted in here i'll finish testing it and for sure i'll give a feedback.

                                            Thanks in Advanced.

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