Greeting. I found something strange in dictionary work. 1. I have next sql query for radreply: "SELECT 1 id, '%{SQL-User-Name}' username, 'Cisco-Account-Info' attribute, 'AOPEN_DNS' value, '=' op from TABLE(SET {1}) \ union \ SELECT 2 id, '%{SQL-User-Name}' username, 'Cisco-Account-Info' attribute, 'AL4REDIRECT_SERVICE' value, '+=' op from TABLE(SET {1})" When user authenticate is successfull - FR send Access-Accept packet to cisco device:
Sending Access-Accept of id 201 to 10.10.10.1 port 1645 Cisco-Account-Info = "AOPEN_DNS" Cisco-Account-Info += "AL4REDIRECT_SERVICE"
Everything work fine. 2. But when i want to send Cisco-AVPair attribute to cisco: "SELECT 1 id, '%{SQL-User-Name}' username, 'Cisco-Account-Info' attribute, 'AOPEN_DNS' value, '=' op from TABLE(SET {1}) \ union \ SELECT 2 id, '%{SQL-User-Name}' username, 'Cisco-Account-Info' attribute, 'AL4REDIRECT_SERVICE' value, '+=' op from TABLE(SET {1})" union \ SELECT 3 id, '%{SQL-User-Name}' username, 'Cisco-AVPair' attribute, 'ip:addr-pool=pool1' value, '=' op from TABLE(SET {1})" I get next error: Error: rlm_sql: Failed to create the pair: Unknown attribute "Cisco-AVPair " requires a hex string, not "ip:addr-pool=pool1" I check dictionary.cisco:
#cat /usr/share/freeradius/dictionary.cisco | egrep "Info|AVP" ATTRIBUTE Cisco-AVPair 1 string ATTRIBUTE Cisco-Account-Info 250 string ATTRIBUTE Cisco-Service-Info 251 string ATTRIBUTE Cisco-Control-Info 253 string
Attributes exists, but error occure. Please explain me, where the mistake.
On 13 May 2015, at 07:53, vanish <vanishox@coltel.ru> wrote:
Error: rlm_sql: Failed to create the pair: Unknown attribute "Cisco-AVPair " requires a hex string, not "ip:addr-pool=pool1"
Looks like you have whitespace after Cisco-AVPair Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
arr2036, thank you for your answer. You are right! I use unixodbc driver for Informix DB connection. I checked my query in isql (CLI for unixodbc) and got next result: +------------+---------+-------------------+--------------------+---+ | id | username| attribute | value | op| +------------+---------+-------------------+--------------------+---+ | 1 | test | Cisco-Account-Info| AOPEN_DNS | = | | 2 | test | Cisco-Account-Info| AL4REDIRECT_SERVICE| +=| | 3 | test | Cisco-AVPair"____"| ip:addr-pool=pool1 | +=| +------------+---------+-------------------+--------------------+---+ The error appeared because unixodbc-driver returned an attribute Cisco-AVPair in 3-rd row as "Cisco-AVPair"+"____" (where "_" = whitespace) TRIM('Cisco-AVPair') sql function helped me.
participants (2)
-
Arran Cudbard-Bell -
vanish