Hi, im trying to configure a check that 1315 username will be allowed to connect only from a particular list of callinstationids, so i added a Calling-Station-Id attribute to the radcheck table, this are my filter's details username: 1315 list of callingstationids: - from 22662100 to 22662199 (this is a pbx) - 22793045 - 22934240 the attribute was entered like this: username: 1315 attribute: Calling-Station-Id Op: ~= Value: ^226621[0-9][0-9]$|^22793045$|^22934240$ But i always get acces denied: Tue Apr 18 15:38:04 2006 : Auth: Login incorrect: [1315/1315] (from client private-network port 0 cli 50322793045) Tue Apr 18 15:38:20 2006 : Info: rlm_sql (sql): No matching entry in the database for request from user [1315] Tue Apr 18 15:38:20 2006 : Auth: Login incorrect: [1315/1315] (from client private-network port 0 cli 50322793045) Tue Apr 18 15:39:09 2006 : Info: rlm_sql (sql): No matching entry in the database for request from user [1315] Tue Apr 18 15:39:09 2006 : Auth: Login incorrect: [1315/1315] (from client private-network port 0 cli 50322793045) Tue Apr 18 15:39:24 2006 : Info: rlm_sql (sql): No matching entry in the database for request from user [1315] Tue Apr 18 15:39:24 2006 : Auth: Login incorrect: [1315/1315] (from client private-network port 0 cli 50322793045) Is my regexp mistyped? or am i using the wrong op? thanks
Miguel <mmiranda@123.com.sv> writes:
Hi, im trying to configure a check that 1315 username will be allowed to connect only from a particular list of callinstationids, so i added a Calling-Station-Id attribute to the radcheck table, this are my filter's details
username: 1315
list of callingstationids: - from 22662100 to 22662199 (this is a pbx) - 22793045 - 22934240
the attribute was entered like this:
username: 1315 attribute: Calling-Station-Id Op: ~= Value: ^226621[0-9][0-9]$|^22793045$|^22934240$
But i always get acces denied: Tue Apr 18 15:38:04 2006 : Auth: Login incorrect: [1315/1315] (from client private-network port 0 cli 50322793045)
Looks like 503 is prepended to the value you expect in Calling-Station-Id. Maybe some prefix added by the PBX? You could either modify your regexp to allow any number ending in the 8 wanted digits, our explicitly allow 503 as prefix. Bjørn
Bjørn Mork wrote:
Miguel <mmiranda@123.com.sv> writes:
Hi, im trying to configure a check that 1315 username will be allowed to connect only from a particular list of callinstationids, so i added a Calling-Station-Id attribute to the radcheck table, this are my filter's details
username: 1315
list of callingstationids: - from 22662100 to 22662199 (this is a pbx) - 22793045 - 22934240
the attribute was entered like this:
username: 1315 attribute: Calling-Station-Id Op: ~= Value: ^226621[0-9][0-9]$|^22793045$|^22934240$
But i always get acces denied: Tue Apr 18 15:38:04 2006 : Auth: Login incorrect: [1315/1315] (from client private-network port 0 cli 50322793045)
Looks like 503 is prepended to the value you expect in Calling-Station-Id. Maybe some prefix added by the PBX?
you are right, its my fuault, i edited the info i sent to the list, please ignore the 503 prefix, it shouldnt be there.
You could either modify your regexp to allow any number ending in the 8 wanted digits,
How do i do that?, remberber that the fist group its a pbx, 100 callinstationids, i think i need some regexp example for this case. thanks
Miguel <mmiranda@123.com.sv> writes:
Bjørn Mork wrote:
You could either modify your regexp to allow any number ending in the 8 wanted digits,
How do i do that?, remberber that the fist group its a pbx, 100 callinstationids, i think i need some regexp example for this case.
Just removing the ^'s should do it. Like Value: 226621[0-9][0-9]$|22793045$|22934240$ Bjørn
Bjørn Mork wrote:
Miguel <mmiranda@123.com.sv> writes:
Bjørn Mork wrote:
You could either modify your regexp to allow any number ending in the 8 wanted digits,
How do i do that?, remberber that the fist group its a pbx, 100 callinstationids, i think i need some regexp example for this case.
Just removing the ^'s should do it. Like
Value: 226621[0-9][0-9]$|22793045$|22934240$
Bjørn, that regexp didnt work, i made a test with a generic user (mmiranda) and same result radius=# select * from radcheck where username = 'mmiranda'; id | username | attribute | op | value ---------+----------+--------------------+----+--------------------------------------- 1706382 | mmiranda | Calling-Station-Id | ~= | 226601[0-9][0-9]$|22793045$|22934240$ 1706381 | mmiranda | User-Password | == | americatel (2 rows) Wed Apr 19 11:32:14 2006 : Auth: Login incorrect: [mmiranda/americatel] (from client private-network port 0 cli 22660124) Wed Apr 19 11:32:15 2006 : Info: rlm_sql (sql): No matching entry in the database for request from user [mmiranda] Wed Apr 19 11:32:15 2006 : Auth: Login incorrect: [mmiranda/americatel] (from client private-network port 0 cli 22660124) Wed Apr 19 11:32:15 2006 : Info: rlm_sql (sql): No matching entry in the database for request from user [mmiranda] Wed Apr 19 11:32:15 2006 : Auth: Login incorrect: [mmiranda/americatel] (from client private-network port 0 cli 22660124) --- Miguel
Miguel <mmiranda@123.com.sv> writes:
radius=# select * from radcheck where username = 'mmiranda'; id | username | attribute | op | value ---------+----------+--------------------+----+--------------------------------------- 1706382 | mmiranda | Calling-Station-Id | ~= | 226601[0-9][0-9]$|22793045$|22934240$ 1706381 | mmiranda | User-Password | == | americatel (2 rows)
Wed Apr 19 11:32:14 2006 : Auth: Login incorrect: [mmiranda/americatel] (from client private-network port 0 cli 22660124) Wed Apr 19 11:32:15 2006 : Info: rlm_sql (sql): No matching entry in the database for request from user [mmiranda]
That's weird. I don't know the FreeRadius regexp internals, but the re work as expected when I test it with perl: bjorn@obelix:~$ perl -e 'foreach (@ARGV) {print "$_\n" if /226601[0-9][0-9]$|22793045$|22934240$/}' 22660124 22793045 50322793045 227930453 22666666 22660124 22793045 50322793045 Bjørn
participants (3)
-
Alan DeKok -
Bjørn Mork -
Miguel