I am trying to set up mac-based authentication, and accounting using
freeradius and postgresql under linux. I've tried to read the
documentation and search through the list archive before posting, but if
I've missed something pointers to RTFM are always appreciated.
I'm in over my head, and I thank you in advance for any help you can
offer.
versions are:
radiusd: FreeRADIUS Version 0.9.1, for host i686-pc-linux-gnu, built on
Sep 12 2003 at 00:25:40
Linux localhost.localdomain 2.4.18-14 #1 Wed Sep 4 12:13:11 EDT 2002 i686
athlon i386 GNU/Linux
postgres (PostgreSQL) 7.2.2
I set up the database with
/freeradius-0.9.1/src/modules/rlm_sql/drivers/rlm_sql_postgresql/db_postgresql.sql
hopping into psql for a second:
radius=# select * from usergroup;
id | username | groupname
----+--------------+-----------
1 | fredf | radio
2 | 00022d284b47 | radio
(2 rows)
radius=# select * from radcheck;
id | username | attribute | op | value
----+--------------+-----------+----+--------------
1 | fredf | password | == | wilma
2 | 00022d284b47 | password | == | 00022d284b47
(2 rows)
freeradius now correctly authenticates users listed in the database. The
AP350 forms its request with the user-name and user-password set to the
mac address of the prospective client. fredf is for testing, as per the
howto linked in the rlm_sql doc file.
The problem shows itself when I try to set up accounting with the
database.
rad_recv: Accounting-Request packet from host 192.168.1.209:1108, id=101,
length=135
Acct-Status-Type = Alive
User-Name = "00022d284b47"
Acct-Session-Id = " 700011"
Acct-Authentic = Local
Acct-Input-Octets = 0
Acct-Output-Octets = 205
Acct-Input-Packets = 0
Acct-Output-Packets = 0
Acct-Session-Time = 77
NAS-Port = 37
Calling-Station-Id = "00022d284b47"
NAS-Identifier = "test-network-ap"
NAS-IP-Address = 192.168.1.209
Acct-Delay-Time = 0
rlm_sql (sql): Reserving sql socket id: 0
rlm_sql_postgresql: query: UPDATE radacct SET FramedIPAddress = '' WHERE
AcctSessionId = ' 700011' AND UserName = '00022d284b47' AND NASIPAddress=
'192.168.1.209' AND AcctStopTime = 0
rlm_sql_postgresql: Status: PGRES_FATAL_ERROR
rlm_sql_postgresql: affected rows =
rlm_sql_postgresql: Postgresql check_error: PGRES_FATAL_ERROR, returning
SQL_DOWN
rlm_sql (sql): Attempting to connect rlm_sql_postgresql #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql_postgresql: query: UPDATE radacct SET FramedIPAddress = '' WHERE
AcctSessionId = ' 700011' AND UserName = '00022d284b47' AND NASIPAddress=
'192.168.1.209' AND AcctStopTime = 0
rlm_sql_postgresql: Status: PGRES_FATAL_ERROR
rlm_sql_postgresql: affected rows =
rlm_sql_postgresql: Postgresql check_error: PGRES_FATAL_ERROR, returning
SQL_DOWN
rlm_sql (sql): failed after re-connect
rlm_sql (sql): Couldn't update SQL accounting for ALIVE packet - ERROR:
invalid INET value ''
rlm_sql (sql): Released sql socket id: 0
The SQL server spits out:
ERROR: Bad int8 external representation ""
ERROR: Bad int8 external representation ""
ERROR: invalid INET value ''
ERROR: invalid INET value ''
ERROR: invalid INET value ''
ERROR: invalid INET value ''
So, I try doing the query by hand...
I've convinced myself (by removing columns from the request) that the
SQL server is unhappy with the empty strings it's being passed.
So, here's the actual question...
1) Is there something I've done horibly wrong, and if so what?
3) Should I abandon posgresql? If so, what should I look to replace it?
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html