Matching a prefix in huntgroups file
Alan DeKok
aland at deployingradius.com
Fri Nov 4 17:59:41 CET 2016
On Nov 4, 2016, at 12:57 PM, Brian Candler <b.candler at pobox.com> wrote:
>
> On 04/11/2016 16:31, Brian Candler wrote:
>> But it won't match the supplied NAS-IP-Address. I have no problem with a simple == condition matching a single IP address though.
>
> Supplementary question: I see in http://freeradius.org/press/ for freeradius 3.0.11:
>
> * "unlang" comparisons of IP addresses to IP prefixes are now
> detected, and types automatically cast.
>
> But does that mean you can test for an IP address being within a prefix? If so, which operator would you use? I tried:
>
> if (&NAS-IP-Address == 10.254.0.0/16) { ...
That should work. There are tests for it.
Or, just cast NAS-IP-Address to <ipv4prefix>
> but got no match. A string expansion works though:
>
> if ("%{NAS-IP-Address}" =~ /^10\.254\./) { ...
Which is also hugely slower, and less flexible.
Alan DeKok.
More information about the Freeradius-Users
mailing list