Integrasi easyhotspot + freeradius and Hotspot MikroTik
First install ubuntu server first
Do not forget to install a LAMP
code :
sudo tasksel
Then LAMP continuously OK
Now we try
Install the required packages
code :
sudo apt -get -y install sysstat rrdtool snmp snmpd dbconfig libphp – adodb -common php5 – cli php5 – gd php5 – gmp – pear php – snmp php5 php5 – adodb make- rpm alien subversion nmap libnet – netmask – perl curl FreeRADIUS freeradius – mysql php5 – mcrypt – SSLeay perl openssl – perl libnet libauthen – pam – perl libpam – runtime libio – pty – perl unzip git -core
code :
cd / opt
sudo git clone git : //easyhotspot.git.sourceforge.net/gitroot/easyhotspot/easyhotspot
code :
mysql -u root -p
CREATE USER ‘ EasyHotspot ‘ @ ‘ % ‘ IDENTIFIED BY ‘ EasyHotspot ‘ ;
GRANT ALL PRIVILEGES ON * . * TO ‘ EasyHotspot ‘ @ ‘ % ‘
– > WITH GRANT OPTION ;
CREATE DATABASE hotspot ;
exit
code :
cd / opt / EasyHotspot / install /
mysql -u root -p hotspot < easyhotspot_opensource_2010-10-21.sql
edit /etc/freeradius/sql.conf
adjust the mysql database e
code :
sql {
#
# Set the database to one of:
#
# mysql, mssql, oracle, postgresql
#
database = âmysqlâ
#
# Which FreeRADIUS driver to use.
#
driver = ârlm_sql_${database}â
# Connection info:
server = “localhost”
#port = 3306
login = “easyhotspot”
password = “easyhotspot”
# Database table configuration for everything except Oracle
radius_db = “hotspot”
Edit /opt/easyhotspot/htdocs/system/application/config/database.php
adjust database
Code:
$db[‘default’][‘hostname’] = “localhost”;
$db[‘default’][‘username’] = “easyhotspot”;
$db[‘default’][‘password’] = “easyhotspot”;
$db[‘default’][‘database’] = “hotspot”;
$db[‘default’][‘dbdriver’] = “mysql”;
edit /etc/freeradius/clients.conf
Make sure there is a line like this
ipaddr = // Adjust the ip 10.1.0.1 in mikrotik
secret = EasyHotspot // Adjust the radius mikrotik
shortname = 10.1.0.1 // hostname proxy , if there are no contents with Ip
edit /etc/freeradius/radiusd.conf
uncheck # nang part $ INCLUDE sql.conf
This section also : $ INCLUDE sql / mysql / counter.conf
find sections instantiate
add :
code :
max_all_mb
noresetcounter
then the accounting, session and post-auth, find the section # sql continue uncheck # e
edit /etc/freeradius/sql/mysql/counter.conf
look for the words:
sqlcounter noresetcounter {
Blaa |blaâ |blaâ |
}
delete, and replace with:
Code:
sqlcounter noresetcounter {
counter-name = Session-Timeout
Check-name = Session-Timeout
reply-name = Session-Timeout
sqlmod-inst = sql
key = User-Name
reset = never
query = “SELECT SUM (Acctsessiontime) radacct FROM WHERE UserName = ‘% {% k}'”
}
sqlcounter max_all_mb {
counter-name = Max-All-MB
Check-name = Max-All-MB
reply-name = Chillispot-Max-Total-octets
sqlmod-inst = sql
key = User-Name
reset = never
query = “SELECT SUM (AcctInputOctets) / (1024 * 1024) + SUM (AcctOutputOctets) / (1024 * 1024) radacct FROM WHERE UserName = ‘% {% k}'”
}
stop radius
Code:
/etc/init.d/freeradius stop
check config radius
Code:
/ usr / sbin / freeradius -X
if no error start again radius server
Code:
/etc/init.d/freeradius start
create a symbolic link on a web server so that can be accessed
Code:
ln -s / opt / EasyHotspot / htdocs / var / www / hotspot
change user / group
Code:
chown -R www-data.www-data / var / www / hotspot
FreeRADIUS finished
then setting mikrotik
at the hotspot> server profiles
select the server profile
then on the radius, click the radius use
create radius:
Radius keep clicking on the + sign.
continue to browse ip ip in FreeRADIUS, and secret content according to the settings in FreeRADIUS
It is finished
now can create a voucher or user of EasyHotspot
Access from <! – m -> <a class=”postlink” href=”http://ip-server-udu-ip-mikrotik-e/hotspot”> http: // ip-server-ip-udu -mikrotik-e / hotspot </a> <! – m ->
original username: admin
e password: admin123
Sumber Article Information
First install ubuntu server first
Do not forget to install a LAMP
code :
sudo tasksel
Then LAMP continuously OK
Now we try
Install the required packages
code :
sudo apt -get -y install sysstat rrdtool snmp snmpd dbconfig libphp – adodb -common php5 – cli php5 – gd php5 – gmp – pear php – snmp php5 php5 – adodb make- rpm alien subversion nmap libnet – netmask – perl curl FreeRADIUS freeradius – mysql php5 – mcrypt – SSLeay perl openssl – perl libnet libauthen – pam – perl libpam – runtime libio – pty – perl unzip git -core
code :
cd / opt
sudo git clone git : //easyhotspot.git.sourceforge.net/gitroot/easyhotspot/easyhotspot
code :
mysql -u root -p
CREATE USER ‘ EasyHotspot ‘ @ ‘ % ‘ IDENTIFIED BY ‘ EasyHotspot ‘ ;
GRANT ALL PRIVILEGES ON * . * TO ‘ EasyHotspot ‘ @ ‘ % ‘
– > WITH GRANT OPTION ;
CREATE DATABASE hotspot ;
exit
code :
cd / opt / EasyHotspot / install /
mysql -u root -p hotspot < easyhotspot_opensource_2010-10-21.sql
edit /etc/freeradius/sql.conf
adjust the mysql database e
code :
sql {
#
# Set the database to one of:
#
# mysql, mssql, oracle, postgresql
#
database = âmysqlâ
#
# Which FreeRADIUS driver to use.
#
driver = ârlm_sql_${database}â
# Connection info:
server = “localhost”
#port = 3306
login = “easyhotspot”
password = “easyhotspot”
# Database table configuration for everything except Oracle
radius_db = “hotspot”
Edit /opt/easyhotspot/htdocs/system/application/config/database.php
adjust database
Code:
$db[‘default’][‘hostname’] = “localhost”;
$db[‘default’][‘username’] = “easyhotspot”;
$db[‘default’][‘password’] = “easyhotspot”;
$db[‘default’][‘database’] = “hotspot”;
$db[‘default’][‘dbdriver’] = “mysql”;
edit /etc/freeradius/clients.conf
Make sure there is a line like this
ipaddr = // Adjust the ip 10.1.0.1 in mikrotik
secret = EasyHotspot // Adjust the radius mikrotik
shortname = 10.1.0.1 // hostname proxy , if there are no contents with Ip
edit /etc/freeradius/radiusd.conf
uncheck # nang part $ INCLUDE sql.conf
This section also : $ INCLUDE sql / mysql / counter.conf
find sections instantiate
add :
code :
max_all_mb
noresetcounter
then the accounting, session and post-auth, find the section # sql continue uncheck # e
edit /etc/freeradius/sql/mysql/counter.conf
look for the words:
sqlcounter noresetcounter {
Blaa |blaâ |blaâ |
}
delete, and replace with:
Code:
sqlcounter noresetcounter {
counter-name = Session-Timeout
Check-name = Session-Timeout
reply-name = Session-Timeout
sqlmod-inst = sql
key = User-Name
reset = never
query = “SELECT SUM (Acctsessiontime) radacct FROM WHERE UserName = ‘% {% k}'”
}
sqlcounter max_all_mb {
counter-name = Max-All-MB
Check-name = Max-All-MB
reply-name = Chillispot-Max-Total-octets
sqlmod-inst = sql
key = User-Name
reset = never
query = “SELECT SUM (AcctInputOctets) / (1024 * 1024) + SUM (AcctOutputOctets) / (1024 * 1024) radacct FROM WHERE UserName = ‘% {% k}'”
}
stop radius
Code:
/etc/init.d/freeradius stop
check config radius
Code:
/ usr / sbin / freeradius -X
if no error start again radius server
Code:
/etc/init.d/freeradius start
create a symbolic link on a web server so that can be accessed
Code:
ln -s / opt / EasyHotspot / htdocs / var / www / hotspot
change user / group
Code:
chown -R www-data.www-data / var / www / hotspot
FreeRADIUS finished
then setting mikrotik
at the hotspot> server profiles
select the server profile
then on the radius, click the radius use
create radius:
Radius keep clicking on the + sign.
continue to browse ip ip in FreeRADIUS, and secret content according to the settings in FreeRADIUS
It is finished
now can create a voucher or user of EasyHotspot
Access from <! – m -> <a class=”postlink” href=”http://ip-server-udu-ip-mikrotik-e/hotspot”> http: // ip-server-ip-udu -mikrotik-e / hotspot </a> <! – m ->
original username: admin
e password: admin123
Sumber Article Information