Introduction to unlang
The unlang language available in FreeRADIUS takes flexibility in authorization to new heights. Unlang is not a full blown programming language, but rather a processing language. The purpose of unlang is to implement policies and not to replace complex scripts like those created with Perl or Python. Unlang sticks to a basic syntax that includes conditional statements and manipulation of variables. The unlang code does not get compiled but is interpreted by the FreeRADIUS server. The interpretation happens when the server reads the configuration files, which typically happens during start-up. The use of unlang is restricted to specified sections inside the configuration files and cannot be used inside the modules.
A key feature of unlang is the ability to use conditional statements to control the process which handles the request.
Note
FreeRADIUS installs a man page for unlang, which you can consult:
$>man unlang
We will demonstrate the use of various conditional statements...