1 The variables defined by the server are:
3 %{Attribute-Name} Corresponding value for Attribute-Name
5 %{request:Attribute-Name} Corresponding value for Attribute-Name
7 %{reply:Attribute-Name} Corresponding value for Attribute-Name
9 %{proxy-reply:Attribute-Name} Corresponding value for Attribute-Name
10 in the proxy reply (if it exists)
12 %{config:section.subsection.item} Corresponding value in 'radiusd.conf'
13 for the string value of that item.
15 The %{config:...} variables should be used VERY carefully, as they
16 may leak secret information from your RADIUS server, if you use them
17 in reply attributes to the NAS!
21 %{User-Name} The string value of the User-Name attribute.
22 %{proxy-reply:Framed-Protocol} The string value of the Framed-Protocol
23 attribute, from the proxy reply.
24 %{config:modules.unix.passwd} The string value of the 'passwd' configuration
25 item in the 'unix' module, in the 'modules'
26 section of radiusd.conf.
28 Additionally, you can use conditional syntax similar to ${foo:-bar} as
29 defined in 'sh'. For example:
32 When attribute Foo is set: returns value of Foo
33 When attribute Foo unset: returns literal string 'bar'
36 When attribute Foo is set: returns value of attribute Foo
37 When attribute Foo unset: returns value of attribute Bar (if any)
39 3. %{Foo:-%{bar:-baz}}
40 When attribute Foo is set: returns value of attribute Foo
41 When attribute Foo unset: returns value of attribute Bar (if any)
42 When attribute Bar unset: returns literal string 'baz'
45 When calling an external program (e.g. from Exec-Program-Wait), these
46 variables can be passed on the command line to the program. In
47 addition, the server places all of the attributes in the RADIUS
48 request into environment variables for the external program. The
49 variables are renamed under the following rules:
51 1. All letters are made upper-case.
53 2. All hyphens '-' are turned into underscores '_'
55 so the attribute User-Name can be passed on the command line to the
56 program as %{User-Name}, or used inside the program as the environment
57 variable USER_NAME (or $USER_NAME for shell scripts).
59 If you want to see the list of all of the variables, try adding a line
60 'printenv > /tmp/exec-program-wait' to the script. Then look in the
61 file for a complete list of variables.
63 The following one-character variables are also defined. However, they
64 are duplicates of the previous general cases, and are only provided
65 for backwards compatibility. They WILL BE removed in a future
66 release. They also do NOT permit the use of conditional syntax
67 (':-'), as described above.
70 Variable Description Proper Equivalent
71 -------- ----------- ----------------
72 %a Protocol (SLIP/PPP) %{Framed-Protocol}
73 %c Callback-Number %{Callback-Number}
75 %f Framed IP address %{Framed-IP-Address}
76 %i Calling Station ID %{Calling-Station-Id}
79 %n NAS IP address %{NAS-IP-Address}
80 %p Port number %{NAS-Port-Id}
81 %s Speed (PW_CONNECT_INFO) %{Connect-Info}
82 %t request in ctime format
83 %u User name %{User-Name}
84 %A radacct_dir %{config:radacctdir}
86 %D request date (YYYYMMDD)
88 %L radlog_dir %{config:logdir}
90 %R radius_dir %{config:raddbdir}
95 %U Stripped User name %{Stripped-User-Name}
96 %V Request-Authenticator
98 %Y request year (YYYY)
99 %Z All request attributes
101 (must have a big buffer)