Hi, Is it possible to use unlang to verify whether framed-ip-address is in the right range or not? 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? Or do I have to use one of 'real' languages for that? kind regards Pshem
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. Alan DeKok.
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
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@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
participants (3)
-
Alan DeKok -
Arran Cudbard-Bell -
Pshem Kowalczyk