We are going to build FreeRADIUS version 3.0.21 with ORACLE Module rlm_sql_oracle.
Download ORACLE Instant Client
Visit ORACLE official site and download oracle instant client. For that, you may need to log in. I'm downloading v12.2
Here is the link for oracle instant client. https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
mkdir /opt/oracle
cp instantclient-* /opt/oracle/
unzip instantclient-basic-linux.x64-12.2.0.4.0.zip
unzip instantclient-sdk-linux.x64-12.2.0.4.0.zip
Add below lines to file .bash_profile
vim ~/.bash_profile
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/oracle/instantclient_12_2
source ~/.bash_profile
Now verify the environment.
env | grep -i oracle
LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:/usr/local/lib:/usr/local/lib64
ORACLE_HOME=/usr/lib/oracle/12.2/client64
Create a symlink for client shared library libclntsh.so. As, while compiling FreeRADIUS look for that oracle library.
cd /opt/oracl/instantclient_12_2
ln -s libclntsh.so.12.1 libclntsh.so
Download FreeRADIUS
Install dependency first.
yum install libtalloc-devel
wget ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-3.0.21.tar.gz
tar xvf freeradius-server-3.0.21.tar.gz
cd freeradius-server-3.0.21
Compile FreeRADIUS with the below parameters.
./configure --with-oracle-home-dir=/opt/oracle/instantclient_12_2 --with-oracle-lib-dir=/opt/oracle/instantclient_12_2 --with-oracle-include-dir=/opt/oracle/instantclient_12_2/sdk/include
make
make install
Now configure Radius with oracle module.
vim /usr/local/etc/raddb/mods-available/sql
dialect = "oracle"
driver = "rlm_sql_oracle"
## your db credential here.
login = "wifiradius_admin"
password = "xxxxxxxx"
radius_db = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=XXX.XXX.XXX.XXX)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dbname)))"
cd /usr/local/etc/raddb/mods-enabled
ln -s ../mods-available/sql sql
Launch FreeRADIUS in debug mode and if everything looks ok then start the service.
radiusd X
Here, you can see radius module being loaded.
rlm_sql (sql): Driver rlm_sql_oracle (module rlm_sql_oracle) loaded and linked.
systemctl start radiusd
Now your FreeRADIUS service should be running with ORACLE module.
Top comments (0)