gremigio
Goto Top

Freeradius Y MYSQL

Hello,

I am working with freeradius and MYSQL. My goal is to authenticate users through the radius server with my users' database in mysql. I already have all the users created in mysql but when I try to establish an authentication I get the error that freeradius cannot establish the connection with the database.

Content-ID: 669785

Url: https://administrator.de/contentid/669785

Ausgedruckt am: 26.11.2024 um 17:11 Uhr

NordicMike
NordicMike 26.11.2024 um 16:42:22 Uhr
Goto Top
By default the MySQL Database is accepting local queries only. You have to grand privileges to the user@% (all localtions), then your radius server is not at the same computer like the database. If its a windows MySQL server then the TCPIP protocol is disabled by default in the MySQL server settings.
Gremigio
Gremigio 26.11.2024 um 16:52:10 Uhr
Goto Top
In my case I have freeradius and mysql, the same Ubuntu operating system, and I have given all rights to the database.

When I perform the test from safe mode this is what I have
screenshot 2024-11-26 114911
aqui
aqui 26.11.2024 aktualisiert um 18:17:21 Uhr
Goto Top
Take a look at a local tutorial:
Freeradius with database and GUI which describes all steps in detail. Use a translator to read it in English.
In case you have the database on a separate server the most important config is under /etc/freeradius/3.0/mods-available/sql
Instead of "localhost" in the connection you have to setup the database IP address here. In case you need to encrypt the session you need to maybe activate all the TLS settings in the connection screenshot above. You should make sure that a ping between radius and database works and proofs a running IP connection. Database ports should be open in a firewall. There are also some easy checks for a remote client connectivity:
https://mariadb.com/kb/en/configuring-mariadb-for-remote-client-access/
So far the debug output looks quite ok for the Radius authentication itself but looks like there is no network connection to the database and therefor the user "user1" could not be looked up and fails authentication.
Serie: Freeradius Y MYSQL 1
Freeradius Y MYSQL (englisch)3