Redundant SQL connection. Starting radiusd and Respond with Access-Accept if all databases do not work

Alan DeKok aland at
Thu Nov 28 17:42:11 CET 2019

On Nov 28, 2019, at 10:22 AM, Никита Борисенков <bna at> wrote:
> The task is to allow or prohibit calls to subscribers. If the subscriber has valid status, then we send Access-Accept. If the subscriber calls the emergency service, then we send Access-Accept. In other cases, we send Access-Reject.
> I configured two radius server, and two sql server. Replication configured between sql servers.
> I write accounting and authentication to the database.
> I want that when one database is unavailable, data is written to another database. But if both databases are not available, then we send Access-Accept
> Some questions:
> * Is there a way to not duplicate config for modules sql1 and sql2 because they differ only in ip-address?

  See raddb/templates.conf  You can put all of the configuration *except* the "server" file into a "template" in that file.  Then configure two SQL modules:

sql sql1 {
	$template sql_template
	server = localhost

sql sql2 {
	$template sql_template
 	server   =

> * Is there a way to start freeradius if one or all databases are down?

  See the pool config.  This is documented.  Set "start = 0", and "min = 0"

> * What is the correct way to verify that sql1 and sql2 modules are fail without checking "Calling-Station-Id-Is-Exists" for empty string?

  Use a "redundant" block.

> * How can I simplify this configuration?

  It seems OK to me.

  Alan DeKok.

More information about the Freeradius-Users mailing list