Wow, so close.  Thank you thank you.

I actually had not run the odbcinst command, and in odbcinst.ini and I had
file useage = 1.  (What is the difference between 1 and 2? I have not been
able to find that one in the docs).

Below you mentioned sql.conf.  Did you mean mssql.conf?  That is the one I'm
using.  Anyway, I eliminated those two obvious differences in our setup and
I still get the same error when connecting.  I did notice something
different in my trace, but I don't know what it means if anything.  Notice
that the word null shows up when it loads my rlm_sql, but in your's it does
not.

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"

Is there a logfile that would have more detail of my failed connection?
Thanks
GT

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:freeradius-users-admin@;lists.cistron.nl]On Behalf Of Christian
Schmit
Sent: Thursday, November 07, 2002 6:05 AM
To: Christian Schmit
Subject: Re[3]: (So close I can taste it...) freeradius & mssql2000



I found my error.

The sql script included with freeradius for creating the
mssql database layout has an error. Freeradius uses "NASPort"
and the sql script included with freeradius for the mssql
database layout uses "NASPortid"

Christian


CS> Glynn,

CS> I am trying the same setup here.

CS> Here is my setup current setup:

CS> First I installed unixodbc. Then I compiled/installed
CS> freetds with "--with-unixodbc" as suggested by
CS> someone on the mailing list. Then I installed freeradius.

CS> My conf files are:

CS> freetds.conf:
CS> --------------
CS> [MSSQL-6]
CS>         host = 1.2.3.4
CS>         port = 1433
CS>         tds version = 7.0

CS> odbc.ini
CS> ---------
CS> [MSSQL-6]
CS> Driver = TDS
CS> Description = SQL Server
CS> Trace = No
CS> Servername = 1.2.3.4
CS> Database = freeradius

CS> odbcinst.ini
CS> -------------
CS> [TDS]
CS> Description             = FreeTDS v0.60
CS> Driver          = /usr/local/freetds/lib/libtdsodbc.so
CS> FileUsage               = 2


CS> sql.conf of radius
CS> --------------------
CS> driver = "rlm_sql_unixodbc"
CS>         # Connect info
CS>         server = MSSQL-6
CS>         login = "freeradius"
CS>         password = "something"
CS>         # Database table configuration
CS>         radius_db = "freeradius"


CS> Then I installed the odbc named "MSSQL-6" using:

CS> odbcinst -i -d -f odbcinst.ini
CS> odbcinst -i -s -f odbc.ini


CS> Making tests using "isql -v MSSQL-6 login MyPassword"
CS> works fine. I can manually update records in the MSSQL
CS> database.

CS> starting radius:

CS> radius connects fine to MSSQL  server as debug shows:

CS> rlm_sql: Driver rlm_sql_unixodbc loaded and linked
CS> rlm_sql: Attempting to connect to freeradius@MSSQL-6:/freeradius
CS> rlm_sql: starting 0
CS> rlm_sql:  Attempting to connect #0
CS> rlm_sql:  Connected new DB handle, #0
CS> rlm_sql: starting 1
CS> rlm_sql:  Attempting to connect #1
CS> rlm_sql:  Connected new DB handle, #1
CS> .

CS> .

CS> .



CS> However when radius trys to write accounting records to
CS> MSSQL I get the follwing errors:

CS> rlm_sql: Couldn't insert SQL accounting STOP record - 00000
CS> OR
CS> rlm_sql: Couldn't update SQL accounting for START packet - 00000


CS> extract of debug
CS> ------------------
CS> radius_xlat:  'dme'
CS> sql_set_user:  escaped user --> 'dme'
CS> radius_xlat:  'UPDATE radacct SET AcctStopTime = '2002-11-06 18:44:40',
AcctSessionTime = '127', AcctInputOctets = '2320', AcctOutputOctets =
'157339',
CS> AcctTerminateCause = 'User-Request', AcctStopDelay = '0',
ConnectInfo_stop = '' WHERE AcctSessionId = '7400315D' AND UserName = 'dme'
AND NASIPAddress =
CS> '212.24.192.4' AND AcctStopTime = 0'
CS> rlm_sql: Reserving sql socket id: 4
CS> radius_xlat:  'INSERT into radacct (AcctSessionId, AcctUniqueId,
UserName, Realm, NASIPAddress, NASPort, NASPortType, AcctStopTime,
AcctSessionTime,
CS> AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets,
AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause,
ServiceType,
CS> FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay)
values('7400315D', '', 'dme', '', '212.24.192.4', '34', 'ISDN', '2002-11-06
18:44:40',
CS> '127', 'RADIUS', '', '', '2320', '157339', '', '', 'User-Request',
'Framed-User', 'PPP', '212.24.192.101', '0', '0')'
CS> rlm_sql_unixodbc: '00000 '
CS> rlm_sql: Couldn't insert SQL accounting STOP record - 00000
CS> rlm_sql: Released sql socket id: 4
CS>   modcall[accounting]: module "sql" returns ok
CS> radius_xlat:  '/usr/local/var/log/radius/radacct/212.24.192.4/detail'
CS> 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
CS>   modcall[accounting]: module "detail" returns ok
CS>   modcall[accounting]: module "unix" returns ok
CS> radius_xlat:  'dme'
CS> Accounting: logout: entry for NAS 212.24.192.4 port 34 has wrong ID
CS>   modcall[accounting]: module "radutmp" returns ok
CS> modcall: group accounting returns ok
CS> Sending Accounting-Response of id 175 to 212.24.192.4:1118
CS> Finished request 0
CS> Going to the next request
CS> ---------------


CS> regards,
CS> 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


CS> -
CS> List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html


-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to