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

    NEW Package: freeRADIUS 2.x

    Scheduled Pinned Locked Moved pfSense Packages
    628 Posts 80 Posters 830.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.
    • cmcdonaldC
      cmcdonald Netgate Developer
      last edited by

      I followed this tutorial to the letter:

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

      However, I'm seeing "radtest:: Failed to find IP address for pfSense.localdomain"

      I also see this:

      May 25 05:17:03 radiusd[4072]: Ready to process requests.
      May 25 05:17:03 radiusd[3799]: Loaded virtual server <default>Any ideas?

      Edit: I found that if I add a host override in my dns forwarder, the error goes away. Is this a bug?</default>

      Need help fast? https://www.netgate.com/support

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

        @asterix:

        dumb question here.. I have over 30 network devices and many of them do not have the option for RADIUS authentication as they are physically connected.. for example my Smart TVs, Blu-Ray players, Setop Boxes. etc. Is there a pure MAC only based authentication option in freeRADIUS that I can implement to keep my network secured and not let anyone plug anything new to the network ports unless their MAC is in freeRADIUS database?

        I have this running on PF2.0.3
        Mac auth http://doc.pfsense.org/index.php/FreeRADIUS_2.x_package#FreeRADIUS_Plain-MAC-Auth_with_Captive_Portal
        each device's mac address is entered as a user name.  They all get the same PW.
        It's a bit of work setting it up.
        IE if you have 1 or 2 wireless AP's I found the best way was to add there IP in the pass through page of CP and make a user with the mac address for all the connected devices.
        You can watch the portal auth log for errors and it will show you the mac that's trying to connect. Copy and paste in a new user field.

        Setup  time limits for users (devices) Bandwidth control counter seems to work fine in 2.0.3 with start stop in cp.

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

          @surucu24
          Connection to mysql seems to be ok but it looks like your listening interface is already used.
          Easiest way to configure the listening interface is to create an interface for authentication (1812) and one for accounting (1813) if needed.

          as IP address just use  *  which means all interfaces. This is the best way to make sure that the basic configuration is working.

          @vbman213:

          I followed this tutorial to the letter:

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

          However, I'm seeing "radtest:: Failed to find IP address for pfSense.localdomain"

          I also see this:

          May 25 05:17:03 radiusd[4072]: Ready to process requests.
          May 25 05:17:03 radiusd[3799]: Loaded virtual server <default>Any ideas?

          Edit: I found that if I add a host override in my dns forwarder, the error goes away. Is this a bug?</default>

          The both syslog messages say that the configuration for the server "default" is working and the radius server is running and waiting for requests.

          If radtest is working with IP addresses then radius is working. If it does not wir FQDN then something with your DNS needs to be fixed.

          1 Reply Last reply Reply Quote 0
          • cmcdonaldC
            cmcdonald Netgate Developer
            last edited by

            I am running a virgin installation of 2.0.3 and having this issue, even with using * as the listening interface.

            I installed the package, created a user, created an interface using * as the interface, port 1812 authentication.

            Then I created an client.

            Running radtest testuser testpassword 127.0.0.1:1812 0 testing123 results in the "Failed to find IP address"

            Need help fast? https://www.netgate.com/support

            1 Reply Last reply Reply Quote 0
            • cmcdonaldC
              cmcdonald Netgate Developer
              last edited by

              @Nachtfalke:

              @surucu24
              Connection to mysql seems to be ok but it looks like your listening interface is already used.
              Easiest way to configure the listening interface is to create an interface for authentication (1812) and one for accounting (1813) if needed.

              as IP address just use   *   which means all interfaces. This is the best way to make sure that the basic configuration is working.

              @vbman213:

              I followed this tutorial to the letter:

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

              However, I'm seeing "radtest:: Failed to find IP address for pfSense.localdomain"

              I also see this:

              May 25 05:17:03 radiusd[4072]: Ready to process requests.
              May 25 05:17:03 radiusd[3799]: Loaded virtual server <default>Any ideas?

              Edit: I found that if I add a host override in my dns forwarder, the error goes away. Is this a bug?</default>

              The both syslog messages say that the configuration for the server "default" is working and the radius server is running and waiting for requests.

              If radtest is working with IP addresses then radius is working. If it does not wir FQDN then something with your DNS needs to be fixed.

              Okay, I just confirmed that I found a "bug" in either the package or the documentation for the package. If you only have a WAN interface defined, the tutorial in the documentation does not work.

              Need help fast? https://www.netgate.com/support

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

                Hi vbman213,

                when I wrote the documentation I tested with two interfaces. I don't see actually a reason why it should be different when using just one interface so could you explain what you did different?

                1 Reply Last reply Reply Quote 0
                • cmcdonaldC
                  cmcdonald Netgate Developer
                  last edited by

                  I was lab testing a freeradius deployment on a virtualbox pfsense installation. I only had one interface (WAN) configured from from the post-installation console prompts. The VM actually had two interfaces "installed" but I didn't bother to configure the LAN interface. The WAN interface was configured as a bridge to my physical lan and I just ran pfctl -d to disable the packet filter to create a wildcard rule to allow all traffic into the wan interface. At that point, I followed the tutorial provided in the wiki and received the messages that i posted earlier. After experimenting, I found that the problem involved DNS and upon adding a LAN interface, everything starting working as per the tutorial. Does this help?

                  Need help fast? https://www.netgate.com/support

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

                    Hmm, not sure.

                    Could it be a problem with NAT/PortForwarding on the WAN interface or "block bogons" or "block local IPs" on the WAN interface which could be there bei default!?

                    When you go to freeradius –> view config --> radiusd.conf

                    There you can find some "listening" sections which specify the IP and port freeradius listens to. That means that the switch or wireless-AP must be able to communicate with this IP and port.
                    This shouldn't make any difference if the pfsense is running with one or two interfaces nor as bridge or router.

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

                      Hi!

                      Please help me in resolving the below errors whenever running radiusd -X

                      rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
                      rlm_sql (sql): Attempting to connect to radius@172.16.10.19:3306/radius
                      rlm_sql (sql): starting 0
                      rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
                      rlm_sql_mysql: Starting connect to MySQL server for #0
                      rlm_sql_mysql: Couldn't connect socket to MySQL server radius@172.16.10.19:radius
                      rlm_sql_mysql: Mysql error 'Can't connect to MySQL server on '172.16.10.19' (60)'
                      rlm_sql (sql): Failed to connect DB handle #0
                      rlm_sql (sql): starting 1
                      rlm_sql (sql): starting 2
                      rlm_sql (sql): starting 3
                      rlm_sql (sql): starting 4
                      rlm_sql (sql): Failed to connect to any SQL server.
                      rlm_sql (sql): Processing generate_sql_clients
                      rlm_sql (sql) in generate_sql_clients: query is SELECT id, nasname, shortname, type, secret, server FROM nas
                      rlm_sql (sql): Ignoring unconnected handle 4..
                      rlm_sql (sql): Ignoring unconnected handle 3..
                      rlm_sql (sql): Ignoring unconnected handle 2..
                      rlm_sql (sql): Ignoring unconnected handle 1..
                      rlm_sql (sql): Ignoring unconnected handle 0..
                      rlm_sql (sql): There are no DB handles to use! skipped 5, tried to connect 0
                      Failed to load clients from SQL.
                      rlm_sql (sql): Closing sqlsocket 4
                      rlm_sql (sql): Closing sqlsocket 3
                      rlm_sql (sql): Closing sqlsocket 2
                      rlm_sql (sql): Closing sqlsocket 1
                      rlm_sql (sql): Closing sqlsocket 0
                      /usr/local/etc/raddb/sql.conf[2]: Instantiation failed for module "sql"
                      /usr/local/etc/raddb/sites-enabled/default[185]: Failed to load module "sql".
                      /usr/local/etc/raddb/sites-enabled/default[185]: Failed to parse "sql" entry.
                      /usr/local/etc/raddb/sites-enabled/default[69]: Errors parsing authorize section

                      Thanks & Regards

                      Harsh Kukreja

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

                        (warning ahead I'm not used to configuring FreeRADIUS on pfSense/GUI but rather in plain configs)

                        Anyway: It means that your FreeRADIUS server is trying to connect to a (likely to be) remote MySQL server (172.16.10.19) which it can't connect to.
                        Since you must have configured it for SQL user authentication, it can't start correctly as it can't read a valid list of users from your MySQL server.

                        Try to fix the connection to the MySQL server or disable MySQL authentication/authorization (for test) and try to use local authentication.
                        Are you positive about using SQL for authentication? I only use it for RADIUS accounting and thereafter limiting concurrent access - so
                        that's my real-world use with (Postgre)SQL.

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

                          Hi ,

                          i tried the package with otp and it work's but if client is behind server time (my mobile provider is 30 sec in the past !) i am not able to login (tested with radtest) .
                          worked like a charme with online mtop calculator but never with DroidOTP and "TIME OFFSET 30 or  -30 "
                          Maybe i am doing something wrong but i do not know what.
                          The OTP Passcode from the mobile phone is 30 sec. later the same as the online calc did.

                          Maybe someone can give a hint or maybe minus offset is not possible ….

                          regards

                          max

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

                            @MaxHeadroom:

                            Hi ,

                            i tried the package with otp and it work's but if client is behind server time (my mobile provider is 30 sec in the past !) i am not able to login (tested with radtest) .
                            worked like a charme with online mtop calculator but never with DroidOTP and "TIME OFFSET 30 or  -30 "
                            Maybe i am doing something wrong but i do not know what.
                            The OTP Passcode from the mobile phone is 30 sec. later the same as the online calc did.

                            Maybe someone can give a hint or maybe minus offset is not possible ….

                            regards

                            max

                            Hi,

                            Did you calculate the Epoch-Time?
                            1. Write down the first 9 digits of the Epoch-Time on the client.
                            2. Check with date +%s the Epoch-Time on your FreeRADIUS server and write down the first 9 digits.
                            3. Subtract both values, multiply the result with 10 and enter the value in this field. (Default: 0)

                            But in general it should not neccessary to change this if your mobile device changes its timezone automatically.

                            Further you can try increasing the "OTP Lifetime" in freeradius –> settings.
                            You can set it to 6 which means 60s. Even if the mobile clients always generate new keys every 30s it should be possible to use a generated key 60s instead of just 30s.

                            The more you increase this time the more "insecure" OTP will become. Probably noone will get access with a key (without PIN) which has a lifetime of a few minutes.

                            ---- edit ----
                            You are right. The script does not accept negative values. You could modify the script here:
                            freeradius.inc
                            line 4027
                            replace:

                            EPOCHTIME=`expr \$EPOCHTIME + \$OFFSET`
                            

                            with

                            EPOCHTIME=`expr \$EPOCHTIME - \$OFFSET`
                            

                            Could be something what should be added to the GUI.

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

                              Hi,

                              yes i calc the epoch time like descript on the web interface:
                              (9digits (from left client time)  - 9digit (from left server time)) *10 = -30

                              date +%s = 10digits, so why the hell not taking  (10digits (from left client time) - 10digits (from left server time)) = 30 ?? (or if 39 nearer 40 than 30 !!)

                              It's not a problem of the timezone it's a mobile provider problem; the android is 30 sec in the past.
                              (Is the offset 1 equal 1 hour, i hope not.)

                              If i set the lifetime on server side  higher than on the client (DroidOTP is fixed to 10 sec lifetime) than i had guess/try 6 keys maybe on is working not a good idea.

                              I know to solve the problem with manual set the client time but i want to find out how it work with time offset and maybe there is a bug or a wrong hint on the webinterface

                              regards max

                              –----edit----
                              The Gui save the Offset in the right way:

                              /usr/pbi/freeradius-i386/etc/users

                              "otpuser" Auth-Type = motp
                              MOTP-Init-Secret = 912ae1361854139e,
                              MOTP-PIN = 1234,
                              MOTP-Offset = -30

                              Use Freeradius teh otpverify.sh script ? If yes then there is the faulty part

                              OFFSET=echo -n "$5" | sed 's/[^0-9]/0/g'
                              [[/sub]
                              -10 is then 010….
                              should be

                              OFFSET=echo -n "$5" | sed 's/[^0-9-]/0/g'

                              but is a little be dirty could also be 1-0 …..

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

                                @MaxHeadroom:

                                Hi,

                                yes i calc the epoch time like descript on the web interface:
                                (9digits (from left client time)  - 9digit (from left server time)) *10 = -30

                                date +%s = 10digits, so why the hell not taking  (10digits (from left client time) - 10digits (from left server time)) = 30 ?? (or if 39 nearer 40 than 30 !!)

                                It's not a problem of the timezone it's a mobile provider problem; the android is 30 sec in the past.
                                (Is the offset 1 equal 1 hour, i hope not.)

                                If i set the lifetime on server side  higher than on the client (DroidOTP is fixed to 10 sec lifetime) than i had guess/try 6 keys maybe on is working not a good idea.

                                I know to solve the problem with manual set the client time but i want to find out how it work with time offset and maybe there is a bug or a wrong hint on the webinterface

                                regards max

                                –----edit----
                                The Gui save the Offset in the right way:

                                /usr/pbi/freeradius-i386/etc/users

                                "otpuser" Auth-Type = motp
                                MOTP-Init-Secret = 912ae1361854139e,
                                MOTP-PIN = 1234,
                                MOTP-Offset = -30

                                Use Freeradius teh otpverify.sh script ? If yes then there is the faulty part

                                OFFSET=echo -n "$5" | sed 's/[^0-9]/0/g'
                                [[/sub]
                                -10 is then 010….
                                should be

                                OFFSET=echo -n "$5" | sed 's/[^0-9-]/0/g'

                                but is a little be dirty could also be 1-0 …..

                                Did you read what I wrote about the part on the freeradius.inc ?

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

                                  Yes i did.

                                  But if i do it like you said then the offset is always minus.

                                  In freeradius.inc
                                  there is the same 'sed'  in line 4006:

                                  OFFSET=echo -n "\$5" | sed 's/[^0-9]/0/g'

                                  regards max

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

                                    @MaxHeadroom:

                                    Yes i did.

                                    But if i do it like you said then the offset is always minus.

                                    In freeradius.inc
                                    there is the same 'sed'  in line 4006:

                                    OFFSET=echo -n "\$5" | sed 's/[^0-9]/0/g'

                                    regards max

                                    Hi max,

                                    can you please replace the following two files and try again if it works now?
                                    You now have to enter  + 30    oder    - 30
                                    It is described on the GUI.

                                    freeradius.inc.txt
                                    freeradius.xml.txt

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

                                      Hi,
                                      sorry for the long delay. Your scripts are not working. I did some investigation on EPOCHTIME and extend the freeradius.inc with some logs.
                                      I found out that the Offset 1 is equal to 10 sec (not like descripted on the webif)  because the use of 9 digit and not 10.
                                      I changed only
                                      OFFSET=echo -n "\$5" | sed 's/[^0-9-]/0/g'

                                      and add 2 logging lines
                                      Jun 14 16:11:10 root: FreeRADIUS:Server - Client EPOCHTIME: 137121900
                                      Jun 14 16:11:10 root: FreeRADIUS:Server EPOCHTIME: 137121905 ClientOffSet:-5 oder -5

                                      regards Max

                                      freeradius.inc.txt

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

                                        @MaxHeadroom:

                                        Hi,
                                        (…)
                                        I found out that the Offset 1 is equal to 10 sec (not like descripted on the webif)  because the use of 9 digit and not 10.
                                        (...)

                                        I think you are wrong:

                                        3. Subtract both values, multiply the result with 10 and enter the value in this field.

                                        If your result is 2 then you need to multiply with 10 (2*10=20) and then you get the seconds.

                                        But you are right, the script is not working. adding "+" or "-" in the freeradius users file causes problems.

                                        At the moment I do not have an idea how to solve the problem with negatgive offset.
                                        Perhaps starting with a negative offset of -11h as default value so that the user needs to add +11h to get the actual default offset of 0.

                                        The script is based on this:
                                        http://motp.sourceforge.net/

                                        –-- edit ----
                                        Ok, I changed the script to start per default with an offset of -12h. If someone is in a timezone which is -12h then the GUI value will be 0.
                                        If someone is on timezone 0h then the GUI value must be 720.

                                        You can try with the two config files.

                                        PS: You need to re-enable m-OTP on settings first after adding the new files so that otpverify.sh will be rubuild.

                                        freeradius.inc.txt
                                        freeradius.xml.txt

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

                                          Hmpf - again new files. Please try these ;-)

                                          freeradius.inc.txt
                                          freeradius.xml.txt

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

                                            Hi Nachtfalke,

                                            i think you misunderstood me; it works with my 'patch'
                                            i have to set offset to -5 because of 50 sec time diff  (not -50 like suggest in on the webIF)

                                            see motp.sourceforge.net
                                            Enter "date +%s" on the server to display the current time in epoch notation. Write down the first 9 digits of the output.
                                            Subtract both values. The result is the offset in 10s of seconds, i.e. an hour would be 360, two hours 720, etc.
                                            The offset has to be configured in the "users" file of the RADIUS server for the specific user (Offset-Attribute).

                                            sorry for my english, my german is better….

                                            I have some idea to add more security to the radius otp:    motp+yourpassword  (without plus-:) would be great to have (like professional token have).

                                            regards max

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