Hello to all,

I've been using FreeRadius for a year, but now I'd like to implement 
RADIUS with LDAP authentication, I've test it and It works great. 

Now I'd like to protect radius - ldap server comunication using TLS. But 
I'm not able to do it. 

My LDAP server is Notes Domino and I've been able to configure it 
correctly. I can connect to it using LDAP SSL/TLS, but I don't know how to 
implement this in FreeRadius.

I'm using freeradius-0.8.1 and this is my radiusd.conf 



Can you help me?

When I try i view this log:

rad_recv: Access-Request packet from host 127.0.0.1:32792, id=101, 
length=60
        User-Name = "test"
        User-Password = "1234567890"
        NAS-IP-Address = 255.255.255.255
        NAS-Port = 1
rad_lowerpair:  User-Name now 'test'
rad_lowerpair:  User-Password now '1234567890'
modcall: entering group authorize
rlm_ldap: - authorize
rlm_ldap: performing user authorization for test
radius_xlat:  '(uid=test)'
radius_xlat:  'o=Prova'
ldap_get_conn: Got Id: 0
rlm_ldap: attempting LDAP reconnection
rlm_ldap: (re)connect to ldap.server.mycompany.es:636, authentication 0
rlm_ldap: setting TLS mode to 1
rlm_ldap: starting TLS
rlm_ldap: ldap_start_tls_s()
rlm_ldap: could not start TLS Protocol error
rlm_ldap: (re)connection attempt failed
rlm_ldap: search failed
ldap_release_conn: Release Id: 0
  modcall[authorize]: module "ldap" returns fail
modcall: group authorize returns fail
There was no response configured: rejecting request 0
Server rejecting request 0.
Finished request 0
Going to the next request
--- Walking the entire request list ---
Waking up in 1 seconds...
--- Walking the entire request list ---
Waking up in 1 seconds...
--- Walking the entire request list ---
Sending Access-Reject of id 101 to 127.0.0.1:32792
Waking up in 4 seconds...
--- Walking the entire request list ---
Cleaning up request 0 ID 101 with timestamp 3ef0694c
Nothing to do.  Sleeping until we see a request.

______________________________________
Paco Orozco ([EMAIL PROTECTED])
Divisi� de Telecomunicacions
UPCNet
Edifici V�rtex - Pl. Eusebi G�ell, 6
Tel�fon centraleta: 93.40.11600
##
## radiusd.conf -- FreeRADIUS server configuration file.
##

#       The location of other config files and
#       logfiles are declared in this file
#
prefix = /opt/freeradius-0.8.1
exec_prefix = ${prefix}
sysconfdir = ${prefix}/etc
localstatedir = ${prefix}/var
sbindir = ${exec_prefix}/sbin
logdir = /opt/freeradius-0.8.1/logs
raddbdir = ${sysconfdir}/raddb
radacctdir = /opt/freeradius-0.8.1/acct

#  Location of config and logfiles.
confdir = ${raddbdir}
run_dir = ${localstatedir}/run/radiusd

#
#  The logging messages for the server are appended to the
#  tail of this file.
#
log_file = ${logdir}/radius.log

#
# libdir: Where to find the rlm_* modules.
#
libdir = ${exec_prefix}/lib

#
#  pidfile: Where to place the PID of the RADIUS server.
#
pidfile = ${run_dir}/radiusd.pid


# user/group: The name (or #number) of the user/group to run radiusd as.
#
#   If these are commented out, the server will run as the user/group
#   that started it.  In order to change to a different user/group, you
#   MUST be root ( or have root privleges ) to start the server.
#
# user = radius
group = admradius

#  max_request_time: The maximum time (in seconds) to handle a request.
#
#  Requests which take more time than this to process may be killed, and
#  a REJECT message is returned.
#
#  Useful range of values: 5 to 120
#
max_request_time = 30

#  delete_blocked_requests: If the request takes MORE THAN 'max_request_time'
#  to be handled, then maybe the server should delete it.
#
#  If you're running in threaded, or thread pool mode, this setting
#  should probably be 'no'.  Setting it to 'yes' when using a threaded
#  server MAY cause the server to crash!
#
delete_blocked_requests = no

#  cleanup_delay: The time to wait (in seconds) before cleaning up
#  a reply which was sent to the NAS.
#
#  The RADIUS request is normally cached internally for a short period
#  of time, after the reply is sent to the NAS.  The reply packet may be
#  lost in the network, and the NAS will not see it.  The NAS will then
#  re-send the request, and the server will respond quickly with the
#  cached reply.
#
#  If this value is set too low, then duplicate requests from the NAS
#  MAY NOT be detected, and will instead be handled as seperate requests.
#
#  If this value is set too high, then the server will cache too many
#  requests, and some new requests may get blocked.  (See 'max_requests'.)
#
#  Useful range of values: 2 to 10
#
cleanup_delay = 5

#  max_requests: The maximum number of requests which the server keeps
#  track of.  This should be 256 multiplied by the number of clients.
#  e.g. With 4 clients, this number should be 1024.
#
#  If this number is too low, then when the server becomes busy,
#  it will not respond to any new requests, until the 'cleanup_delay'
#  time has passed, and it has removed the old requests.
#
#  If this number is set too high, then the server will use a bit more
#  memory for no real benefit.
#
#  If you aren't sure what it should be set to, it's better to set it
#  too high than too low.  Setting it to 1000 per client is probably
#  the highest it should be.
#
#  Useful range of values: 256 to infinity
#
max_requests = 256

#  bind_address:  Make the server listen on a particular IP address, and
#  send replies out from that address.  This directive is most useful
#  for machines with multiple IP addresses on one interface.
#
#  It can either contain "*", or an IP address, or a fully qualified
#  Internet domain name.  The default is "*"
#
bind_address = *

#  port: Allows you to bind FreeRADIUS to a specific port.
#
#  The default port that most NAS boxes use is 1645, which is historical.
#  RFC 2138 defines 1812 to be the new port.  Many new servers and
#  NAS boxes use 1812, which can create interoperability problems.
#
port = 1745

#  hostname_lookups: Log the names of clients or just their IP addresses
#
#  The default is 'off' because it would be overall better for the net
#  if people had to knowingly turn this feature on, since enabling it
#  means that each client request will result in AT LEAST one lookup
#  request to the nameserver.   Enabling hostname_lookups will also
#  mean that your server may stop randomly for 30 seconds from time
#  to time, if the DNS requests take too long.
#
#  Turning hostname lookups off also means that the server won't block
#  for 30 seconds, if it sees an IP address which has no name associated
#  with it.
#
#  allowed values: {no, yes}
#
hostname_lookups = no

#  Core dumps are a bad thing.  This should only be set to 'yes'
#  if you're debugging a problem with the server.
#
#  allowed values: {no, yes}
#
allow_core_dumps = no

#  Regular expressions
#
#  These items are set at configure time.  If they're set to "yes",
#  then setting them to "no" turns off regular expression support.
#
#  If they're set to "no" at configure time, then setting them to "yes"
#  WILL NOT WORK.  It will give you an error.
#
regular_expressions     = yes
extended_expressions    = yes

#  Log the full User-Name attribute, as it was found in the request.
#
# allowed values: {no, yes}
#
log_stripped_names = no

#  Log authentication requests to the log file.
#
#  allowed values: {no, yes}
#
log_auth = no

#  Log passwords with the authentication requests.
#  log_auth_badpass  - logs password if it's rejected
#  log_auth_goodpass - logs password if it's correct
#
#  allowed values: {no, yes}
#
log_auth_badpass = no
log_auth_goodpass = no

# usercollide:  Turn "username collision" code on and off.  See the
# "doc/duplicate-users" file
#
usercollide = no

# lower_user / lower_pass:  
# Lower case the username/password "before" or "after"
# attempting to authenticate.  
#
#  If "before", the server will first modify the request and then try
#  to auth the user.  If "after", the server will first auth using the
#  values provided by the user.  If that fails it will reprocess the
#  request after modifying it as you specify below.
#
#  This is as close as we can get to case insensitivity.  It is the
#  admin's job to ensure that the username on the auth db side is
#  *also* lowercase to make this work
#
# Default is 'no' (don't lowercase values)
# Valid values = "before" / "after" / "no"
#
lower_user = before
lower_pass = before

# nospace_user / nospace_pass:
#
#  Some users like to enter spaces in their username or password
#  incorrectly.  To save yourself the tech support call, you can
#  eliminate those spaces here:
#
# Default is 'no' (don't remove spaces)
# Valid values = "before" / "after" / "no" (explanation above)
#
nospace_user = no
nospace_pass = no

#  The program to execute to do concurrency checks.
checkrad = ${sbindir}/checkrad

# SECURITY CONFIGURATION
#
#  There may be multiple methods of attacking on the server.  This
#  section holds the configuration items which minimize the impact
#  of those attacks
#
security {
        #
        #  max_attributes: The maximum number of attributes
        #  permitted in a RADIUS packet.  Packets which have MORE
        #  than this number of attributes in them will be dropped.
        #
        #  Setting this number to 0 means "allow any number of attributes"
        max_attributes = 200

        #
        #  delayed_reject: When sending an Access-Reject, it can be
        #  delayed for a few seconds.  This may help slow down a DoS
        #  attack.  It also helps to slow down people trying to brute-force
        #  crack a users password.
        #
        #  Setting this number to 0 means "send rejects immediately"
        #
        #  If this number is set higher than 'cleanup_delay', then the
        #  rejects will be sent at 'cleanup_delay' time, when the request
        #  is deleted from the internal cache of requests.
        #
        #  Useful ranges: 1 to 5
        reject_delay = 1

        #
        #  status_server: Whether or not the server will respond
        #  to Status-Server requests.
        #
        #  Normally this should be set to "no", because they're useless.
        #  See: http://www.freeradius.org/rfc/rfc2865.html#Keep-Alives
        #
        #  However, certain NAS boxes may require them. 
        #
        #  When sent a Status-Server message, the server responds with
        #  and Access-Accept packet, containing a Reply-Message attribute,
        #  which is a string describing how long the server has been
        #  running.
        #
        status_server = no
}

# PROXY CONFIGURATION
#
#  proxy_requests: Turns proxying of RADIUS requests on or off.
#
#  The server has proxying turned on by default.  If your system is NOT
#  set up to proxy requests to another server, then you can turn proxying
#  off here.  This will save a small amount of resources on the server.
#
#  If you have proxying turned off, and your configuration files say
#  to proxy a request, then an error message will be logged.
#
#  To disable proxying, change the "yes" to "no", and comment the
#  $INCLUDE line.
#
#  allowed values: {no, yes}
#
proxy_requests  = no
# $INCLUDE  ${confdir}/proxy.conf


# CLIENTS CONFIGURATION
#
#  Client configuration is defined in "clients.conf".  
#

#  The 'clients.conf' file contains all of the information from the old
#  'clients' and 'naslist' configuration files.  We recommend that you
#  do NOT use 'client's or 'naslist', although they are still
#  supported.
#
#  Anything listed in 'clients.conf' will take precedence over the
#  information from the old-style configuration files.
#
$INCLUDE  ${confdir}/clients.conf


# SNMP CONFIGURATION
#
#  Snmp configuration is only valid if you enabled SNMP support when
#  you compiled radiusd.
#
# $INCLUDE  ${confdir}/snmp.conf


# THREAD POOL CONFIGURATION
#
#  The thread pool is a long-lived group of threads which
#  take turns (round-robin) handling any incoming requests.
#
#  You probably want to have a few spare threads around,
#  so that high-load situations can be handled immediately.  If you
#  don't have any spare threads, then the request handling will
#  be delayed while a new thread is created, and added to the pool.
#
#  You probably don't want too many spare threads around,
#  otherwise they'll be sitting there taking up resources, and
#  not doing anything productive.
#
#  The numbers given below should be adequate for most situations.
#
thread pool {
        #  Number of servers to start initially --- should be a reasonable
        #  ballpark figure.
        start_servers = 5

        #  Limit on the total number of servers running.
        #
        #  If this limit is ever reached, clients will be LOCKED OUT, so it
        #  should NOT BE SET TOO LOW.  It is intended mainly as a brake to
        #  keep a runaway server from taking the system with it as it spirals
        #  down...
        #
        #  You may find that the server is regularly reaching the
        #  'max_servers' number of threads, and that increasing
        #  'max_servers' doesn't seem to make much difference.
        #
        #  If this is the case, then the problem is MOST LIKELY that
        #  your back-end databases are taking too long to respond, and
        #  are preventing the server from responding in a timely manner.
        #
        #  The solution is NOT do keep increasing the 'max_servers'
        #  value, but instead to fix the underlying cause of the
        #  problem: slow database, or 'hostname_lookups=yes'.
        #
        #  For more information, see 'max_request_time', above.
        #
        max_servers = 32

        #  Server-pool size regulation.  Rather than making you guess
        #  how many servers you need, FreeRADIUS dynamically adapts to
        #  the load it sees, that is, it tries to maintain enough
        #  servers to handle the current load, plus a few spare
        #  servers to handle transient load spikes.
        #
        #  It does this by periodically checking how many servers are
        #  waiting for a request.  If there are fewer than
        #  min_spare_servers, it creates a new spare.  If there are
        #  more than max_spare_servers, some of the spares die off.
        #  The default values are probably OK for most sites.
        #
        min_spare_servers = 3
        max_spare_servers = 10

        #  There may be memory leaks or resource allocation problems with
        #  the server.  If so, set this value to 300 or so, so that the
        #  resources will be cleaned up periodically.
        #
        #  This should only be necessary if there are serious bugs in the
        #  server which have not yet been fixed.
        #
        #  '0' is a special value meaning 'infinity', or 'the servers never
        #  exit'
        max_requests_per_server = 0
}

# MODULE CONFIGURATION
#
#  The names and configuration of each module is located in this section.
#
#  After the modules are defined here, they may be referred to by name,
#  in other sections of this configuration file.
#
modules {


        # Extensible Authentication Protocol
        #
        #  For all EAP related authentications 
        #eap {
                # Invoke the default supported EAP type when
                # EAP-Identity response is received
                #       default_eap_type = md5

                # Default expiry time to clean the EAP list,
                # It is maintained to co-relate the
                # EAP-response for each EAP-request sent.
                #       timer_expire     = 60

                # Supported EAP-types
        #       md5 {
        #       }

                ## EAP-TLS is highly experimental EAP-Type at the moment.  
                #       Please give feedback on the mailing list.
                #tls {
                #       private_key_password = password
                #       private_key_file = /path/filename

                #       If Private key & Certificate are located in the
                #       same file, then private_key_file & certificate_file
                #       must contain the same file name.
                #       certificate_file = /path/filename

                #       Trusted Root CA list
                        #CA_file = /path/filename

                #       dh_file = /path/filename
                        #random_file = /path/filename
                #
                #       This can never exceed MAX_RADIUS_LEN (4096)
                #       preferably half the MAX_RADIUS_LEN, to
                #       accomodate other attributes in RADIUS packet.
                #       On most APs the MAX packet length is configured
                #       between 1500 - 1600. In these cases, fragment
                #       size should be <= 1024.
                #
                #               fragment_size = 1024

                #       include_length is a flag which is by default set to yes
                #       If set to yes, Total Length of the message is included
                #       in EVERY packet we send.
                #       If set to no, Total Length of the message is included
                #       ONLY in the First packet of a fragment series.
                #
                #               include_length = yes
                #}
        #}

        # Microsoft CHAP authentication
        #
        #  This module supports SAMBA passwd file authorization
        #  and MS-CHAP, MS-CHAPv2 authentication.  However, we recommend
        #  using the 'passwd' module, below, as it's more general.
        #
        #mschap {
                # Location of the SAMBA passwd file
                #       passwd = /etc/smbpasswd

                # authtype value, if present, will be used
                # to overwrite (or add) Auth-Type during
                # authorization. Normally should be MS-CHAP
                authtype = MS-CHAP
                
                # If ignore_password is set to yes mschap will
                # ignore the password set by any other module during
                # authorization and will always use the SAMBA password file
                #       ignore_password = yes  

                # if use_mppe is not set to no mschap will
                # add MS-CHAP-MPPE-Keys for MS-CHAPv1 and
                # MS-MPPE-Recv-Key/MS-MPPE-Send-Key for MS-CHAPv2
                #       use_mppe = no

                # if mppe is enabled require_encryption makes
                # encryption moderate
                #       require_encryption = yes

                # require_strong always requires 128 bit key
                # encryption
                #       require_strong = yes
        #}

        # Lightweight Directory Access Protocol (LDAP)
        #
        #  This module definition allows you to use LDAP for
        #  authorization and authentication (Auth-Type := LDAP)
        #
        #  See doc/rlm_ldap for description of configuration options 
        #  and sample authorize{} and authenticate{} blocks 
        ldap {
                server = "ldap.server.mycompany.es"
                port = 636
                basedn = "o=Prova"
                filter = "(uid=%{User-Name})"

                start_tls = yes
                tls_mode = yes

                dictionary_mapping = ${raddbdir}/ldap.attrmap
                ldap_connections_number = 5
                timeout = 4
                timelimit = 3
                net_timeout = 1
        }

        # passwd module allows to do authorization via any passwd-like
        # file and to extract any attributes from these modules
        #
        # parameters are:
        #   filename - path to filename
        #   format - format for filename record. This parameters
        #            correlates record in the passwd file and RADIUS
        #            attributes.
        #
        #            Field marked as '*' is key field. That is, the parameter
        #            with this name from the request is used to search for
        #            the record from passwd file
        #
        #            Field marked as ',' may contain a comma separated list
        #            of attributes.
        #   authtype - if record found this Auth-Type is used to authenticate
        #            user
        #   hashsize - hashtable size. If 0 or not specified records are not
        #            stored in memory and file is red on every request.
        #   allowmultiplekeys - if few records for every key are allowed
        #   ignorenislike - ignore NIS-related records
        #   delimiter - symbol to use as a field separator in passwd file,
        #            for format ':' symbol is always used. '\0', '\n' are
        #            not allowed 
        #
        #passwd etc_smbpasswd {
        #       filename = /etc/smbpasswd
        #       format = "*User-Name::LM-Password:NT-Password:SMB-Account-CTRL-TEXT::"
        #       authtype = MS-CHAP
        #       hashsize = 100
        #       ignorenislike = no
        #       allowmultiplekeys = no
        #}

        #  Similar configuration, for the /etc/group file. Adds a Group-Name
        #  attribute for every group that the user is member of.
        #
        #passwd etc_group {
        #       filename = /etc/group
        #       format = "Group-Name:::*,User-Name"
        #       hashsize = 50
        #       ignorenislike = yes
        #       allowmultiplekeys = yes
        #       delimiter = ":"
        #}

        # Realm module, for proxying.
        #
        #  You can have multiple instances of the realm module to
        #  support multiple realm syntaxs at the same time.  The
        #  search order is defined the order in the authorize and
        #  preacct blocks after the module config block.
        #
        #  Two config options:
        #       format     -  must be 'prefix' or 'suffix'
        #       delimiter  -  must be a single character

        #  '[EMAIL PROTECTED]'
        #
        #realm suffix {
        #       format = suffix
        #       delimiter = "@"
        #}

        #  'realm/username'
        #
        #  Using this entry, IPASS users have their realm set to "IPASS".
        #realm realmslash {
        #       format = prefix
        #       delimiter = "/"
        #}

        #  'username%realm'
        #
        #realm realmpercent {
        #       format = suffix
        #       delimiter = "%"
        #}
        
        #  rewrite arbitrary packets.  Useful in accounting and authorization.
        #
        ## This module is highly experimental at the moment.  Please give 
        ## feedback to the mailing list.
        #
        #  The module can also use the Rewrite-Rule attribute. If it
        #  is set and matches the name of the module instance, then
        #  that module instance will be the only one which runs.
        #
        #  Also if new_attribute is set to yes then a new attribute
        #  will be created containing the value replacewith and it
        #  will be added to searchin (packet, reply or config).
        # searchfor,ignore_case and max_matches will be ignored in that case.

        #
        #attr_rewrite sanecallerid {
        #       attribute = Called-Station-Id
                # may be "packet", "reply", or "config"
        #       searchin = packet
        #       searchfor = "[+ ]"
        #       replacewith = ""
        #       ignore_case = no
        #       new_attribute = no
        #       max_matches = 10
        #       ## If set to yes then the replace string will be appended to the 
original string
        #       append = no
        #}

        # Preprocess the incoming RADIUS request, before handing it off
        # to other modules.
        #
        #  This module processes the 'huntgroups' and 'hints' files.
        #  In addition, it re-writes some weird attributes created
        #  by some NASes, and converts the attributes into a form which
        #  is a little more standard.
        #
        preprocess {
                huntgroups = ${confdir}/huntgroups
                hints = ${confdir}/hints

                # This hack changes Ascend's wierd port numberings
                # to standard 0-??? port numbers so that the "+" works
                # for IP address assignments.
                with_ascend_hack = no
                ascend_channels_per_line = 23

                # Windows NT machines often authenticate themselves as
                # NT_DOMAIN\username
                #
                # If this is set to 'yes', then the NT_DOMAIN portion
                # of the user-name is silently discarded.
                with_ntdomain_hack = no

                # Specialix Jetstream 8500 24 port access server.
                #
                # If the user name is 10 characters or longer, a "/"
                # and the excess characters after the 10th are
                # appended to the user name.
                #
                # If you're not running that NAS, you don't need
                # this hack.
                with_specialix_jetstream_hack = no

                # Cisco sends it's VSA attributes with the attribute
                # name *again* in the string, like:
                #
                #   H323-Attribute = "h323-attribute=value".
                #
                # If this configuration item is set to 'yes', then
                # the redundant data in the the attribute text is stripped
                # out.  The result is:
                #
                #  H323-Attribute = "value"
                #
                # If you're not running a Cisco NAS, you don't need
                # this hack.
                with_cisco_vsa_hack = no
        }

        # Livingston-style 'users' file
        #

        # Write a detailed log of all accounting records received.
        #
        detail {
                #  Note that we do NOT use NAS-IP-Address here, as
                #  that attribute MAY BE from the originating NAS, and
                #  NOT from the proxy which actually sent us the
                #  request.  The Client-IP-Address attribute is ALWAYS
                #  the address of the client which sent us the
                #  request.
                #
                #  The following line creates a new detail file for
                #  every radius client (by IP address or hostname).
                #  In addition, a new detail file is created every
                #  day, so that the detail file doesn't have to go
                #  through a 'log rotation'
                #
                #  If your detail files are large, you may also want
                #  to add a ':%H' (see doc/variables.txt) to the end
                #  of it, to create a new detail file every hour, e.g.:
                #
                #   ..../detail-%Y%m%d:%H
                #
                #  This will create a new detail file for every hour.
                #
                detailfile = ${radacctdir}/%{Client-IP-Address}/detail-%Y%m%d

                #
                #  The Unix-style permissions on the 'detail' file.
                #
                #  The detail file often contains secret or private
                #  information about users.  So by keeping the file
                #  permissions restrictive, we can prevent unwanted
                #  people from seeing that information.
                detailperm = 0600
        }

        # Create a unique accounting session Id.  Many NASes re-use or
        # repeat values for Acct-Session-Id, causing no end of
        # confusion.
        #
        #  This module will add a (probably) unique session id 
        #  to an accounting packet based on the attributes listed
        #  below found in the packet.  See doc/rlm_acct_unique for
        #  more information.
        #
        acct_unique {
                key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, 
NAS-Port-Id"
        }


        # Include another file that has the SQL-related configuration.
        # This is another file solely because it tends to be big.
        #
        #  The following configuration file is for use with MySQL.
        #
        # For Postgresql, use:          ${confdir}/postgresql.conf
        # For MS-SQL, use:              ${confdir}/mssql.conf
        #
        #$INCLUDE  ${confdir}/sql.conf

        # Write a 'utmp' style log file, of which users are currently
        # logged in, and where they've logged in from.
        #
        radutmp {
                filename = ${logdir}/radutmp

                # Set the file permissions, as the contents of this file
                # are usually private.
                perm = 0600

                callerid = "yes"
        }

        # "Safe" radutmp - does not contain caller ID, so it can be
        # world-readable, and radwho can work for normal users, without
        # exposing any information that isn't already exposed by who(1).
        #
        # This is another instance of the radutmp module, but it is given
        # then name "sradutmp" to identify it later in the "accounting"
        # section.
        radutmp sradutmp {
                filename = ${logdir}/sradutmp
                perm = 0644
                callerid = "no"
        }

        # attr_filter - filters the attributes received in replies from
        # proxied servers, to make sure we send back to our RADIUS client
        # only allowed attributes.
        attr_filter {
                attrsfile = ${confdir}/attrs
        }

        #  This module takes an attribute (count-attribute).
        #  It also takes a key, and creates a counter for each unique
        #  key.  The count is incremented when accounting packets are
        #  received by the server.  The value of the increment depends
        #  on the attribute type.
        #  If the attribute is Acct-Session-Time or an integer we add the
        #  value of the attribute. If it is anything else we increase the
        #  counter by one.
        #
        #  The 'reset' parameter defines when the counters are all reset to
        #  zero.  It can be hourly, daily, weekly, monthly or never.
        #  It can also be user defined. It should be of the form:
        #  num[hdwm] where:
        #  h: hours, d: days, w: weeks, m: months
        #  If the letter is ommited days will be assumed. In example:
        #  reset = 10h (reset every 10 hours)
        #  reset = 12  (reset every 12 days)
        #
        #
        #  The check-name attribute defines an attribute which will be
        #  registered by the counter module and can be used to set the
        #  maximum allowed value for the counter after which the user
        #  is rejected.
        #  Something like:
        #
        #  DEFAULT Max-Daily-Session := 36000
        #          Fall-Through = 1
        #
        #  You should add the counter module in the instantiate
        #  section so that it registers check-name before the files
        #  module reads the users file.
        #
        #  If check-name is set and the user is to be rejected then we
        #  send back a Reply-Message and we log a Failure-Message in
        #  the radius.log
        #
        #  The counter-name can also be used like below:
        #
        #  DEFAULT  Daily-Session-Time > 3600, Auth-Type = Reject
        #      Reply-Message = "You've used up more than one hour today"
        #
        #  The allowed-servicetype attribute can be used to only take
        #  into account specific sessions. For example if a user first
        #  logs in through a login menu and then selects ppp there will
        #  be two sessions. One for Login-User and one for Framed-User
        #  service type. We only need to take into account the second one.
        #
        #  The module should be added in the instantiate, authorize and
        #  accounting sections.  Make sure that in the authorize
        #  section it comes after any module which sets the
        #  'check-name' attribute.
        #
        counter {
                filename = ${raddbdir}/db.counter
                key = User-Name
                count-attribute = Acct-Session-Time
                reset = daily
                counter-name = Daily-Session-Time
                check-name = Max-Daily-Session
                allowed-servicetype = Framed-User
                cache-size = 5000
        }

        # The "always" module is here for debugging purposes. Each
        # instance simply returns the same result, always, without
        # doing anything.
        always fail {
                rcode = fail
        }
        always reject {
                rcode = reject
        }
        always ok {
                rcode = ok
                simulcount = 0
                mpp = no
        }

        expr {
        }
}

instantiate {
        expr
}

authorize {
        ldap {
                notfound = return
        }
}


authenticate {
        authtype LDAP {
                ldap
        }
}


preacct {
        preprocess
}


accounting {
        acct_unique
        detail
        radutmp
}


session {
        radutmp
}


post-auth {
}

Reply via email to