6 Dec
2017
6 Dec
'17
3:26 p.m.
On 4 Dec 2017, at 15:10, Matthew Newton <mcn@freeradius.org> wrote:
On Mon, 2017-12-04 at 15:05 +0000, Paul Thornton wrote:
if ((&request:NAS-IP-Address =~ /^192.168.0.3[2-9]/) || (&request:NAS-IP-Address =~ /^192.168.0.[45][0-9]/) || (&request:NAS-IP-Address =~ /^192.168.0.6[0-3]/)) { ... do stuff }
This is a check for "Is the NAS-IP-Address in 192.168.0.32/27"?
Is there a neater way to do this? - the obvious option: if (&request:NAS-IP-Address == 192.168.0.32/27) {
if (NAS-IP-Address < "192.168.0.32/27") { ... }
You need to cast NAS-IP-Address to the IPv4 prefix type I think?