##
## radiusd.conf	-- FreeRADIUS server configuration file.
##
##	http://www.freeradius.org/
##

# Stuff from autoconf
prefix = /usr/local
exec_prefix = /usr/local
sysconfdir = /usr/local/etc
localstatedir = /usr/local/var
sbindir = /usr/local/sbin
logdir = ${localstatedir}/log/radius
libdir = /usr/local/lib
raddbdir = ${sysconfdir}/raddb
radacctdir = ${logdir}/radacct

confdir = ${raddbdir}
run_dir = ${localstatedir}/run

pidfile = ${run_dir}/radiusd.pid

user = root
group = root

max_request_time = 30

delete_blocked_requests = no

cleanup_delay = 5

max_requests = 1024

bind_address = *

port = 0

checkrad = ${sbindir}/checkrad

hostname_lookups = no

allow_core_dumps = no

regular_expressions	= yes
extended_expressions	= yes

log_stripped_names = yes

log_auth = yes

log_auth_badpass = yes
log_auth_goodpass = yes

usercollide = no

lower_user = no
lower_pass = no

nospace_user = no
nospace_pass = no


proxy_requests  = no


# CLIENTS CONFIGURATION
$INCLUDE  ${confdir}/clients.conf


# THREAD POOL CONFIGURATION
#
thread pool {
	start_servers = 5

	max_servers = 32

	min_spare_servers = 3
	max_spare_servers = 10

	max_requests_per_server = 0
}

modules {
        counter {
                filename = ${raddbdir}/db.counter
                key = User-Name
                count-attribute = Acct-Session-Time
                reset = monthly
                counter-name = Monthly-Session-Time
                check-name = Max-Monthly-Session
                allowed-servicetype = Framed-User
                cache-size = 5000
        }

	files {
		usersfile = ${confdir}/users
		acctusersfile = ${confdir}/acct_users

		compat = no
	}

	detail {
		detailfile = ${radacctdir}/%{Client-IP-Address}/detail
		detailperm = 0600
	}

	acct_unique {
		key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port-Id"
	}

	$INCLUDE  ${confdir}/sql.conf


	radutmp {
		filename = ${logdir}/radutmp
		perm = 0600
		callerid = "yes"
	}

	radutmp sradutmp {
		filename = ${logdir}/sradutmp
		perm = 0644
		callerid = "no"
	}

	attr_filter {
		attrsfile = ${confdir}/attrs
	}

	always fail {
		rcode = fail
	}
	always reject {
		rcode = reject
	}
	always ok {
		rcode = ok
		simulcount = 0
		mpp = no
	}

}


authenticate {
	files
}


authorize {
	counter
	files
	counter
}



# Pre-accounting. Look for proxy realm in order of realms, then 
# acct_users file, then preprocess (hints file).
preacct {
	files
}


# Accounting. Log to detail file, and to the radwtmp file, and maintain
# radutmp.
accounting {
	detail
	counter
	radutmp
}


# Session database, used for checking Simultaneous-Use. The radutmp module
# handles this
session {
	radutmp
}
