Matching a prefix in huntgroups file

Brian Candler b.candler at pobox.com
Fri Nov 4 17:57:25 CET 2016


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) { ...

but got no match. A string expansion works though:

     if ("%{NAS-IP-Address}" =~ /^10\.254\./) { ...

Thanks,

Brian.



More information about the Freeradius-Users mailing list