1 FreeRADIUS supports the Acct-Type attribute to select between
2 accounting methods based on arbitrary attribute/value pairs contained
3 in an accounting packet. Its use follows the same general configuration
4 syntax as Auth-Type and Autz-Type. The main difference in configuration
5 between Acct-Type and Auth/Autz-Type lies in where the Acct-Type
6 method is assigned. With Auth/Autz-Type, the method is typically
7 assigned in the 'users' file. The 'users' file, naturally, is not
8 processed during the handling of the accounting {} section. However,
9 part of the default files {} module is the 'acct_users' file, which
10 serves the same purpose as the 'users' file, but applies to accounting
13 Like Autz-Type, if a module changes Acct-Type, after the current
14 selection of modules has been run, the section is reexamined for
15 a subsection matching the new Acct-Type.
17 For example, a server administrator is responsible for handling the
18 accounting data for two different realms, foo.com and bar.com, and
19 wishes to use different instances of the SQL module for each. In
20 addition, there is one RADIUS client sending accounting data that is
21 to be logged only to a specific detail file. Everything else should
22 use a third SQL instance.
25 The acct_users file would look something like this:
28 DEFAULT Realm == "foo.com", Acct-Type := "SQLFOO"
30 DEFAULT Realm == "bar.com", Acct-Type := "SQLBAR"
32 DEFAULT Client-IP-Address == "10.0.0.1", Acct-Type := "OTHERNAS"
37 $INCLUDE ${confdir}/sql0.conf # Instance named 'sql0'.
38 $INCLUDE ${confdir}/sql1.conf # Instance named 'sql1'.
39 $INCLUDE ${confdir}/sql2.conf # Instance named 'sql2'.
42 detailfile = ${radacctdir}/10.0.0.1/detail-%Y%m%d
46 suffix # Add the Realm A/V pair.
47 files # Add the Acct-Type A/V pair based on the Realm A/V pair.
52 # If Acct-Type is SQLFOO use the 'sql1' instance of the SQL module.
58 # If Acct-Type is SQLBAR, use the 'sql2' instance of the SQL module.
64 # If Acct-Type is OTHERNAS, use the 'othernas' instance of the detail
71 # If we've made it this far, we haven't matched an Acct-Type, so use