{"id":2020,"date":"2019-01-12T13:22:31","date_gmt":"2019-01-12T10:22:31","guid":{"rendered":"http:\/\/kifarunix.com\/?p=2020"},"modified":"2024-03-11T22:04:44","modified_gmt":"2024-03-11T19:04:44","slug":"install-freeradius-with-daloradius-on-debian-9","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-freeradius-with-daloradius-on-debian-9\/","title":{"rendered":"Install FreeRADIUS with daloRADIUS on Debian 9"},"content":{"rendered":"\n<p>In this guide, we are going to learn how to Install FreeRADIUS with daloRADIUS on Debian 9 stretch. As you already know, FreeRADIUS is an opensource high performance and highly configurable RADIUS suite that provides centralized network authentication on systems such as 802.1x (WiFi), dialup, PPPoE, VPN&#8217;s, VoIP, etc. Among the database back-ends that it supports include OpenLDAP, MySQL, Redis, Microsoft AD, Apache Cassandra, PostgreSQL etc.<\/p>\n\n\n\n<p>daloRADIUS on the other hand is an advanced web application for managing FreeRADIUS server. It supports various database backends such as MySQL, Sqlite, PostgreSQL, MsSQL, MySQL. It provides features such as Access Control Lists, support integration with Google Maps for geo-location of hotspots\/access points, graphical reporting&#8230;<\/p>\n\n\n\n<p>Running Debian 10\/Debian 11? Use the link below instead;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-freeradius-with-daloradius-on-debian-11-debian-10\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install FreeRADIUS with daloRADIUS on Debian 11\/Debian 10<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing FreeRADIUS with daloRADIUS on Debian 9<\/h2>\n\n\n\n<p>Prerequisites<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>As a prerequisite, ensure that you have LAMP installed on your Debian 9 server. See our guide on how to <a href=\"https:\/\/kifarunix.com\/install-lamp-stack-on-debian-9\/\" target=\"_blank\" rel=\"noopener noreferrer\">install LAMP stack on Debian 9<\/a>.<\/li><li>Install other required PHP extensions\n<pre>apt install php-mail php-mail-mime php-pear<\/code><\/pre>\n<\/li><li>Install PHP Pear DB library\n<pre>pear install DB<\/code><\/pre>\n<\/li><\/ul>\n\n\n\n<p>You may also want to check our previous guide on <a href=\"https:\/\/kifarunix.com\/install-and-configure-freeradius-with-daloradius-on-fedora-29-2\/\" target=\"_blank\" rel=\"noopener noreferrer\">how to install FreeRADIUS with daloRADIUS on Fedora 29<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install and Configure FreeRADIUS on Debian 9<\/h3>\n\n\n\n<p>Update and upgrade your system packages;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update\napt upgrade<\/code><\/pre>\n\n\n\n<p>FreeRADIUS packages are available on the default Debian 9 default repositories and thus can be installed by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt-get install freeradius freeradius-mysql freeradius-utils<\/code><\/pre>\n\n\n\n<p>Once the installation is done, FreeRADIUS is running by default. Hence, run the command below to enable it run on system restart.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable freeradius<\/code><\/pre>\n\n\n\n<p>Open FreeRADIUS UDP port2 1812 and 1813 on UFW.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ufw allow to any port 1812 proto udp\nufw allow to any port 1813 proto udp<\/code><\/pre>\n\n\n\n<p>You can confirm port opening by running the command below;<\/p>\n\n\n\n<pre id=\"block-a9b0597d-0a60-4638-bfd4-7592369df11a\" class=\"wp-block-preformatted\">ss -alun4 | grep -E '1812|1813'<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>UNCONN     0      0            *:1812                     *:*                  \nUNCONN     0      0            *:1813                     *:*                  \nUNCONN     0      0      127.0.0.1:18120                    *:*<\/code><\/pre>\n\n\n\n<p>Stop FreeRADIUS and run it on debugging mode to confirm that it is ready to process the requests.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl stop freeradius<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>freeradius -X<\/code><\/pre>\n\n\n\n<p>If all is well, you should be able to see the sample output below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\nlisten {\n  \ttype = \"acct\"\n  \tipv6addr = ::\n  \tport = 0\n   limit {\n   \tmax_connections = 16\n   \tlifetime = 0\n   \tidle_timeout = 30\n   }\n}\nListening on auth address 127.0.0.1 port 18120 bound to server inner-tunnel\nListening on auth address * port 1812 bound to server default\nListening on acct address * port 1813 bound to server default\nListening on auth address :: port 1812 bound to server default\nListening on acct address :: port 1813 bound to server default\nListening on proxy address * port 58656\nListening on proxy address :: port 48643\n<strong>Ready to process requests<\/strong><\/code><\/pre>\n\n\n\n<p>Create FreeRADIUS database and database user. Be sure to grant the database user all the privileges on FreeRADIUS database.<\/p>\n\n\n\n<p>Login to MySQL as root user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Create the database and database user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create database radius;\ngrant all privileges on radius.* to radius@localhost identified by 'P@ssWORD';<\/code><\/pre>\n\n\n\n<p>Reload the privileges tables to affect the changes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;\nquit<\/code><\/pre>\n\n\n\n<p>After that, import the FreeRADIUS default database schema located under <code>\/etc\/freeradius\/3.0\/mods-config\/sql\/main\/mysql\/schema.sql<\/code> to the RADIUS database we created above.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p radius &lt; \/etc\/freeradius\/3.0\/mods-config\/sql\/main\/mysql\/schema.sql<\/code><\/pre>\n\n\n\n<p>Enable FreeRADIUS SQL module by creating a symbolic link of the <code>sql module<\/code> under <code>\/etc\/freeradius\/3.0\/mods-available\/<\/code> to <code>mods-enabled<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ln -s \/etc\/freeradius\/3.0\/mods-available\/sql \/etc\/freeradius\/3.0\/mods-enabled\/<\/code><\/pre>\n\n\n\n<p>Open the enabled SQL module and configure the <code>radius<\/code> database connection details as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n        # The dialect of SQL you want to use, this should usually match\n        # the driver you selected above.\n        #\n        # If you're using rlm_sql_null, then it should be the type of\n        # database the logged queries are going to be executed against.\n        #dialect = \"sqlite\"\n        <strong>dialect = \"mysql\"<\/strong>\n\n        # Connection info:\n        #\n        <strong>server = \"localhost\"<\/strong>\n<strong>        port = 3306<\/strong>\n<strong>        login = \"radius\"<\/strong>\n<strong>        password = \"P@ssWORD\"<\/strong>\n\n        # Database table configuration for everything except Oracle\n        <strong>radius_db = \"radius\"<\/strong><\/code><\/pre>\n\n\n\n<p>Locate the line, <code># read_clients = yes<\/code> and uncomment it to enable FreeRADIUS server read clients from database.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n        # Set to 'yes' to read radius clients from the database ('nas' table)\n        # Clients will ONLY be read on server startup.\n        <strong>read_clients = yes<\/strong>\n...<\/code><\/pre>\n\n\n\n<p>Save the changes and quit configuration file.<\/p>\n\n\n\n<p>Change the ownership user and group of the enabled SQL module (symbolic link) to freerad as shown below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chown -h freerad.freerad \/etc\/freeradius\/3.0\/mods-enabled\/sql<\/code><\/pre>\n\n\n\n<p>Once that is done, restart the FreeRADIUS service,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart freeradius<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install and Configure daloRADIUS on Debian 9<\/h3>\n\n\n\n<p>To get the latest version of daloRADIUS, you would have to download the archive from the <a href=\"https:\/\/sourceforge.net\/projects\/daloradius\/\" target=\"_blank\" rel=\"noopener noreferrer\">Sourceforge downloads page<\/a>.<\/p>\n\n\n\n<p>Once you have downloaded the archive, run the command below to extract it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>tar -xzf daloradius-0.9-9.tar.gz<\/code><\/pre>\n\n\n\n<p>Next, you need to move the extracted daloRADIUS folder to the root directory of your web server.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mv daloradius-0.9-9 \/var\/www\/html\/daloradius<\/code><\/pre>\n\n\n\n<p>daloRADIUS ships with its default MySQL tables. You need to import these tables to the FreeRADIUS database we created above.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p radius &lt; \/var\/www\/html\/daloradius\/contrib\/db\/fr2-mysql-daloradius-and-freeradius.sql\nmysql -u root -p radius &lt; \/var\/www\/html\/daloradius\/contrib\/db\/mysql-daloradius.sql<\/code><\/pre>\n\n\n\n<p>Configure ownership of the daloRADIUS web configuration files to Apache web user as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chown -R www-data.www-data \/var\/www\/html\/daloradius\/<\/code><\/pre>\n\n\n\n<p>Configure the permissions of the daloRADIUS main configuration file to <code>664<\/code> as shown below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chmod 664 \/var\/www\/html\/daloradius\/library\/daloradius.conf.php<\/code><\/pre>\n\n\n\n<p>Open the daloRADIUS configuration file for editing and set the database connection parameters.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/var\/www\/html\/daloradius\/library\/daloradius.conf.php<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n$configValues&#91;'DALORADIUS_VERSION'] = '0.9-9';\n$configValues&#91;'FREERADIUS_VERSION'] = '2';\n$configValues&#91;'CONFIG_DB_ENGINE'] = '<strong>mysqli<\/strong>';\n$configValues&#91;'CONFIG_DB_HOST'] = 'localhost';\n$configValues&#91;'CONFIG_DB_PORT'] = '3306';\n$configValues&#91;'CONFIG_DB_USER'] = 'radius'; <strong>&lt; RADIUS database user<\/strong>\n$configValues&#91;'CONFIG_DB_PASS'] = 'P@ssWORD'; <strong>&lt; radius user password<\/strong>\n$configValues&#91;'CONFIG_DB_NAME'] = 'radius'; <strong>&lt; RADIUS database\n...<\/strong><\/code><\/pre>\n\n\n\n<p>Be sure to change the value of <code>$configValues['CONFIG_DB_ENGINE'] = 'mysqli';<\/code> from <code>mysql<\/code> to <code><strong>mysqli<\/strong><\/code> lest you get the error, <code><b>Error Message<\/b>: DB Error: extension not found<\/code>.<\/p>\n\n\n\n<p>Save the configuration file and restart FreeRADIUS.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart freeradius<\/code><\/pre>\n\n\n\n<p>daloRADIUS configuration is done. Now, navigate to the browser and access daloRADIUS using the address <code>http:\/\/server_IP\/daloradius<\/code>. You should land on a login page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"656\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/01\/daloradius-logi-page.png\" alt=\"Install FreeRADIUS with dolaRADIUS on Debian 9\" class=\"wp-image-2032\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/01\/daloradius-logi-page.png 993w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/01\/daloradius-logi-page-768x507.png 768w\" sizes=\"(max-width: 993px) 100vw, 993px\" \/><\/figure>\n\n\n\n<p>The defualt login password for the default <code>Administrator<\/code> user is <code>radius<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1876\" height=\"912\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/01\/daloradius-dashboard.png\" alt=\"\" class=\"wp-image-2033\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/01\/daloradius-dashboard.png 1876w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/01\/daloradius-dashboard-768x373.png 768w\" sizes=\"(max-width: 1876px) 100vw, 1876px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Other Tutorials<\/h2>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-freeradius-with-daloradius-on-debian-11-debian-10\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install FreeRADIUS with daloRADIUS on Debian 11\/Debian 10<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-freeradius-with-daloradius-on-ubuntu-20-04\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install FreeRADIUS with daloRADIUS on Ubuntu 20.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going to learn how to Install FreeRADIUS with daloRADIUS on Debian 9 stretch. As you already know, FreeRADIUS is an<\/p>\n","protected":false},"author":1,"featured_media":10647,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,298],"tags":[296,287,297,4183],"class_list":["post-2020","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-radius","tag-daloradius","tag-debian-9","tag-freeradius","tag-install-freeradius-on-debian","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2020"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=2020"}],"version-history":[{"count":8,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2020\/revisions"}],"predecessor-version":[{"id":21097,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/2020\/revisions\/21097"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/10647"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=2020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=2020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=2020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}