Do not send Accounting-Response

Strong, Mark mstrong at tnsi.com
Fri Jun 18 06:22:31 CEST 2021


>> Instead of "User-Name" is there a variable matching the "client" or NAS who we would be replying to (under normal circumstances).
>
>Read the debug output to see what the NAS is sending.
>
>Read the documentation and examples to see how to match packets based on source IP.
>
>Alan DeKok.

I did that, got it working.

        if ((NAS-IP-Address == "1.1.1.1") || (NAS-IP-Address == "1.1.1.2")) {
                if ("%{Called-Station-Id}" != "apn3") {
                        do_not_respond
                }
        }

However I was trying a pattern match prior that wouldn't work, something like;

        if ((NAS-IP-Address == "1.1.1.1") || (NAS-IP-Address == "1.1.1.2")) {
                if ("%{Called-Station-Id}"  =~ /apn1|apn2|apn4|apn5/) {
                        do_not_respond
                }
        }

Assuming Called-Station-Id = "apn3", I was hoping it would evaluate to false, but it was true (said radiusd -X)

Is there someway to do something like find string1 inside string2, I had a read thru the unlang doc and googled some examples, didn't find anything like that.


Mark.


________________________________

This e-mail message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information of Transaction Network Services.
Any unauthorized reviews, use, disclosure or distribution is prohibited. If you are not
the intended recipient, please contact the sender by reply e-mail and destroy all copies
of the original message.
---------------------------------------------------------------------------------------
 This email has been scanned for email related threats and delivered safely by Mimecast.
 For more information please visit http://www.mimecast.com
---------------------------------------------------------------------------------------


More information about the Freeradius-Users mailing list