#  Configuration for DHCP to use SQL IP Pools.
#
#  See raddb/mods-available/sqlippool for common configuration explanation
#
#  See raddb/policy.d/dhcp_sqlippool for the "glue" code that allows
#  the RADIUS based "sqlippool" module to be used for DHCP.
#
#  See raddb/mods-config/sql/ippool/ for the schemas.
#
#  See raddb/sites-available/dhcp for instructions on how to configure
#  the DHCP server.
#
#  $Id: 7739a6066ba5ee794c04324179b62f047724e5d1 $

sqlippool dhcp_sqlippool {
	sql_module_instance = "sql"

	ippool_table = "radippool"

	lease_duration = 7200

	# Client's MAC address is mapped to Calling-Station-Id in policy.conf
	pool_key = "%{Calling-Station-Id}"

	# For now, it works with MySQL.
	$INCLUDE ${modconfdir}/sql/ippool-dhcp/mysql/queries.conf

	# It may also work with sqlite - this is very experimental.
	# Comment out the above line and add the following include.
	# To use sqlite you need to add '%' to safe_characters in
	# raddb/mods-config/sql/main/sqlite/queries.conf.
	# $INCLUDE ${modconfdir}/sql/ippool-dhcp/sqlite/queries.conf

	sqlippool_log_exists = "DHCP: Existing IP: %{reply:Framed-IP-Address} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"

	sqlippool_log_success = "DHCP: Allocated IP: %{reply:Framed-IP-Address} from %{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"

	sqlippool_log_clear = "DHCP: Released IP %{Framed-IP-Address} (did %{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})"

	sqlippool_log_failed = "DHCP: IP Allocation FAILED from %{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"

	sqlippool_log_nopool = "DHCP: No Pool-Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"

}
