+Acct-Type
+=========
+
FreeRADIUS supports the Acct-Type attribute to select between
accounting methods based on arbitrary attribute/value pairs contained
in an accounting packet. Its use follows the same general configuration
to be logged only to a specific detail file. Everything else should
use a third SQL instance.
-The acct_users file would look something like this:
-
----
-DEFAULT Realm == "foo.com", Acct-Type := "SQLFOO"
+The acct_users file would look something like this::
-DEFAULT Realm == "bar.com", Acct-Type := "SQLBAR"
+ DEFAULT Realm == "foo.com", Acct-Type := "SQLFOO"
+
+ DEFAULT Realm == "bar.com", Acct-Type := "SQLBAR"
-DEFAULT Client-IP-Address == "10.0.0.1", Acct-Type := "OTHERNAS"
----
+ DEFAULT Client-IP-Address == "10.0.0.1", Acct-Type := "OTHERNAS"
-And in radiusd.conf:
----
-$INCLUDE ${confdir}/sql0.conf # Instance named 'sql0'.
-$INCLUDE ${confdir}/sql1.conf # Instance named 'sql1'.
-$INCLUDE ${confdir}/sql2.conf # Instance named 'sql2'.
+And in radiusd.conf::
-detail othernas {
+ $INCLUDE ${confdir}/sql0.conf # Instance named 'sql0'.
+ $INCLUDE ${confdir}/sql1.conf # Instance named 'sql1'.
+ $INCLUDE ${confdir}/sql2.conf # Instance named 'sql2'.
+
+ detail othernas {
detailfile = ${radacctdir}/10.0.0.1/detail-%Y%m%d
-}
-
-preacct {
+ }
+
+ preacct {
suffix # Add the Realm A/V pair.
files # Add the Acct-Type A/V pair based on the Realm A/V pair.
-}
-
-accounting {
-
+ }
+
+ accounting {
+
# If Acct-Type is SQLFOO use the 'sql1' instance of the SQL module.
-
+
Acct-Type SQLFOO {
sql1
}
-
+
# If Acct-Type is SQLBAR, use the 'sql2' instance of the SQL module.
-
+
Acct-Type SQLBAR {
sql2
}
-
+
# If Acct-Type is OTHERNAS, use the 'othernas' instance of the detail
# module
-
+
Acct-Type OTHERNAS {
othernas
}
-
+
# If we've made it this far, we haven't matched an Acct-Type, so use
# the sql0 instance.
-
+
sql0
-}
----
+ }