FreeRADIUS build and install (Debian packages with rlm_raw patch)


This post will show how to build and install Debian packages for FreeRADIUS 2.2.5 with rlm_raw patch.

Machine: Linux Mint Debian Edition (LMDE) 64 bit

Download the source code:
Download the FreeRADIUS source file.
wget ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-2.2.5.tar.bz2
Extract the source code.
tar jxf freeradius-server-2.2.5.tar.bz2

Patch the code with rlm_raw:
This patch enable dynamic clients using mac address rather than static ip address.
Download the rlm_raw patch.
wget -O rlm_raw_patch http://sourceforge.net/p/radiusdesk/code/HEAD/tree/trunk/rd_cake/Setup/Radius/rlm_raw_patch?format=raw
Add the rlm_raw patch
cd freeradius-server-2.2.5
patch -p1 < rlm_raw_patch
If all goes according to plan the following output should show on your screen:
$ patch -p1 < rlm_raw_patch 
patching file src/modules/rlm_raw/config.h.in
patching file src/modules/rlm_raw/configure
patching file src/modules/rlm_raw/configure.in
patching file src/modules/rlm_raw/Makefile.in
patching file src/modules/rlm_raw/rlm_raw.c
patching file src/modules/stable
Hunk #1 FAILED at 39.
1 out of 1 hunk FAILED -- saving rejects to file src/modules/stable.rej
This simply means the last part of the patch did not happen. You can manually fix it by adding the rlm_raw to the bottom of the src/modules/stable file.
echo rlm_raw >> src/modules/stable

Build
Install dependencies. This might take a while.
sudo apt-get install debhelper quilt autotools-dev libtool libltdl3-dev libssl-dev libpam0g-dev libmysqlclient-dev libgdbm-dev libldap2-dev libsasl2-dev libiodbc2-dev libkrb5-dev libperl-dev libpcap-dev python-dev libsnmp-dev libpq-dev
Build FreeRADIUS packages from the source. Be patient this will take some time too.
sudo fakeroot dpkg-buildpackage -b -uc
A successful build will show the following files:
ls ../*.deb
freeradius_2.2.5+git_amd64.deb
freeradius-common_2.2.5+git_all.deb
freeradius-dbg_2.2.5+git_amd64.deb
freeradius-dialupadmin_2.2.5+git_all.deb
freeradius-iodbc_2.2.5+git_amd64.deb
freeradius-krb5_2.2.5+git_amd64.deb
freeradius-ldap_2.2.5+git_amd64.deb
freeradius-mysql_2.2.5+git_amd64.deb
freeradius-postgresql_2.2.5+git_amd64.deb
freeradius-server-2.2.5
freeradius-server-2.2.5.tar.bz2
freeradius-utils_2.2.5+git_amd64.deb
libfreeradius2_2.2.5+git_amd64.deb
libfreeradius-dev_2.2.5+git_amd64.deb

Install
Install the newly built FreeRADIUS packages in the following sequence.
cd ..
sudo dpkg -i libfreeradius2_2.2.5+git_amd64.deb freeradius-common_2.2.5+git_all.deb
sudo dpkg -i freeradius_2.2.5+git_amd64.deb freeradius-krb5_2.2.5+git_amd64.deb freeradius-ldap_2.2.5+git_amd64.deb freeradius-dbg_2.2.5+git_amd64.deb freeradius-iodbc_2.2.5+git_amd64.deb 
sudo dpkg -i freeradius-mysql_2.2.5+git_amd64.deb freeradius-utils_2.2.5+git_amd64.deb 
A successful install should show the following:
$ sudo /etc/init.d/freeradius restart
[ ok ] Checking FreeRADIUS daemon configuration...done (Configuration appears to be OK.).
[ ok ] Stopping FreeRADIUS daemon: freeradius.
[ ok ] Starting FreeRADIUS daemon: freeradius.

References:
  1. rlm_raw patch
  2. Build Debian packages

Post a comment