Membangun Server Hotspot Ubuntu 12.04

Pada tutorial kali ini kita akan membangun server hotspot linux ubuntu 12.04. Kegunaan server hotspot linux untuk melakukan manajemen user dan voucher pengguna hotspot internet. Server hotspot yang terintegrasi dengan aplikasi PHPMyPrepaid memberikan fitur akses internet berupa time based, date expiration dan kapasitas akses data. Pengguna setelah terhubung dengan jaringan wireless 2.4 GHz yang akan mengakses internet di authentifikasi oleh server FreeRadius apabila username dan login valid maka akses internet diperbolehkan. Server hotspot linux memiliki dua kartu ethernet, eth0 terhubung ke internet sedangkan eth1 terhubung langsung dengan perangkat akses point. Berikut ini langkah konfigurasi linux ubuntu 12.04 sebagai server hotspot.

Instalasi Paket Aplikasi
apt-get install freeradius freeradius-mysql mysql-server chillispot snmp snmpd rrdtool phpmyadmin ssl-cert

Konfigurasi IP Forwarding
vim /etc/sysctl.conf
net.ipv4.ip_forward=1

NAT Interface Internet
vim /etc/rc.local
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Konfigurasi Apache SSL
a2enmod ssl
mkdir /etc/apache2/ssl

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

vim /etc/apache2/sites-available/default-ssl
#File sertifikat dan key apache disesuaikan
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

chown -R www-data.www-data /etc/apache2/ssl/

a2ensite default-ssl
service apache2 reload


Konfigurasi Database MySQL
root@budi-desktop:~# mysql
mysql> create database hotspot;
mysql> grant all privileges on hotspot.* to ‘hotspot’@’localhost’ identified by ‘hotspot’;
mysql> grant all privileges on hotspot.* to ‘hotspot’@’127.0.0.1′ identified by ‘hotspot’;
mysql> \q

Ekstrak Aplikasi dan Direktori
tar xzvf /home/budi/Unduhan/phpmyprepaidRC3.tgz
cp -R phpmyprepaid/www/ /var/www/hotspot
chown -R www-data.www-data /var/www/hotspot/
mv phpmyprepaid/ /usr/local/
cd /usr/local/phpmyprepaid/configfiles/radius/
cp /etc/freeradius/sql.conf /etc/freeradius/sql.conf.bak
cp sql.conf /etc/freeradius/


Konfigurasi PHPMyprepaid
cd /var/www/hotspot/
mv install/ ins

Konfigurasi Freeradius
vim /etc/freeradius/radiusd.conf
$INCLUDE sql.conf
$INCLUDE sql/mysql/counter.conf
instantiate {
noresetcounter
}

vim /etc/freeradius/sql.conf
server = “localhost”
#port = 3306
login = “hotspot”
password = “hotspot”
radius_db = “hotspot”

vim /etc/freeradius/sites-enabled/default
authorize {
sql
noresetcounter
}

accounting {
sql
sql_log
}

session {
radutmp
sql
}

post-auth {
sql
sql_log
}

Post-Auth-Type REJECT {
# log failed authentications in SQL, too.
sql
attr_filter.access_reject
}

mkdir /var/log/freeradius/radacct
touch /var/log/freeradius/radacct/sql-relay
chmod 777 /var/log/freeradius/radacct/sql-relay

vim /etc/freeradius/clients.conf
client localhost {
ipaddr = 127.0.0.1
secret = testing123
require_message_authenticator = no
shortname = localhost
nastype = other
}

/etc/init.d/freeradius restart

Pengujian Freeradius
radtest budi 1234 localhost 0 testing123
Sending Access-Request of id 32 to 127.0.0.1 port 1812
User-Name = “budi”
User-Password = “1234″
NAS-IP-Address = 127.0.1.1
NAS-Port = 0
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=32, length=50
WISPr-Bandwidth-Max-Up = 128
WISPr-Bandwidth-Max-Down = 128
Session-Timeout = 60

Konfigurasi Chillispot
vim /etc/chilli.conf
debug
pidfile /var/run/chilli.pid
net 192.168.182.0/24
dns1 172.16.0.5
dns2 172.16.0.6
radiusserver1 127.0.0.1
radiusserver2 127.0.0.1
radiussecret testing123
dhcpif eth1
uamserver https://192.168.182.1/cgi-bin/hotspotlogin.cgi
uamsecret testing123

cd /usr/share/doc/chillispot/
cp hotspotlogin.cgi.gz /usr/lib/cgi-bin/
cd /usr/lib/cgi-bin/
gunzip hotspotlogin.cgi.gz

vim hotspotlogin.cgi
$uamsecret = “testing123″;
$userpassword=1;

vim /etc/default/chillispot
ENABLED=0
/etc/init.d/chillispot restart

0 comments:

Post a Comment

Please Enable JavaScript!
Mohon Aktifkan Javascript![ Enable JavaScript ]
close
iklan 120 x 600 kanan
close