Glynn,
I am trying the same setup here.
Here is my setup current setup:
First I installed unixodbc. Then I compiled/installed
freetds with "--with-unixodbc" as suggested by
someone on the mailing list. Then I installed freeradius.
My conf files are:
freetds.conf:
--------------
[MSSQL-6]
host = 1.2.3.4
port = 1433
tds version = 7.0
odbc.ini
---------
[MSSQL-6]
Driver = TDS
Description = SQL Server
Trace = No
Servername = 1.2.3.4
Database = freeradius
odbcinst.ini
-------------
[TDS]
Description = FreeTDS v0.60
Driver = /usr/local/freetds/lib/libtdsodbc.so
FileUsage = 2
sql.conf of radius
--------------------
driver = "rlm_sql_unixodbc"
# Connect info
server = MSSQL-6
login = "freeradius"
password = "something"
# Database table configuration
radius_db = "freeradius"
Then I installed the odbc named "MSSQL-6" using:
odbcinst -i -d -f odbcinst.ini
odbcinst -i -s -f odbc.ini
Making tests using "isql -v MSSQL-6 login MyPassword"
works fine. I can manually update records in the MSSQL
database.
starting radius:
radius connects fine to MSSQL server as debug shows:
rlm_sql: Driver rlm_sql_unixodbc loaded and linked
rlm_sql: Attempting to connect to freeradius@MSSQL-6:/freeradius
rlm_sql: starting 0
rlm_sql: Attempting to connect #0
rlm_sql: Connected new DB handle, #0
rlm_sql: starting 1
rlm_sql: Attempting to connect #1
rlm_sql: Connected new DB handle, #1
.
.
.
However when radius trys to write accounting records to
MSSQL I get the follwing errors:
rlm_sql: Couldn't insert SQL accounting STOP record - 00000
OR
rlm_sql: Couldn't update SQL accounting for START packet - 00000
extract of debug
------------------
radius_xlat: 'dme'
sql_set_user: escaped user --> 'dme'
radius_xlat: 'UPDATE radacct SET AcctStopTime = '2002-11-06 18:44:40',
AcctSessionTime = '127', AcctInputOctets = '2320', AcctOutputOctets = '157339',
AcctTerminateCause = 'User-Request', AcctStopDelay = '0', ConnectInfo_stop = '' WHERE
AcctSessionId = '7400315D' AND UserName = 'dme' AND NASIPAddress =
'212.24.192.4' AND AcctStopTime = 0'
rlm_sql: Reserving sql socket id: 4
radius_xlat: 'INSERT into radacct (AcctSessionId, AcctUniqueId, UserName, Realm,
NASIPAddress, NASPort, NASPortType, AcctStopTime, AcctSessionTime,
AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets,
CalledStationId, CallingStationId, AcctTerminateCause, ServiceType,
FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay) values('7400315D', '',
'dme', '', '212.24.192.4', '34', 'ISDN', '2002-11-06 18:44:40',
'127', 'RADIUS', '', '', '2320', '157339', '', '', 'User-Request', 'Framed-User',
'PPP', '212.24.192.101', '0', '0')'
rlm_sql_unixodbc: '00000 '
rlm_sql: Couldn't insert SQL accounting STOP record - 00000
rlm_sql: Released sql socket id: 4
modcall[accounting]: module "sql" returns ok
radius_xlat: '/usr/local/var/log/radius/radacct/212.24.192.4/detail'
rlm_detail: /usr/local/var/log/radius/radacct/%{Client-IP-Address}/detail expands to
/usr/local/var/log/radius/radacct/212.24.192.4/detail
modcall[accounting]: module "detail" returns ok
modcall[accounting]: module "unix" returns ok
radius_xlat: 'dme'
Accounting: logout: entry for NAS 212.24.192.4 port 34 has wrong ID
modcall[accounting]: module "radutmp" returns ok
modcall: group accounting returns ok
Sending Accounting-Response of id 175 to 212.24.192.4:1118
Finished request 0
Going to the next request
---------------
regards,
Christian
GT> Thank you. My apologies for leaving that out:
GT> my /usr/local/freetds.conf file has this as the only section database
GT> section:
GT> [192.168.0.126]
GT> host = 192.168.0.126
GT> port = 1433
GT> tds version = 7.0
GT> Does the name in [brackets] have to match anything else in the other conf
GT> files??
GT> The test program tsql is working:
GT> ====================================================================
GT> [glynn@localhost bin]$ tsql -S 192.168.0.126 -p 1433 -U hsvpnws
GT> Password:
GT> Msg 5703, Level 0, State 1, Server WFC-ACC1, Line 0
GT> Changed language setting to us_english.
1>> use wific
2>> go
1>> select * from customer;
2>> go
GT> Msg 208, Level 16, State 1, Server WFC-ACC1, Line 1
GT> Invalid object name 'customer'.
1>> select * from customers;
2>> go
GT> ID CustomerID Name Addr1 City State Zip
GT> 1 1 Microsoft 1 Microsoft Way
GT> Redmond WA
GT> 98105
GT> 5 2 Oracle 1 Ellison Way
GT> Dontknow
GT> 99999
1>>
GT> Yet radiusd can not get a connection to the database. Is there some logging
GT> I can turn on or check to help me figure this out?
GT> Thanks all
GT> GT
GT> -----Original Message-----
GT> From: [EMAIL PROTECTED]
GT> [mailto:freeradius-users-admin@;lists.cistron.nl]On Behalf Of Adorable
GT> Dauz
GT> Sent: Wednesday, November 06, 2002 5:53 PM
GT> To: [EMAIL PROTECTED]
GT> Subject: Re: (So close I can taste it...) freeradius & mssql2000
GT> you need also to configure the freetds first.
GT> ----- Original Message -----
GT> From: "Glynn Taylor" <[EMAIL PROTECTED]>
GT> To: "Freeradius-Users" <[EMAIL PROTECTED]>
GT> Sent: Thursday, November 07, 2002 6:36 AM
GT> Subject: (So close I can taste it...) freeradius & mssql2000
>>
>> 1. Do we have to specify a port number to connect to a MS SQL database?
GT> (If
>> so where, I can't find where to put one in MSSQL.conf)
>>
>> 2. Is it true that unixODBC does not work on it's own and still requires
>> freeTDS?
>>
>> First I got freeRadius working with text files. So far so good. The move
>> to SQL has not yet worked. The user is hsvpnws, the database is wific.
GT> The
>> databases server is 192.168.0.126.
>>
>> My Modules load, but my connection never makes it.
>> ====================================================================
>> sql: simul_verify_query = ""
>> rlm_sql ((null)): Driver rlm_sql_unixodbc (module rlm_sql_unixodbc) loaded
>> and linked
>> rlm_sql ((null)): Attempting to connect to [EMAIL PROTECTED]:/wific
>> rlm_sql ((null)): starting 0
>> rlm_sql ((null)): Attempting to connect #0
>> rlm_sql_unixodbc: Connection failed
>> rlm_sql ((null)): Failed to connect DB handle #0
>> rlm_sql ((null)): starting 1
>> rlm_sql ((null)): starting 2
>> rlm_sql ((null)): starting 3
>> rlm_sql ((null)): starting 4
>> Module: Instantiated sql (sql)
>> Module: Loaded files
>> files: usersfile = "/etc/raddb/users"
>> files: acctusersfile = "/etc/raddb/acct_users"
>> files: preproxy_usersfile = "/etc/raddb/preproxy_users"
>> files: compat = "no"
>> Module: Instantiated files (files)
>> Module: Loaded detail
>> detail: detailfile =
GT> "/var/log/radius/radacct/%{Client-IP-Address}/detail"
>> detail: detailperm = 384
>> detail: dirperm = 493
>> detail: locking = no
>> Module: Instantiated detail (detail)
>> Module: Loaded radutmp
>> radutmp: filename = "/var/log/radius/radutmp"
>> radutmp: username = "%{User-Name}"
>> radutmp: perm = 384
>> radutmp: callerid = yes
>> Module: Instantiated radutmp (radutmp)
>> Listening on IP address *, ports 1812/udp and 1813/udp, with proxy on
>> 1814/udp.
>> Ready to process requests.
>> ====================================================================
>> At the top of the raddb trace (third line down here) there is a blank port
>> directive, but I can't find where to enter it in mssql.conf:
>> ====================================================================
>> Module: Loaded SQL
>> sql: driver = "rlm_sql_unixodbc"
>> sql: server = "192.168.0.126"
>> sql: port = ""
>> sql: login = "hsvpnws"
>> sql: password = "eagles99"
>> sql: radius_db = "wific"
>> sql: acct_table = "radacct"
>> sql: acct_table2 = "radacct"
>> sql: authcheck_table = "radcheck"
>> sql: authreply_table = "radreply"
>> sql: groupcheck_table = "radgroupcheck"
>> sql: groupreply_table = "radgroupreply"
>> sql: usergroup_table = "usergroup"
>> sql: nas_table = "nas"
>> sql: dict_table = "dictionary"
>> sql: sqltrace = no
>> sql: sqltracefile = "/var/log/radius/sqltrace.sql"
>> sql: deletestalesessions = yes
>> sql: num_sql_socks = 5
>> sql: sql_user_name = "%{hsvpnws}"
>> ====================================================================
>> I'm running the latest snapshot of freeRadius and freeTDS. (but the
>> symptons are the same with 0.7.1 and 0.60). I compiled and installed
>> unixODBC first, then the freeTDS, then recompiled freeRadius. The
GT> database
>> exists.
>>
>> This is in my /usr/local/etc/odbc.ini:
>> [sqlserver]
>> Driver = TDS
>> Descripttion = SQL Server
>> Trace = Yes
>> Servername = 192.168.0.4
>> Database = wific
>>
>> This is in my /usr/local/etc/odbcinst.ini:
>> [TDS]
>> Description = SQL 2000 Database
>> Driver = /usr/local/lib/libtdsodbc.so
>> FileUsage = 1
>>
>> In mssql.conf the database type is declared as driver = "rlm_sql_unixodbc"
>> In radiusd.conf the following line chooses mssql.
>>
>> # For MS-SQL, use ${confdir}/mssql.conf
>> $INCLUDE ${confdir}/mssql.conf
>>
>>
>>
>> ====================================================================
>>
>> Any assistance or pointers greatly appreciated. Thanks for your time.
>> GT
>>
>>
>>
>> -
>> List info/subscribe/unsubscribe? See
GT> http://www.freeradius.org/list/users.html
GT> -
GT> List info/subscribe/unsubscribe? See
GT> http://www.freeradius.org/list/users.html
GT> -
GT> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html