Hi, I use the huntgroup text file for my NAS myshare NAS-IP-Address == 192.168.102.43 and now I would like to do a check in sites-enabled/default post-auth { (0) if ("%{Huntgroup-Name}" == "myshare") { (0) ERROR: Failed retrieving values required to evaluate condition (0) else { How could I access/or is there a variable with the name of the huntgroup? There are only examples using sql :(. Thanks + Regards Carsten
run in debug mode and see what is populated and how at that point, On 1 February 2018 at 12:28, Carsten Schulze <carsten.schulze@leuphana.de> wrote:
Hi,
I use the huntgroup text file for my NAS
myshare NAS-IP-Address == 192.168.102.43
and now I would like to do a check in sites-enabled/default
post-auth { (0) if ("%{Huntgroup-Name}" == "myshare") { (0) ERROR: Failed retrieving values required to evaluate condition (0) else {
How could I access/or is there a variable with the name of the huntgroup? There are only examples using sql :(.
Thanks + Regards Carsten
- List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
On Feb 1, 2018, at 7:28 AM, Carsten Schulze <carsten.schulze@leuphana.de> wrote:
I use the huntgroup text file for my NAS
myshare NAS-IP-Address == 192.168.102.43
and now I would like to do a check in sites-enabled/default
post-auth { (0) if ("%{Huntgroup-Name}" == "myshare") {
Read the debug output. ALL OF IT. Does the input packet contain NAS-IP-Address? Is the "preprocess" module finding that match in the "huntgroups" file? And the examples DON'T show using %{Huntgroup-Name} to get the name of the hunt group. They DO show using just the attribute reference: if (Huntgroup-Name == "myshare") { I've never understood the need to put %{...} around every attribute name. Why? The documentation and examples don't do this.
How could I access/or is there a variable with the name of the huntgroup? There are only examples using sql :(.
Follow the documentation. Read the debug output. That solves 99% of peoples problems. Alan DeKok.
Hi Am 01.02.2018 um 13:51 schrieb Alan DeKok:
On Feb 1, 2018, at 7:28 AM, Carsten Schulze <carsten.schulze@leuphana.de> wrote:
I use the huntgroup text file for my NAS
myshare NAS-IP-Address == 192.168.102.43
and now I would like to do a check in sites-enabled/default
post-auth { (0) if ("%{Huntgroup-Name}" == "myshare") { Read the debug output. ALL OF IT. I did, thats all
Does the input packet contain NAS-IP-Address? No, i thought it is done by the huntgroup file over the == operator
Is the "preprocess" module finding that match in the "huntgroups" file? yes
# Loading module "preprocess" from file /etc/freeradius/3.0/mods-enabled/preprocess preprocess { huntgroups = "/etc/freeradius/3.0/mods-config/preprocess/huntgroups" hints = "/etc/freeradius/3.0/mods-config/preprocess/hints"
And the examples DON'T show using %{Huntgroup-Name} to get the name of the hunt group. They DO show using just the attribute reference:
Yes, but they define HuntGroup as local variable, or not? And the use '%{NAS-IP-Address}' as well <---- |update request { Huntgroup-Name := "%{sql:SELECT groupname FROM radhuntgroup WHERE nasipaddress='%{NAS-IP-Address}'}" } ----> |
if (Huntgroup-Name == "myshare") {
I've never understood the need to put %{...} around every attribute name. Why? The documentation and examples don't do this.
I think you need it to access global variables?
How could I access/or is there a variable with the name of the huntgroup? There are only examples using sql :(. Follow the documentation. Read the debug output. That solves 99% of peoples problems.
There is no docu about huntgroups and the huntgroup file!
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Mit freundlichen Grüßen Dipl. Inform. (FH) Carsten Schulze Medien- und Informationszentrum (MIZ) Leuphana Universität Lüneburg Universitätsallee 1, C7.217 21335 Lüneburg Fon 04131.677-1241 Fax 04131.677-1246
On Feb 1, 2018, at 8:01 AM, Carsten Schulze <carsten.schulze@leuphana.de> wrote:
Read the debug output. ALL OF IT. I did, thats all
The answers are in the debug output.
Does the input packet contain NAS-IP-Address? No, i thought it is done by the huntgroup file over the == operator
i.e. you didn't understand my question. The input packet is the Access-Request that is printed in the debug output. Does the debug output print something like "received Access-Request"? Does the debug output print a list of attributes and values after that? Is one of those attributes NAS-IP-Address? If so, what is the value of NAS-IP-Address?
Is the "preprocess" module finding that match in the "huntgroups" file? yes
# Loading module "preprocess" from file /etc/freeradius/3.0/mods-enabled/preprocess preprocess { huntgroups = "/etc/freeradius/3.0/mods-config/preprocess/huntgroups" hints = "/etc/freeradius/3.0/mods-config/preprocess/hints"
No. That is the server LOADING the hunt groups file. If you READ THE DEBUG OUTPUT, you will see if receiving an Access-Request packet (SEE ABOVE). You will ALSO see it running the "preprocess" module. The "preprocess" module will print out what it matches, if anything.
And the examples DON'T show using %{Huntgroup-Name} to get the name of the hunt group. They DO show using just the attribute reference: Yes, but they define HuntGroup as local variable, or not? And the use '%{NAS-IP-Address}' as well
Instead of listening and paying attention, you're arguing. Stop it. You don't need to use %{...} for attributes in "if" conditions. The examples and "unlang" documentation don't do this.
<----
|update request { Huntgroup-Name := "%{sql:SELECT groupname FROM radhuntgroup WHERE nasipaddress='%{NAS-IP-Address}'}" } ----> |
That's something different. You can: a) believe you got it wrong, and I have SOME idea what I'm talking about, or b) believe I'm an idiot and/or lying to you, and they you understand things better than me, Do you want to fix the problem, or do you want to argue about details?
I've never understood the need to put %{...} around every attribute name. Why? The documentation and examples don't do this. I think you need it to access global variables?
I just said you don't need to do that. I just said that the documentation and examples don't do this. Again, you can LEARN from someone who's trying to help you, or you can reject my attempts to help you and fail to solve the problem.
How could I access/or is there a variable with the name of the huntgroup? There are only examples using sql :(. Follow the documentation. Read the debug output. That solves 99% of peoples problems. There is no docu about huntgroups and the huntgroup file!
That's just not true. If you do a google search (or even the wiki) for "FreeRADIUS huntgroups", you can easily find documentation. It's really simple. You can either pay attention and fix the problem, or argue with me and don't fix it. The choice is yours. Alan DeKok.
Hi again, I thought the NAS-IP-Address is always the real IP of the server, but it was not, a differnet IP was sent by the client.
The answers are in the debug output.
Does the input packet contain NAS-IP-Address? No, i thought it is done by the huntgroup file over the == operator i.e. you didn't understand my question.
The input packet is the Access-Request that is printed in the debug output.
Does the debug output print something like "received Access-Request"?
Does the debug output print a list of attributes and values after that?
Is one of those attributes NAS-IP-Address?
If so, what is the value of NAS-IP-Address? ok I got it:
(0) Received Access-Request Id 1 from 192.168.102.43:55900 to 192.168.102.145:1812 length 59 (0) NAS-IP-Address = 192.168.102.43
You don't need to use %{...} for attributes in "if" conditions. The examples and "unlang" documentation don't do this.
Yes, your are right. But I dont know the differences. Works perfect now :) (0) if (Huntgroup-Name == "myshare") { (0) if (Huntgroup-Name == "myshare") -> TRUE Thanks Carsten
participants (3)
-
Alan Buxey -
Alan DeKok -
Carsten Schulze