Verifying framed-ip-address using unlang

Pshem Kowalczyk pshem.k at gmail.com
Mon Jan 14 21:24:01 CET 2008


Thx for your input. I guess I'll have to experiment a bit :-)

kind regards
Pshem

On 14/01/2008, Arran Cudbard-Bell <A.Cudbard-Bell at sussex.ac.uk> wrote:
> Alan DeKok wrote:
> > Pshem Kowalczyk wrote:
> >> Is it possible to use unlang to verify whether framed-ip-address is in
> >> the right range or not?
> >
> >   Yes and no.  The comparisons are not typed, so everything is a string.
> >
> >> We would like to use it on our wholesale proxies. Wholesale customers
> >> of ours are allowed to allocate IPs to their customers, but only from
> >> certain ranges. Will a normal comparison (> <) work with IP addresses?
> >
> >   They will "work", but they won't do IP-address comparison.
> >
> >   You can either do string comparisons, which will often do the right
> > thing, OR regular expressions, which will do the right thing if you
> > write them carefully.
>
> Sub Captures of regular expressions map onto variables %{1}-%{8}, so you
> can extract the individual octets of the IP address. So if you wanted to
> check multiple ranges, best thing is to extract the octets of the IP
> address and then do the comparison with normal < = > operators.
> >
> >   Alan DeKok.
> > -
> > List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>



More information about the Freeradius-Users mailing list