FreeRADIUS + MySQL + DHCP Opt82

IVB ivb at is.ua
Mon Apr 2 12:49:53 CEST 2012


Alan DeKok-2 wrote
> 
>   You can't put binary data into an ASCII "string" field.
> 

But that was my question!

FreeRADIUS offers following schema for radcheck table:

CREATE TABLE radcheck (
  id int(11) unsigned NOT NULL auto_increment,
  username varchar(64) NOT NULL default '',
  attribute varchar(64)  NOT NULL default '',
  op char(2) NOT NULL DEFAULT '==',
  value varchar(253) NOT NULL default '',
  PRIMARY KEY  (id),
  KEY username (username(32))
) ;

So it expects attribute value as varchar.

The question is:

How I can put Opt82 attributes (which contains non-printable bytes) into
database to offer it later for FreeRADIUS using SELECT statement?

INSERT INTO
  `radcheck` ( `UserName`, `Attribute`, `Value`, `op` )
VALUES
  ( '00:12:23:56:78:9A', 'Cleartext-Password', 'Redback', ':=' ),
  ( '00:12:23:56:78:9A', 'Agent-Circuit-ID', ?????, '==' ),
  ( '00:12:23:56:78:9A', 'Agent-Remote-ID', ?????, '==' )

What I must put in place of ????? to be correctly accepted by Radius in
following SELECT:

SELECT
  `id`,
  `UserName`,
  `Attribute`,
  `Value`,
  `op`
FROM
  `radcheck`
WHERE
  `UserName` = '00:12:23:56:78:9A'


--
View this message in context: http://freeradius.1045715.n5.nabble.com/FreeRADIUS-MySQL-DHCP-Opt82-tp5606148p5612096.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.


More information about the Freeradius-Users mailing list