Parsing Value with External Script
I have a question. I need to pass a value to Framed-Pool attribute only to one user, using an external script. My file /etc/freeradius/users user_test Cleartext-Password := "testing" Auth-Type := Accept Framed-Protocol = PPP Framed-Pool = `%{exec:/bin/echo foo}` Fall-Through = Yes It's not working. What it's happening? Using the freeradius debug the Framed-Pool attribute is appearing empty.
Why would you want to use an external script. If it's a fixed value per user then why not use files. Then have that match to the user and return the value you want. mods-config/files/authorize ---- test_user Framed-Pool := Foovalue ---- Then you call files when you need to. I tend to avoid calling external scripts as they are slow and if they crash or memory leak for whatever reason it can take down your whole server. On 8/07/2017 09:01, "Jean Tomaz" <jean_ts@hotmail.com> wrote: I have a question. I need to pass a value to Framed-Pool attribute only to one user, using an external script. My file /etc/freeradius/users user_test Cleartext-Password := "testing" Auth-Type := Accept Framed-Protocol = PPP Framed-Pool = `%{exec:/bin/echo foo}` Fall-Through = Yes It's not working. What it's happening? Using the freeradius debug the Framed-Pool attribute is appearing empty. - List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
Hi, Peter. I don't found mods-config/files/authorize. Only I found the /etc/freeradius/modules/files. It's this file? My freeradius version is 2.2.5 2017-07-08 0:59 GMT-03:00 Peter Lambrechtsen <peter@crypt.nz>:
Why would you want to use an external script. If it's a fixed value per user then why not use files. Then have that match to the user and return the value you want.
mods-config/files/authorize ---- test_user Framed-Pool := Foovalue
----
Then you call files when you need to.
I tend to avoid calling external scripts as they are slow and if they crash or memory leak for whatever reason it can take down your whole server.
On 8/07/2017 09:01, "Jean Tomaz" <jean_ts@hotmail.com> wrote:
I have a question. I need to pass a value to Framed-Pool attribute only to one user, using an external script.
My file /etc/freeradius/users
user_test Cleartext-Password := "testing" Auth-Type := Accept Framed-Protocol = PPP Framed-Pool = `%{exec:/bin/echo foo}` Fall-Through = Yes
It's not working. What it's happening?
Using the freeradius debug the Framed-Pool attribute is appearing empty. - List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
It's a reply attribute. Use radreply table, same way as yiu would use it
for framed ip address.
On Sat, Jul 8, 2017, 12:29 Jean Tomaz <jean_ts@hotmail.com> wrote:
> Hi, Peter.
>
> I don't found mods-config/files/authorize.
>
> Only I found the /etc/freeradius/modules/files. It's this file?
>
> My freeradius version is 2.2.5
>
>
>
> 2017-07-08 0:59 GMT-03:00 Peter Lambrechtsen <peter@crypt.nz>:
>
> > Why would you want to use an external script. If it's a fixed value per
> > user then why not use files. Then have that match to the user and return
> > the value you want.
> >
> > mods-config/files/authorize
> > ----
> > test_user Framed-Pool := Foovalue
> >
> > ----
> >
> > Then you call files when you need to.
> >
> > I tend to avoid calling external scripts as they are slow and if they
> crash
> > or memory leak for whatever reason it can take down your whole server.
> >
> >
> > On 8/07/2017 09:01, "Jean Tomaz" <jean_ts@hotmail.com> wrote:
> >
> > I have a question.
> > I need to pass a value to Framed-Pool attribute only to one user, using
> an
> > external script.
> >
> > My file /etc/freeradius/users
> >
> > user_test Cleartext-Password := "testing"
> > Auth-Type := Accept
> > Framed-Protocol = PPP
> > Framed-Pool = `%{exec:/bin/echo foo}`
> > Fall-Through = Yes
> >
> > It's not working. What it's happening?
> >
> > Using the freeradius debug the Framed-Pool attribute is appearing empty.
> > -
> > List info/subscribe/unsubscribe? See http://www.freeradius.org/
> > list/users.html
> > -
> > List info/subscribe/unsubscribe? See http://www.freeradius.org/
> > list/users.html
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
Thanks, Guy.
But, I don't want to use mysql (ippool).
I want to work with my dhcpclient program to topology bellow.
[Client PPPoE] <---> [NAS PPPoE] <----> [FreeRadius]<------>[DHCP Server]
2017-07-08 7:44 GMT-03:00 A Guy <sigor@blic.net>:
> It's a reply attribute. Use radreply table, same way as yiu would use it
> for framed ip address.
>
> On Sat, Jul 8, 2017, 12:29 Jean Tomaz <jean_ts@hotmail.com> wrote:
>
> > Hi, Peter.
> >
> > I don't found mods-config/files/authorize.
> >
> > Only I found the /etc/freeradius/modules/files. It's this file?
> >
> > My freeradius version is 2.2.5
> >
> >
> >
> > 2017-07-08 0:59 GMT-03:00 Peter Lambrechtsen <peter@crypt.nz>:
> >
> > > Why would you want to use an external script. If it's a fixed value per
> > > user then why not use files. Then have that match to the user and
> return
> > > the value you want.
> > >
> > > mods-config/files/authorize
> > > ----
> > > test_user Framed-Pool := Foovalue
> > >
> > > ----
> > >
> > > Then you call files when you need to.
> > >
> > > I tend to avoid calling external scripts as they are slow and if they
> > crash
> > > or memory leak for whatever reason it can take down your whole server.
> > >
> > >
> > > On 8/07/2017 09:01, "Jean Tomaz" <jean_ts@hotmail.com> wrote:
> > >
> > > I have a question.
> > > I need to pass a value to Framed-Pool attribute only to one user, using
> > an
> > > external script.
> > >
> > > My file /etc/freeradius/users
> > >
> > > user_test Cleartext-Password := "testing"
> > > Auth-Type := Accept
> > > Framed-Protocol = PPP
> > > Framed-Pool = `%{exec:/bin/echo foo}`
> > > Fall-Through = Yes
> > >
> > > It's not working. What it's happening?
> > >
> > > Using the freeradius debug the Framed-Pool attribute is appearing
> empty.
> > > -
> > > List info/subscribe/unsubscribe? See http://www.freeradius.org/
> > > list/users.html
> > > -
> > > List info/subscribe/unsubscribe? See http://www.freeradius.org/
> > > list/users.html
> > -
> > List info/subscribe/unsubscribe? See
> > http://www.freeradius.org/list/users.html
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/
> list/users.html
>
Hi, Peter. I will not use the fixed value. This script is only a test. I will change the script to work with my dhcpclient program to topology bellow. [Client PPPoE] <---> [NAS PPPoE] <----> [FreeRadius]<------>[DHCP Server] Thanks 2017-07-08 7:29 GMT-03:00 Jean Tomaz <jean_ts@hotmail.com>:
Hi, Peter.
I don't found mods-config/files/authorize.
Only I found the /etc/freeradius/modules/files. It's this file?
My freeradius version is 2.2.5
2017-07-08 0:59 GMT-03:00 Peter Lambrechtsen <peter@crypt.nz>:
Why would you want to use an external script. If it's a fixed value per user then why not use files. Then have that match to the user and return the value you want.
mods-config/files/authorize ---- test_user Framed-Pool := Foovalue
----
Then you call files when you need to.
I tend to avoid calling external scripts as they are slow and if they crash or memory leak for whatever reason it can take down your whole server.
On 8/07/2017 09:01, "Jean Tomaz" <jean_ts@hotmail.com> wrote:
I have a question. I need to pass a value to Framed-Pool attribute only to one user, using an external script.
My file /etc/freeradius/users
user_test Cleartext-Password := "testing" Auth-Type := Accept Framed-Protocol = PPP Framed-Pool = `%{exec:/bin/echo foo}` Fall-Through = Yes
It's not working. What it's happening?
Using the freeradius debug the Framed-Pool attribute is appearing empty. - List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/list /users.html
On Jul 7, 2017, at 5:00 PM, Jean Tomaz <jean_ts@hotmail.com> wrote:
I have a question. I need to pass a value to Framed-Pool attribute only to one user, using an external script.
My file /etc/freeradius/users
user_test Cleartext-Password := "testing" Auth-Type := Accept Framed-Protocol = PPP Framed-Pool = `%{exec:/bin/echo foo}` Fall-Through = Yes
It's not working. What it's happening?
Read the debug log to see.
Using the freeradius debug the Framed-Pool attribute is appearing empty.
The debug log shows what's going on. If you don't understand it, post it here. Alan DeKok.
Hi, Alan The debug output is bellow. I'm using the command bellow radtest user_test testing 127.0.0.1 1812 testing123 ----------------------------------------------------------------------------------------------------------------------------------------- rad_recv: Access-Request packet from host 127.0.0.1 port 41548, id=208, length=79 User-Name = "user_test" User-Password = "testing" NAS-IP-Address = 127.0.1.1 NAS-Port = 1812 Message-Authenticator = 0x59adc08295f31c2eeb3e7b1b5e7c71bd # Executing section authorize from file /etc/freeradius/sites-enabled/default +group authorize { ++[preprocess] = ok ++[chap] = noop ++[mschap] = noop ++[digest] = noop [suffix] No '@' in User-Name = "user_test", looking up realm NULL [suffix] No such realm "NULL" ++[suffix] = noop [eap] No EAP-Message, not doing EAP ++[eap] = noop [files] users: Matched entry user_test at line 334 rlm_exec (exec): 'wait' must be enabled to use exec xlat [files] expand: %{exec:/bin/echo foo} -> ++[files] = ok ++[expiration] = noop ++[logintime] = noop ++[pap] = updated +} # group authorize = updated Found Auth-Type = PAP # Executing group from file /etc/freeradius/sites-enabled/default +group PAP { [pap] login attempt with password "testing" [pap] Using clear text password "testing" [pap] User authenticated successfully ++[pap] = ok +} # group PAP = ok Login OK: [user_test] (from client localhost port 1812) # Executing section post-auth from file /etc/freeradius/sites-enabled/default +group post-auth { ++[exec] = noop +} # group post-auth = noop Sending Access-Accept of id 208 to 127.0.0.1 port 41548 Service-Type = Framed-User Framed-Protocol = PPP Framed-Pool = "" Finished request 0. Going to the next request Waking up in 4.9 seconds. Cleaning up request 0 ID 208 with timestamp +5 Ready to process requests. ---------------------------------------------------------------------------------------------------------------------------------------- Thanks 2017-07-08 10:17 GMT-03:00 Alan DeKok <aland@deployingradius.com>:
On Jul 7, 2017, at 5:00 PM, Jean Tomaz <jean_ts@hotmail.com> wrote:
I have a question. I need to pass a value to Framed-Pool attribute only to one user, using
an
external script.
My file /etc/freeradius/users
user_test Cleartext-Password := "testing" Auth-Type := Accept Framed-Protocol = PPP Framed-Pool = `%{exec:/bin/echo foo}` Fall-Through = Yes
It's not working. What it's happening?
Read the debug log to see.
Using the freeradius debug the Framed-Pool attribute is appearing empty.
The debug log shows what's going on. If you don't understand it, post it here.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
Salutations, Matthew After change wait option to "yes" in the file /etc/freeradius/modules/exec, my program is working. exec { wait = yes input_pairs = request shell_escape = yes output = none timeout = 10 } I'm grateful Nice week. =) 2017-07-08 11:44 GMT-03:00 Matthew Newton <matthew@newtoncomputing.co.uk>:
On 8 July 2017 15:36:28 BST, Jean Tomaz <jean_ts@hotmail.com> wrote:
[files] users: Matched entry user_test at line 334 rlm_exec (exec): 'wait' must be enabled to use exec xlat
Here. Enable the wait option for exec.
-- Matthew
- List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
participants (5)
-
A Guy -
Alan DeKok -
Jean Tomaz -
Matthew Newton -
Peter Lambrechtsen