SQL NAS table

Guy Fraser guy at incentre.net
Tue Oct 25 19:06:20 CEST 2005


On Tue, 2005-25-10 at 12:52 -0400, Alex M wrote:
> Can some one point me to the documentation on use of SQL NAS table?
> 
> So that I can add nas devices to the DB and not a text file?
> 
...snip...

There has been discussion on this in the past, here is a 
message I sent as a response to this list, that might point 
you in the right direction.


---Copied message from archive---
On Thu, 2005-15-09 at 15:08 -0400, Alan DeKok wrote:
> > Am I to take it that it is not possible to use SQL for the
clients.conf
> > file? And if that it the case could someone please explain what the
nas
> > table is for in the database schema?
> 
>   It's possible.  You do need at least one entry in "clients.conf",
> though.  I suggest "127.0.0.1"
> 
>   Then, read "sql.conf", and set "readclients=yes"
> 
>   Alan DeKok.

Cool.

I am working with FreeBSD and the updates for 1.0.5 are not 
in the cvsup repository yet, so my comment is in regards to 
1.0.4, but may apply to 1.0.5.

I to a look at the postgresql stuff and it appears as though 
the schema will need a little tweak in order to be compitible 
with "rlm_sql.c"'s requirements.

A "SERIAL" column named Id will need to be added.

This will make it compatible :

-- SQL clients table
CREATE TABLE nas (
        id              SERIAL PRIMARY KEY,
        nasname         VARCHAR(128),
        shortname       VARCHAR(32) NOT NULL,
        type            VARCHAR(30),
        ports           int4,
        secret          VARCHAR(60) NOT NULL,
        community       VARCHAR(50),
        description     TEXT
);

This is not required, but this info used to be in the nas
table in the postgresql schema.

-- additional nas info table included in previous nas table
CREATE TABLE nas (
        id              int4 NOT NULL,
        ipaddr          INET PRIMARY KEY,
        snmp            VARCHAR(10),
        naslocation     VARCHAR(32)
);

---End of message---





More information about the Freeradius-Users mailing list