Pool-Name from Called-Station-Id

Hugh Messenger hugh at alaweb.com
Tue May 15 23:39:47 CEST 2007



Ala DeKok said:

> DEFAULT	Called-Station-Id =~ "^(\w+_pppoe_\d+)$", Pool-Name :=
`%{1}`
> 
> \w && \d may not be supported by the regex library on your system.  You
> may have to use [a-fA-F] etc. explictely.

I don't seem to be able to get this to work.  This is my DEFAULT entry:

DEFAULT Called-Station-Id =~ "^([A-z0-9]+_pppoe_[0-9]+)$", Pool-Name :=
`%{1}`
        Framed-IP-Netmask = 255.255.0.0,
        Fall-Through = 1

... and it seems to be matching on authentication requests, as per this -X
fragment:

    users: Matched entry DEFAULT at line 162

... where line 162 is the above DEFAULT.  And I've triple checked my regexp
using my IDE's RX toolkit.  But sqlippool isn't picking up that pattern
match as the pool name:

rlm_sql_mysql: query:  SELECT FramedIPAddress FROM radippool   WHERE
pool_name = '' AND expiry_time < NOW()   ORDER BY pool_name, (UserName <>
'radiustest'), (CallingStationId <> '00:60:B3:45:6A:98'), expiry_time
LIMIT 1   FOR UPDATE
sqlippool_query1: SQL query did not return any results

If I replace the regexp version with a specific one, like ...

DEFAULT Called-Station-Id == "brantley_pppoe_141", Pool-Name :=
"brantley_pppoe_141"

... it all works fine.

> 
>   Alan DeKok.

   -- hugh





More information about the Freeradius-Users mailing list