Hi, Just wondering if I can some help with my Freeradius2 and mysql setup. I'm kind of new to this. I'm receiving an error when trying to radtest while running radiusd -X. This debug is below. I have followed the wiki pages most of the way. Can someone lead my in the right direction? Starting - reading configuration files ... including configuration file /etc/raddb/radiusd.conf including configuration file /etc/raddb/proxy.conf including configuration file /etc/raddb/clients.conf including files in directory /etc/raddb/modules/ including configuration file /etc/raddb/modules/detail including configuration file /etc/raddb/modules/inner-eap including configuration file /etc/raddb/modules/pap including configuration file /etc/raddb/modules/sradutmp including configuration file /etc/raddb/modules/smbpasswd including configuration file /etc/raddb/modules/expr including configuration file /etc/raddb/modules/attr_filter including configuration file /etc/raddb/modules/counter including configuration file /etc/raddb/modules/sqlcounter_expire_on_login including configuration file /etc/raddb/modules/exec including configuration file /etc/raddb/modules/digest including configuration file /etc/raddb/modules/expiration including configuration file /etc/raddb/modules/sql_log including configuration file /etc/raddb/modules/otp including configuration file /etc/raddb/modules/perl including configuration file /etc/raddb/modules/mac2vlan including configuration file /etc/raddb/modules/linelog including configuration file /etc/raddb/modules/echo including configuration file /etc/raddb/modules/smsotp including configuration file /etc/raddb/modules/detail.log including configuration file /etc/raddb/modules/policy including configuration file /etc/raddb/modules/mac2ip including configuration file /etc/raddb/modules/chap including configuration file /etc/raddb/modules/radutmp including configuration file /etc/raddb/modules/wimax including configuration file /etc/raddb/modules/unix including configuration file /etc/raddb/modules/ippool including configuration file /etc/raddb/modules/etc_group including configuration file /etc/raddb/modules/cui including configuration file /etc/raddb/modules/always including configuration file /etc/raddb/modules/preprocess including configuration file /etc/raddb/modules/passwd including configuration file /etc/raddb/modules/pam including configuration file /etc/raddb/modules/realm including configuration file /etc/raddb/modules/detail.example.com including configuration file /etc/raddb/modules/mschap including configuration file /etc/raddb/modules/attr_rewrite including configuration file /etc/raddb/modules/files including configuration file /etc/raddb/modules/logintime including configuration file /etc/raddb/modules/acct_unique including configuration file /etc/raddb/modules/checkval including configuration file /etc/raddb/eap.conf including configuration file /etc/raddb/sql.conf including configuration file /etc/raddb/sql/mysql/dialup.conf including configuration file /etc/raddb/policy.conf including files in directory /etc/raddb/sites-enabled/ including configuration file /etc/raddb/sites-enabled/inner-tunnel including configuration file /etc/raddb/sites-enabled/control-socket including configuration file /etc/raddb/sites-enabled/default group = radiusd user = radiusd including dictionary file /etc/raddb/dictionary main { prefix = "/usr" localstatedir = "/var" logdir = "/var/log/radius" libdir = "/usr/lib/freeradius" radacctdir = "/var/log/radius/radacct" hostname_lookups = no max_request_time = 30 cleanup_delay = 5 max_requests = 1024 allow_core_dumps = no pidfile = "/var/run/radiusd/radiusd.pid" checkrad = "/usr/sbin/checkrad" debug_level = 0 proxy_requests = yes log { stripped_names = no auth = no auth_badpass = no auth_goodpass = no } security { max_attributes = 200 reject_delay = 1 status_server = yes } } radiusd: #### Loading Realms and Home Servers #### proxy server { retry_delay = 5 retry_count = 3 default_fallback = no dead_time = 120 wake_all_if_all_dead = no } home_server localhost { ipaddr = 127.0.0.1 port = 1812 type = "auth" secret = "testing123" response_window = 20 max_outstanding = 65536 require_message_authenticator = no zombie_period = 40 status_check = "status-server" ping_interval = 30 check_interval = 30 num_answers_to_alive = 3 num_pings_to_alive = 3 revive_interval = 120 status_check_timeout = 4 irt = 2 mrt = 16 mrc = 5 mrd = 30 } home_server_pool my_auth_failover { type = fail-over home_server = localhost } realm example.com { auth_pool = my_auth_failover } realm LOCAL { } radiusd: #### Loading Clients #### client localhost { ipaddr = 127.0.0.1 require_message_authenticator = no secret = "testing123" nastype = "other" } radiusd: #### Instantiating modules #### instantiate { Module: Linked to module rlm_exec Module: Instantiating exec exec { wait = no input_pairs = "request" shell_escape = yes } Module: Linked to module rlm_expr Module: Instantiating expr Module: Linked to module rlm_expiration Module: Instantiating expiration expiration { reply-message = "Password Has Expired " } Module: Linked to module rlm_logintime Module: Instantiating logintime logintime { reply-message = "You are calling outside your allowed timespan " minimum-timeout = 60 } } radiusd: #### Loading Virtual Servers #### server inner-tunnel { modules { Module: Checking authenticate {...} for more modules to load Module: Linked to module rlm_pap Module: Instantiating pap pap { encryption_scheme = "auto" auto_header = no } Module: Linked to module rlm_chap Module: Instantiating chap Module: Linked to module rlm_mschap Module: Instantiating mschap mschap { use_mppe = yes require_encryption = no require_strong = no with_ntdomain_hack = no } Module: Linked to module rlm_unix Module: Instantiating unix unix { radwtmp = "/var/log/radius/radwtmp" } Module: Linked to module rlm_eap Module: Instantiating eap eap { default_eap_type = "md5" timer_expire = 60 ignore_unknown_eap_types = no cisco_accounting_username_bug = no max_sessions = 2048 } Module: Linked to sub-module rlm_eap_md5 Module: Instantiating eap-md5 Module: Linked to sub-module rlm_eap_leap Module: Instantiating eap-leap Module: Linked to sub-module rlm_eap_gtc Module: Instantiating eap-gtc gtc { challenge = "Password: " auth_type = "PAP" } Module: Linked to sub-module rlm_eap_tls Module: Instantiating eap-tls tls { rsa_key_exchange = no dh_key_exchange = yes rsa_key_length = 512 dh_key_length = 512 verify_depth = 0 pem_file_type = yes private_key_file = "/etc/raddb/certs/server.pem" certificate_file = "/etc/raddb/certs/server.pem" CA_file = "/etc/raddb/certs/ca.pem" private_key_password = "whatever" dh_file = "/etc/raddb/certs/dh" random_file = "/etc/raddb/certs/random" fragment_size = 1024 include_length = yes check_crl = no cipher_list = "DEFAULT" make_cert_command = "/etc/raddb/certs/bootstrap" cache { enable = no lifetime = 24 max_entries = 255 } } Module: Linked to sub-module rlm_eap_ttls Module: Instantiating eap-ttls ttls { default_eap_type = "md5" copy_request_to_tunnel = no use_tunneled_reply = no virtual_server = "inner-tunnel" include_length = yes } Module: Linked to sub-module rlm_eap_peap Module: Instantiating eap-peap peap { default_eap_type = "mschapv2" copy_request_to_tunnel = no use_tunneled_reply = no proxy_tunneled_request_as_eap = yes virtual_server = "inner-tunnel" } Module: Linked to sub-module rlm_eap_mschapv2 Module: Instantiating eap-mschapv2 mschapv2 { with_ntdomain_hack = no } Module: Checking authorize {...} for more modules to load Module: Linked to module rlm_realm Module: Instantiating suffix realm suffix { format = "suffix" delimiter = "@" ignore_default = no ignore_null = no } Module: Linked to module rlm_files Module: Instantiating files files { usersfile = "/etc/raddb/users" acctusersfile = "/etc/raddb/acct_users" preproxy_usersfile = "/etc/raddb/preproxy_users" compat = "no" } Module: Checking session {...} for more modules to load Module: Linked to module rlm_radutmp Module: Instantiating radutmp radutmp { filename = "/var/log/radius/radutmp" username = "%{User-Name}" case_sensitive = yes check_with_nas = yes perm = 384 callerid = yes } Module: Checking post-proxy {...} for more modules to load Module: Checking post-auth {...} for more modules to load Module: Linked to module rlm_attr_filter Module: Instantiating attr_filter.access_reject attr_filter attr_filter.access_reject { attrsfile = "/etc/raddb/attrs.access_reject" key = "%{User-Name}" } } # modules } # server server { modules { Module: Checking authenticate {...} for more modules to load Module: Checking authorize {...} for more modules to load Module: Linked to module rlm_preprocess Module: Instantiating preprocess preprocess { huntgroups = "/etc/raddb/huntgroups" hints = "/etc/raddb/hints" with_ascend_hack = no ascend_channels_per_line = 23 with_ntdomain_hack = no with_specialix_jetstream_hack = no with_cisco_vsa_hack = no with_alvarion_vsa_hack = no } Module: Linked to module rlm_sql Module: Instantiating sql sql { driver = "rlm_sql_mysql" server = "localhost" port = "" login = "root" password = "(mypassword)" radius_db = "radius" read_groups = yes sqltrace = no sqltracefile = "/var/log/radius/sqltrace.sql" readclients = no deletestalesessions = yes num_sql_socks = 5 lifetime = 0 max_queries = 0 sql_user_name = "%{User-Name}" default_user_profile = "" nas_query = "SELECT id, nasname, shortname, type, secret FROM nas" authorize_check_query = "SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id" authorize_reply_query = "SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id" authorize_group_check_query = "SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id" authorize_group_reply_query = "SELECT id, groupname, attribute, value, op FROM radgroupreply WHERE groupname = '%{Sql-Group}' ORDER BY id" accounting_onoff_query = " UPDATE radacct SET acctstoptime = '%S', acctsessiontime = unix_timestamp('%S') - unix_timestamp(acctstarttime), acctterminatecause = '%{Acct-Terminate-Cause}', acctstopdelay = %{%{Acct-Delay-Time}:-0} WHERE acctstoptime IS NULL AND nasipaddress = '%{NAS-IP-Address}' AND acctstarttime <= '%S'" accounting_update_query = " UPDATE radacct SET framedipaddress = '%{Framed-IP-Address}', acctsessiontime = '%{Acct-Session-Time}', acctinputoctets = '%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}', acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 | '%{%{Acct-Output-Octets}:-0}' WHERE acctsessionid = '%{Acct-Session-Id}' AND username = '%{SQL-User-Name}' AND nasipaddress = '%{NAS-IP-Address}'" accounting_update_query_alt = " INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctsessiontime, acctauthentic, connectinfo_start, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, servicetype, framedprotocol, framedipaddress, acctstartdelay, xascendsessionsvrkey) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', DATE_SUB('%S', INTERVAL (%{%{Acct-Session-Time}:-0} + %{%{Acct-Delay-Time}:-0}) SECOND), '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}', '%{%{Acct-Output-Gigawords}:-0}' << 32 | '%{%{Acct-Output-Octets}:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{X-Ascend-Session-Svr-Key}')" accounting_start_query = " INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress, acctstartdelay, acctstopdelay, xascendsessionsvrkey) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', '%S', NULL, '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '%{%{Acct-Delay-Time}:-0}', '0', '%{X-Ascend-Session-Svr-Key}')" accounting_start_query_alt = " UPDATE radacct SET acctstarttime = '%S', acctstartdelay = '%{%{Acct-Delay-Time}:-0}', connectinfo_start = '%{Connect-Info}' WHERE acctsessionid = '%{Acct-Session-Id}' AND username = '%{SQL-User-Name}' AND nasipaddress = '%{NAS-IP-Address}'" accounting_stop_query = " UPDATE radacct SET acctstoptime = '%S', acctsessiontime = '%{Acct-Session-Time}', acctinputoctets = '%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}', acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 | '%{%{Acct-Output-Octets}:-0}', acctterminatecause = '%{Acct-Terminate-Cause}', acctstopdelay = '%{%{Acct-Delay-Time}:-0}', connectinfo_stop = '%{Connect-Info}' WHERE acctsessionid = '%{Acct-Session-Id}' AND username = '%{SQL-User-Name}' AND nasipaddress = '%{NAS-IP-Address}'" accounting_stop_query_alt = " INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress, acctstartdelay, acctstopdelay) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', DATE_SUB('%S', INTERVAL (%{%{Acct-Session-Time}:-0} + %{%{Acct-Delay-Time}:-0}) SECOND), '%S', '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Connect-Info}', '%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}', '%{%{Acct-Output-Gigawords}:-0}' << 32 | '%{%{Acct-Output-Octets}:-0}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Acct-Terminate-Cause}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{%{Acct-Delay-Time}:-0}')" group_membership_query = "SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority" connect_failure_retry_delay = 60 simul_count_query = "" simul_verify_query = "SELECT radacctid, acctsessionid, username, nasipaddress, nasportid, framedipaddress, callingstationid, framedprotocol FROM radacct WHERE username = '%{SQL-User-Name}' AND acctstoptime IS NULL" postauth_query = "INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '%{User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S')" safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /" } rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked rlm_sql (sql): Attempting to connect to root@localhost:/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 (sql): Connected new DB handle, #0 rlm_sql (sql): starting 1 rlm_sql (sql): Attempting to connect rlm_sql_mysql #1 rlm_sql_mysql: Starting connect to MySQL server for #1 rlm_sql (sql): Connected new DB handle, #1 rlm_sql (sql): starting 2 rlm_sql (sql): Attempting to connect rlm_sql_mysql #2 rlm_sql_mysql: Starting connect to MySQL server for #2 rlm_sql (sql): Connected new DB handle, #2 rlm_sql (sql): starting 3 rlm_sql (sql): Attempting to connect rlm_sql_mysql #3 rlm_sql_mysql: Starting connect to MySQL server for #3 rlm_sql (sql): Connected new DB handle, #3 rlm_sql (sql): starting 4 rlm_sql (sql): Attempting to connect rlm_sql_mysql #4 rlm_sql_mysql: Starting connect to MySQL server for #4 rlm_sql (sql): Connected new DB handle, #4 Module: Checking preacct {...} for more modules to load Module: Linked to module rlm_acct_unique Module: Instantiating acct_unique acct_unique { key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port" } Module: Checking accounting {...} for more modules to load Module: Linked to module rlm_detail Module: Instantiating detail detail { detailfile = "/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d" header = "%t" detailperm = 384 dirperm = 493 locking = no log_packet_header = no } Module: Instantiating attr_filter.accounting_response attr_filter attr_filter.accounting_response { attrsfile = "/etc/raddb/attrs.accounting_response" key = "%{User-Name}" } Module: Checking session {...} for more modules to load Module: Checking post-proxy {...} for more modules to load Module: Checking post-auth {...} for more modules to load } # modules } # server radiusd: #### Opening IP addresses and Ports #### listen { type = "auth" ipaddr = * port = 0 } listen { type = "acct" ipaddr = * port = 0 } listen { type = "control" listen { socket = "/var/run/radiusd/radiusd.sock" } } Listening on authentication address * port 1812 Listening on accounting address * port 1813 Listening on command file /var/run/radiusd/radiusd.sock Listening on proxy address * port 1814 Ready to process requests. rad_recv: Access-Request packet from host 127.0.0.1 port 40723, id=32, length=57 User-Name = "fredf" User-Password = "wilma" NAS-IP-Address = 192.168.0.210 NAS-Port = 0 +- entering group authorize {...} ++[preprocess] returns ok ++[chap] returns noop ++[mschap] returns noop [suffix] No '@' in User-Name = "fredf", looking up realm NULL [suffix] No such realm "NULL" ++[suffix] returns noop [eap] No EAP-Message, not doing EAP ++[eap] returns noop ++[unix] returns notfound ++[files] returns noop [sql] expand: %{User-Name} -> fredf [sql] sql_set_user escaped user --> 'fredf' rlm_sql (sql): Reserving sql socket id: 4 [sql] expand: SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id [sql] User found in radcheck table [sql] expand: SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radreply WHERE username = 'fredf' ORDER BY id [sql] expand: SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority -> SELECT groupname FROM radusergroup WHERE username = 'fredf' ORDER BY priority [sql] expand: SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'dynamic' ORDER BY id rlm_sql_mysql: MYSQL check_error: 1146 received rlm_sql_getvpdata: database query error [sql] Error retrieving check pairs for group dynamic [sql] Error processing groups; rejecting user rlm_sql (sql): Released sql socket id: 4 ++[sql] returns fail Using Post-Auth-Type Reject +- entering group REJECT {...} [attr_filter.access_reject] expand: %{User-Name} -> fredf attr_filter: Matched entry DEFAULT at line 11 ++[attr_filter.access_reject] returns updated Delaying reject of request 0 for 1 seconds Going to the next request Waking up in 0.9 seconds. Sending delayed reject for request 0 Sending Access-Reject of id 32 to 127.0.0.1 port 40723 Waking up in 4.9 seconds. Cleaning up request 0 ID 32 with timestamp +11 Ready to process requests. Mysql database - radius, tables are below mysql> select * from radusergroup; +------------+-----------+----------+ | username | groupname | priority | +------------+-----------+----------+ | fredf | dynamic | 1 | | barney | static | 1 | | dialrouter | netdial | 1 | +------------+-----------+----------+ 3 rows in set (0.00 sec) mysql> select * from radcheck; +----+------------+--------------------+----+--------+ | id | username | attribute | op | value | +----+------------+--------------------+----+--------+ | 1 | fredf | Cleartext-Password | := | wilma | | 2 | barney | Cleartext-Password | := | betty | | 3 | dialrouter | Cleartext-Password | := | dialup | +----+------------+--------------------+----+--------+ 3 rows in set (0.00 sec) mysql> select * from radreply; +----+------------+--------------------+----+-------------------------+ | id | username | attribute | op | value | +----+------------+--------------------+----+-------------------------+ | 1 | dynamic | Framed-Compression | := | Van-Jacobsen-TCP-IP | | 2 | dynamic | Framed-IP-Address | := | 2.3.4.1 | | 3 | dynamic | Framed-IP-Netmask | := | 255.255.255.255 | | 4 | dynamic | Framed-Routing | := | Broadcast-Listen | | 5 | dialrouter | Framed-Route | := | 2.3.4.0 255.255.255.248 | | 6 | dialrouter | Idle-Timeout | := | 900 | +----+------------+--------------------+----+-------------------------+ 6 rows in set (0.01 sec) mysql> select * from radgroupreply; +----+-----------+--------------------+----+---------------------+ | id | groupname | attribute | op | value | +----+-----------+--------------------+----+---------------------+ | 34 | dynamic | Framed-Compression | := | Van-Jacobsen-TCP-IP | | 33 | dynamic | Framed-Protocol | := | PPP | | 32 | dynamic | Service-Type | := | Framed-User | | 35 | dynamic | Framed-MTU | := | 1500 | | 37 | static | Framed-Protocol | := | PPP | | 38 | static | Service-Type | := | Framed-User | | 39 | static | Framed-Compression | := | Van-Jacobsen-TCP-IP | | 41 | netdial | Service-Type | := | Framed-User | | 42 | netdial | Framed-Protocol | := | PPP | +----+-----------+--------------------+----+---------------------+ 9 rows in set (0.00 sec) Thanks, Shawky
[sql] expand: %{User-Name} -> fredf [sql] sql_set_user escaped user --> 'fredf' rlm_sql (sql): Reserving sql socket id: 4 [sql] expand: SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id [sql] User found in radcheck table [sql] expand: SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radreply WHERE username = 'fredf' ORDER BY id [sql] expand: SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority -> SELECT groupname FROM radusergroup WHERE username = 'fredf' ORDER BY priority [sql] expand: SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'dynamic' ORDER BY id rlm_sql_mysql: MYSQL check_error: 1146 received rlm_sql_getvpdata: database query error [sql] Error retrieving check pairs for group dynamic [sql] Error processing groups; rejecting user rlm_sql (sql): Released sql socket id: 4 ++[sql] returns fail <tim>
From the MySQL documentation:
Error: 1146 SQLSTATE: 42S02 ( <http://dev.mysql.com/doc/refman/5.1/en/error-messages-server.html#error_er_ no_such_table> ER_NO_SUCH_TABLE) Message: Table '%s.%s' doesn't exist Use the MySQL client with the same user that FreeRADIUS uses to connect to MySQL. Then try the query that FR sent to MySQL: SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'dynamic' ORDER BY id; You should get the same error - 1146 and message with more information on the error. Tim
On Wed, 2010-09-08 at 22:14 -0700, Tim Sylvester wrote:
[sql] expand: %{User-Name} -> fredf [sql] sql_set_user escaped user --> 'fredf' rlm_sql (sql): Reserving sql socket id: 4 [sql] expand: SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id [sql] User found in radcheck table [sql] expand: SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radreply WHERE username = 'fredf' ORDER BY id [sql] expand: SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority -> SELECT groupname FROM radusergroup WHERE username = 'fredf' ORDER BY priority [sql] expand: SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'dynamic' ORDER BY id rlm_sql_mysql: MYSQL check_error: 1146 received rlm_sql_getvpdata: database query error [sql] Error retrieving check pairs for group dynamic [sql] Error processing groups; rejecting user rlm_sql (sql): Released sql socket id: 4 ++[sql] returns fail
<tim>
From the MySQL documentation:
Error: 1146 SQLSTATE:42S02 (ER_NO_SUCH_TABLE) Message: Table '%s.%s' doesn't exist
Use the MySQL client with the same user that FreeRADIUS uses to connect to MySQL. Then try the query that FR sent to MySQL:
SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'dynamic' ORDER BY id;
You should get the same error – 1146 and message with more information on the error.
Tim
Sounds like you haven't created the table in your MySQL DB yet.
thanks for that, it's done the job. Now my second problem is dialup admin. I can access it using http://(IP address)/dialup, however when I click on the left hand side menu options, for example accounting or statistic, I receive the following error "DEBUG(SQL,MYSQL DRIVER): Connect: User=(root),Password=(mypassword) If i turn off sql debug, I receive a plain white page instead. The only options which I can select and view options are find user, show group, check server, help and about. Listed below are my config files. I am using php5 Admin.conf # # Main Configuration File # # it can be default or whatever language. Only greek are supported # from non latin alphabet languages # These attribute only apply for ldap not for sql # general_prefered_lang: en general_prefered_lang_name: English # # The charset which will be added as a meta tag in all pages # general_charset: iso-8859-1 # # Uncomment this if normal attributes (not the ;lang-xx ones) in ldap # are utf8 encoded. # #general_decode_normal_attributes: yes # # The directory where dialupadmin is installed # general_base_dir: /usr/local/dialup_admin # # The base directory of the freeradius radius installation # general_radiusd_base_dir: /usr/sbin general_domain: (company).net.au # # Set it to yes to use sessions and cache the various mappings # You can also set use_session = 1 in config.php3 to also cache # the admin.conf # # ---- IMPORTANT -- IMPORTANT -- IMPORTANT ---- #Remember to use the 'Clear Cache' page if you use sessions and do any changes #in any of the configuration files. # general_use_session: no # # This is used by the failed logins page. It states the default back time # in minutes. # general_most_recent_fl: 30 # # Realm setup # # Set general_strip_realms to yes in order to stip realms from usernames. # By default realms are not striped general_strip_realms: yes # # The delimiter used in realms. Default is @ # general_realm_delimiter: @ # # The format of the realms. Can be either suffix (realm is after the username) # or prefix (realm is before the username). Default is suffix # # general_realm_format: suffix # # # Determines if the administrator will be able to see and change the user password through # the user edit page general_show_user_password: yes general_raddb_dir: %{general_radiusd_base_dir}/etc/raddb general_ldap_attrmap: %{general_raddb_dir}/ldap.attrmap # Need to fix admin.conf file parser #general_clients_conf: %{general_raddb_dir}/clients.conf general_clients_conf: etc/raddb/clients.conf general_sql_attrmap: %{general_base_dir}/conf/sql.attrmap general_accounting_attrs_file: %{general_base_dir}/conf/accounting.attrs general_extra_ldap_attrmap: %{general_base_dir}/conf/extra.ldap-attrmap general_username_mappings_file: %{general_base_dir}/conf/username.mappings # # it can be either ldap or sql # This affects the user base not accounting. Accounting is always in sql # general_lib_type: sql # # Define which attributes will be visible in the user edit page # general_user_edit_attrs_file: %{general_base_dir}/conf/user_edit.attrs # # Used by the Accounting Report Generator # general_sql_attrs_file: %{general_base_dir}/conf/sql.attrs # # Set default values for various attributes # general_default_file: %{general_base_dir}/conf/default.vals #general_ld_library_path: /usr/local/snmpd/lib # # can be 'snmp' (for snmpfinger) or empty to query the radacct table without first # querying the nas # This is used by the online users page # general_finger_type: snmp # # Defines the nas type. This is only used by snmpfinger # cisco, usrhiper and lucent are supported for now # general_nas_type: cisco general_snmpfinger_bin: %{general_base_dir}/bin/snmpfinger # # Used by the 'Disconnect User' button in the Clear Open Sessions page # Uses the Cisco AAA Session MIB or a telnet session # general_sessionclear_bin: %{general_base_dir}/bin/clearsession # # Can be one of telnet or snmp # general_sessionclear_method: snmp general_radclient_bin: %{general_radiusd_base_dir}/bin/radclient # # this information is used from the server check page # general_test_account_login: test general_test_account_password: testpass # # These are used as default values for the user test page # general_radius_server: localhost general_radius_server_port: 1812 # # can be either pap or chap # general_radius_server_auth_proto: chap # # sorry, single valued for now. Should become something like # password[server-name]: xxxxx # general_radius_server_secret: XXXXXX general_auth_request_file: %{general_base_dir}/conf/auth.request # # can be one of crypt,md5,clear # general_encryption_method: clear # # can be either asc (older dates first) or desc (recent dates first) # This is used in the user accounting and badusers pages # general_accounting_info_order: desc # # Use the totacct table in the user statistics page instead of the radacct # table. That will make the page run quicker. totacct should have data for # this to work :-) # general_stats_use_totacct: no # # If set to yes then we only allow each administrator to examine it's own entries # in the badusers table # general_restrict_badusers_access: no # # If set to yes then we restrict access to the nas administration page only to those # users which are allowed by their username mapping (nasadmin is set to yes) # general_restrict_nasadmin_access: no INCLUDE: %{general_base_dir}/conf/naslist.conf INCLUDE: %{general_base_dir}/conf/captions.conf # # The ldap server to connect to. # Both ldap_server and ldap_write_server can be a space-separated # list of ldap hostnames. In that case the library will try to connect # to the servers in the order that they appear. If the first host is down # ldap_connect will ask for the second ldap host and so on. # ldap_server: ldap.%{general_domain} # # There are many cases where we have a small write master and # a lot of fast read only replicas. If that is the case uncomment # ldap_write_server and point it to the write master. It will be # used only when writing to the directory, not when reading # #ldap_write_server: master.%{general_domain} ldap_base: dc=company,dc=com ldap_binddn: cn=Directory Manager ldap_bindpw: XXXXXXX ldap_default_new_entry_suffix: ou=dialup,ou=guests,%{ldap_base} ldap_default_dn: uid=default-dialup,%{ldap_base} ldap_regular_profile_attr: dialupregularprofile # # If set to yes then the HTTP credentials (http authentication) # will be used to bind to the ldap server instead of ldap_binddn # and ldap_bindpw. That way multiple admins with different rights # on the ldap database can connect through one dialup_admin interface. # The ldap_binddn and ldap_bindpw are still needed to find the DN # to bind with (http authentication will only provide us with a # username). As a result the ldap_binddn should be able to do a search # with a filter of (uid=<username>). Normally, the anonymous (empty DN) # user can do that. #ldap_use_http_credentials: yes # # If we are using http credentials we can map a specific username to the # directory manager (which usually does not correspond to a specific username) # #ldap_directory_manager: cn=Directory Manager #ldap_map_to_directory_manager: admin # # Uncomment to enable ldap debug # ldap_debug: true # # Allow for defining the ldap filter used when searching for a user # Variables supported: # %u: username # %U: username provided though http authentication # %mu: mappings for userdb # %ma: mappings for accounting # %mn: mappings for nasdb # %mN: mappings for nas administration # # One use of this would be to restrict access to only the user's belonging to # a specific administrator like this: # ldap_filter: (&(uid=%u)(manager=uid=%U,ou=admins,o=company,c=com)) # #ldap_filter: (uid=%u) # # If ldap_userdn is set then we use that for user dns, we don't perform an ldap # search. This can be somewhat faster. The variables supported for ldap_filter # are also supported here # #ldap_userdn: uid=%u,%{ldap_base} # # can be one of mysql,pg,oracle,sqlrelay where: # mysq: MySQL database (port 3306) # pg: PostgreSQL database (port 5432) # oracle: Oracle database (port 1521) # sqlrelay: SQL Relay # sql_type: mysql sql_server: localhost sql_port: 3306 sql_username: root sql_password: (sqlpassword) sql_database: radius sql_accounting_table: radacct sql_badusers_table: badusers sql_check_table: radcheck sql_reply_table: radreply sql_user_info_table: userinfo sql_groupcheck_table: radgroupcheck sql_groupreply_table: radgroupreply sql_usergroup_table: usergroup sql_total_accounting_table: totacct sql_nas_table: nas # # If set to true then we show all the available groups with the groups # that the user is a member of highlighted in the user edit page. # Otherwise we only show the groups he is a member of. sql_show_all_groups: true # # This variable is used by the scripts in the bin folder # It should contain the path to the sql binary used to run # sql commands (mysql, psql, oracle and sqlrelay are only supported for now) sql_command: /usr/bin/mysql #sql_command: /usr/bin/psql #sql_command: /usr/bin/sqlplus # # This variable is used by the scripts in the bin folder # It should contain the snmp type and path to the binary # used to run snmp commands. # (ucd = UCD-Snmp and net = Net-Snmp are only supported for now) general_snmp_type: net general_snmpwalk_command: /usr/local/bin/snmpwalk general_snmpget_command: /usr/local/bin/snmpget # # Uncomment to enable sql debug # sql_debug: true # # If set to yes then the HTTP credentials (http authentication) # will be used to connect to the sql server instead of sql_username # and sql_password. That way multiple admins with different rights # on the sql database can connect through one dialup_admin interface. sql_use_http_credentials: no # # If set the query will be added to all of the queries on the accounting # table # Variables supported: # %u: username # %U: username provided though http authentication # %mu: mappings for userdb # %ma: mappings for accounting # %mn: mappings for nasdb # %mN: mappings for nas administration #sql_accounting_extra_query: %ma # # true or false # sql_use_user_info_table: true sql_use_operators: true # # Set this to the value of the default_user_profile in your # sql.conf if that one is set. If it is not set leave blank # or commented out #sql_default_user_profile: DEFAULT # # sql_password_attribute: User-Password sql_date_format: Y-m-d sql_full_date_format: Y-m-d H:i:s # # Used in the accounting report generator so that we # don't return too many results # sql_row_limit: 40 # # These options are used by the log_badlogins script and by the # mysql driver # # Set the sql connect timeout (secs) sql_connect_timeout: 3 # Give a space separated list of extra mysql servers to connect to when # logging bad logins or adding users in the badusers table #sql_extra_servers: sql2.company.com sql3.company.com # # Default values for the various user limits in case the counter module # is used to impose such limits. # The value should be the user limit in seconds or none for nothing # Check out conf/sql.attrmap or extra.ldap-attrmap (depending on if you are # using sql or ldap) for per user attributes. The mapping should be made to # the attributes configured in the counter module. The attributes used by # dialupadmin will always be the ones appearing in the attribute mapping files # so you should make sure they are mapped to the correct attributes # #counter_default_daily: 14400 #counter_default_weekly: 72000 counter_default_daily: none counter_default_weekly: none counter_default_monthly: none # # Since calculating monthly usage can be quite expensive we make # it configurable # This is not needed if the monthly limit is not none #counter_monthly_calculate_usage: true I have inputted the following in httpd.conf LoadModule php5_module modules/libphp5.so #AddModule mod_php5.c - do I need to add this? currently commented out, because if it's uncommented and i restart httpd, I receive an error saying "Apache 1.3 configuration directives found please read /usr/share/doc/httpd-2.2.3/migration.html" AddType application/x-httpd-php .php AddType application/x-httpd-php .php3 Let me know if you need more info. Thanks, Shawky From: tim.sylvester@networkradius.com To: freeradius-users@lists.freeradius.org Subject: RE: Freeradius2 & Mysql Date: Wed, 8 Sep 2010 22:14:30 -0700 [sql] expand: %{User-Name} -> fredf [sql] sql_set_user escaped user --> 'fredf' rlm_sql (sql): Reserving sql socket id: 4 [sql] expand: SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id [sql] User found in radcheck table [sql] expand: SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radreply WHERE username = 'fredf' ORDER BY id [sql] expand: SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority -> SELECT groupname FROM radusergroup WHERE username = 'fredf' ORDER BY priority [sql] expand: SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'dynamic' ORDER BY id rlm_sql_mysql: MYSQL check_error: 1146 received rlm_sql_getvpdata: database query error [sql] Error retrieving check pairs for group dynamic [sql] Error processing groups; rejecting user rlm_sql (sql): Released sql socket id: 4 ++[sql] returns fail <tim> From the MySQL documentation: Error: 1146 SQLSTATE: 42S02 (ER_NO_SUCH_TABLE) Message: Table '%s.%s' doesn't exist Use the MySQL client with the same user that FreeRADIUS uses to connect to MySQL. Then try the query that FR sent to MySQL: SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'dynamic' ORDER BY id; You should get the same error – 1146 and message with more information on the error. Tim - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
C.J. Adams-Collier KF7BMP -
shawky skaff -
Tim Sylvester