Cast type user-name

Alan DeKok aland at deployingradius.com
Sat Apr 16 15:44:37 UTC 2022


On Apr 15, 2022, at 8:30 PM, Bassem Mettichi <mettichi at gmail.com> wrote:
> 
> Hello ,
> Please could any one provide the unlang syntax to check if the
> request:user-name is of type ipv4addr or ipv6addr

  User-Name is a string.  You can use regular expression to see if the string matches an IPv4 or IPv6 address.

	if (User-Name =~ /regex/) {
		...
	}

  Alan DeKok.



More information about the Freeradius-Users mailing list