آموزش گام به گام FreeRadius

ROOT1

Administrator
#1
آموزش گام به گام FreeRadius

FreeRadius Step By Step Installation
شما در این آموزش به صورت گام به گام با مراحل نصب FreeRadius در centos 5 & 6 آشنا خواهید شد
Radius Step by Step installation on centos 5 & 6
Just follow the instructions below to have your FreeRADIUS setup ready to go when used along with our WHMCS module, we have distinguished the difference between CentOS commands


CentOS 5:
PHP:
[email protected]#yum install freeradius2 freeradius2-mysql freeradius2-utils mysql-server -y
CentOS 6:
PHP:
[email protected]#yum install freeradius freeradius-mysql freeradius-utils mysql-server -y
PHP:
/etc/init.d/iptables stop
chkconfig iptables off
To setup MySQL, start the service by running below:
PHP:
[email protected]#service mysqld start
Create a root passworld for mysql:
code:
[email protected]#mysqladmin -u root password radius123 (change the password radius123 to your password )
Login into mysql using:
PHP:
[email protected]#mysql -u root -p
code:
Now create the database and grant all privileges to user radius:
mysql>CREATE DATABASE cloudradius;
mysql>GRANT ALL PRIVILEGES ON cloudradius.* TO [email protected] IDENTIFIED BY "radpass";
and
mysql>GRANT ALL PRIVILEGES ON cloudradius.* TO [email protected]'WHMCS IP' IDENTIFIED BY 'radpass';

( NOTE: please add your whmcs ip in place of 'WHMCS IP' field above )

mysql>flush privileges;
mysql>exit


Now open up CentOS:/etc/raddb/sql.conf and enter your mysql database details you just created, Example:


PHP:
[email protected]#vi /etc/raddb/sql.conf
PHP:
# Connection info:
server = "localhost"
#port = 3306
login = "radius"
password = "radpass"
# Database table configuration for everything except Oracle
radius_db = "radius"
and save
to save changes ( shift : and type wq and enter)

In

PHP:
nano /etc/raddb/radiusd.conf
ensure that the line saying is uncommented:
$INCLUDE sql.conf

***IMPORTANT***
Edit /etc/raddb/sites-available/default and uncomment the line containing ‘sql’ in the "authorize"{} section and ‘sql’ in the "accounting" {} section, also uncomment ‘sql’ under "session" {}.
Additionally, edit /etc/raddb/sites-available/inner-tunnel and uncomment the line containing ‘sql’ under “authorize" {} and under "session" {}.

Open up
PHP:
nano /etc/raddb/clients.conf
set your secret to something a bit more random, example:
Change:
PHP:
secret = testing123  ( Change testing123 to your password )
To configure IP-Pool Via MYSQL DB please configure below.

uncomented line

PHP:
 " $INCLUDE sqlippool.conf"
in

PHP:
nano /etc/raddb/radiusd.conf
we need change the line
PHP:
"$INCLUDE sql/postgresql/ippool.conf"

to

""$INCLUDE sql/mysql/ippool.conf"
in

PHP:
nano /etc/raddb/sqlippool.conf
we need to add "sqlippool" line in "Accounting" and "Post-Auth" sections in /etc/raddb/sites-enabled/default



Now check to see if Radius is working ok by restarting:
PHP:
[email protected]#service radiusd restart
or
PHP:
[email protected]#service freeradius restart
Radius installation is Done

OPTIONAL
To add clients (External VPN Servers) you would edit CentOS:

PHP:
nano /etc/raddb/clients.conf
and directly under this line:


code:
# coa_server = coa
}
 
Add a block such as this:
client VPN_SERVER_IP {
secret = YOUR SECRET HERE
shortname = yourVPN
nastype = other
}




To allow external servers and software to authenticate off your FreeRADIUS, this has to be done every time you setup an external server to use this FreeRADIUS database.

Everytime you add a client or change a value in the config files you need to restart radius like this:
[email protected]#service radiusd restart

**Please follow below if using our WHMCS FreeRADIUS Module and UAS System:**

Open up
code:
nano /etc/raddb/sql.conf
for CentOS

or

code:
nano /etc/freeradius/sql.conf
for Ubuntu and uncomment the following line:


PHP:
#readclients = yes
to:
readclients = yes
Now your FreeRADIUS will read off the MySQL NAS table for clients – when adding NAS servers via our UAS system it will auto create the NAS table in your FreeRADIUS databases the first time you add a client.





REMEMBER TO INSTALL IONCUBE!
Regards

Root.ir administrator

 
last_edited:
بالا