Freeradius-server-3.0.25 docking mariadb error

网络时代 1511815642 at qq.com
Mon Jan 23 14:29:20 UTC 2023


Hello,
ezhangiso at ezhangiso-virtual-machine:/$ docker exec -it radius-test /bin/bash
root at 4ff809b932fe:/# chgrp -h freerad /etc/freeradius/mods-available/sql
root at 4ff809b932fe:/# chown -R freerad:freerad /etc/freeradius/mods-enabled/sql
root at 4ff809b932fe:/# vi etc/freeradius/mods-available/sql
root at 4ff809b932fe:/# vi /etc/freeradius/sites-available/default
root at 4ff809b932fe:/# vi /etc/freeradius/sites-available/inner-tunnel
root at 4ff809b932fe:/# vi radiusd.conf
root at 4ff809b932fe:/# vi /etc/freeradius/radiusd.conf
root at 4ff809b932fe:/# cat etc/freeradius/mods-available/sql


	dialect = "mysql"
	driver = "rlm_sql_mysql"
	sqlite {
		filename = "/tmp/freeradius.db"
		busy_timeout = 200
		bootstrap = "${modconfdir}/${..:name}/main/sqlite/schema.sql"
	}


	mysql {
		
			tls_required = no
			tls_check_cert = no
			tls_check_cert_cn = no
		}
		warnings = auto
	}


	postgresql {


		send_application_name = yes
	}


	#
	mongo {
		appname = "freeradius"


		tls {
			certificate_file = /path/to/file
			certificate_password = "password"
			ca_file = /path/to/file
			ca_dir = /path/to/directory
			crl_file = /path/to/file
			weak_cert_validation = false
			allow_invalid_hostname = false


	server = "10.0.8.31"
	port = 3306
	login = "radius"
	password = "radius"


	radius_db = "radius"
	acct_table1 = "radacct"
	acct_table2 = "radacct"
	postauth_table = "radpostauth"
	authcheck_table = "radcheck"
	groupcheck_table = "radgroupcheck"
	authreply_table = "radreply"
	groupreply_table = "radgroupreply"
	usergroup_table = "radusergroup"


	delete_stale_sessions = yes


	pool {
		start = ${thread[pool].start_servers}
		min = ${thread[pool].min_spare_servers}
		max = ${thread[pool].max_servers}
		uses = 0
		retry_delay = 30
		lifetime = 0
		idle_timeout = 60
	client_table = "nas"
	group_attribute = "SQL-Group"
	$INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}
root at 4ff809b932fe:/# cat /etc/freeradius/radiusd.conf


prefix = /usr
exec_prefix = /usr
sysconfdir = /etc
localstatedir = /var
sbindir = ${exec_prefix}/sbin
logdir = /var/log/freeradius
raddbdir = /etc/freeradius
radacctdir = ${logdir}/radacct


name = freeradius


confdir = ${raddbdir}
modconfdir = ${confdir}/mods-config
certdir = ${confdir}/certs
cadir   = ${confdir}/certs
run_dir = ${localstatedir}/run/${name}


db_dir = ${raddbdir}


libdir = /usr/lib/freeradius


pidfile = ${run_dir}/${name}.pid


correct_escapes = true
max_request_time = 30
cleanup_delay = 5
hostname_lookups = no
log {
	destination = files
	colourise = yes
	file = ${logdir}/radius.log
	syslog_facility = daemon
	stripped_names = no
	auth = no
	auth_badpass = no
	auth_goodpass = no
	msg_denied = "You are already logged in - access denied"
}
checkrad = ${sbindir}/checkrad
ENV {
	}


security {
	user = freerad
	group = freerad
	allow_core_dumps = no
	max_attributes = 200
	reject_delay = 1
	status_server = yes
}


proxy_requests  = yes
$INCLUDE proxy.conf
$INCLUDE clients.conf
thread pool {
	start_servers = 5
	max_servers = 32
	min_spare_servers = 3
	max_spare_servers = 10
	max_requests_per_server = 0
modules {
	$INCLUDE mods-enabled/sql


	$INCLUDE mods-enabled/
}


policy {
	$INCLUDE policy.d/
}


$INCLUDE sites-enabled/


root at 4ff809b932fe:/# apt install mariadb-client


root at 4ff809b932fe:/# mysql -h 10.0.8.31 -uradius -p radius
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A


Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.6.5-MariaDB-1:10.6.5+maria~focal mariadb.org binary distribution


Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MariaDB [radius]> show tables;
+------------------+
| Tables_in_radius |
+------------------+
| nas              |
| radacct          |
| radcheck         |
| radgroupcheck    |
| radgroupreply    |
| radpostauth      |
| radreply         |
| radusergroup     |
+------------------+
8 rows in set (0.00 sec)


MariaDB [radius]> exit
Bye
root at 4ff809b932fe:/# exit
exit
ezhangiso at ezhangiso-virtual-machine:/$ docker commit radius-test radius-mariadb
sha256:1b5a68d2c3c3aaf70be72f8dcbfda27a7cf63e7ba448f412b73bd5f0d8aef63b
ezhangiso at ezhangiso-virtual-machine:/$ docker stop radius-test
radius-test
ezhangiso at ezhangiso-virtual-machine:/$ docker run --rm --name myradius -t -p1812-1813:1812-1813/udp radius-mariadb -X
FreeRADIUS Version 3.0.25
Copyright (C) 1999-2021 The FreeRADIUS server project and contributors
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License
For more information about these matters, see the file named COPYRIGHT
Starting - reading configuration files ...
including dictionary file /usr/share/freeradius/dictionary
including dictionary file /usr/share/freeradius/dictionary.dhcp
including dictionary file /usr/share/freeradius/dictionary.vqp
including dictionary file /etc/freeradius/dictionary
including configuration file /etc/freeradius/radiusd.conf
including configuration file /etc/freeradius/proxy.conf
including configuration file /etc/freeradius/clients.conf
including configuration file /etc/freeradius/mods-enabled/sql
/etc/freeradius/mods-enabled/sql[365]: Reference "${dialect}" not found
Errors reading or parsing /etc/freeradius/radiusd.conf
ezhangiso at ezhangiso-virtual-machine:/$


Can anyone shed some light on this and point me in the right direction what
else should I do?


More information about the Freeradius-Users mailing list