Categories
RedHat OS

Instalasi Radius Server pada Centos 5.3

1. Tujuan
picture42
Seiring dengan maraknya perkembangan wireless, maka dibutuhkan sebuah proses otentikasi user untuk melakukan pengecekan apakah user tersebut berhak masuk jaringan atau tidak. Untuk menjawab tantangan ini mari kita implementasikan chillispot yang berfungsi untuk aplikasi otentikasi dan freeradius sebagai manajemen client/user, MySql sebagai database billing, dan phpMyPrePaid sebagai aplikasi web base untuk manajemen user dan billing. Perlu diketahui bahwa chillispot dan freeradius diinstall pada gateway yang merupakan gerbang terakhir dari semua host pada LAN untuk berkomunikasi ke Internet. Jadi user yang login lewat media wireless atau kabel akan sama-sama melakukan proses otentikasi.

2. Topologi
simplep2
Untuk eth0 :
Ip address=10.200.16.17
Subnetmask=255.255.255.128
Default gateway=10.200.16.1


Untuk eth1:
IP untuk eth1 akan diberkan oleh chilli secara otomatis, jadi tidak perlu di konfigurasi.


PC-A:
Ip address =10.200.20.8
Subnet mask=255.255.255.128
Gateway =10.200.20.1
DNS=10.101.0.2


PC-B
Ip address =10.200.20.8
Subnet mask=255.255.255.128
Gateway =10.200.20.1
DNS=10.101.0.2

3. Instalasi chillispot

[root@FTPSVR radius_server]# wget http://www.chillispot.info/download/chillispot-1.1.0.i386.rpm
[root@FTPSVR radius_server]# rpm -ivh chillispot-1.1.0.i386.rpm

4. Instalasi freeradius

[root@FTPSVR radius_server]# yum install freeradius

5. Konfigurasi chillispot

[root@FTPSVR radius_server]# vim /etc/chilli.conf

Yang perlu di uncomment adalah:

net 10.200.20.0/25
dynip 10.200.20.0/25
dns1 10.101.0.2
radiusserver1 127.0.0.1
radiusserver2 127.0.0.1
radiusauthport 1812
radiussecret testing123
dhcpif eth1
uamserver https://10.200.20.1/cgi-bin/hotspotlogin.cgi
uamsecret ht2eb8ej6s4et3rg1ulp
uamallowed www.chillispot.org,10.101.0.2,10.200.20.3,
10.200.16.17

Perlu diperhatikan bahwa uamserver harus dalam SSL, cara mengktifkan fitur SSL pada webserver telah di jelaskan pada blog sebelumnya. Dynip digunakan sebagai range dhcp yang akan diberikan chilli.

6. Membuat file hotspotlogin.cgi di folder cgi-bin

[root@FTPSVR radius_server]# cp /usr/share/doc/chillispot-1.1.0/hotspotlogin.cgi /var/www/cgi-bin/
[root@FTPSVR radius_server]# chmod 755 /var/www/cgi-bin/hotspotlogin.cgi
[root@FTPSVR radius_server]# vim /var/www/cgi-bin/hotspotlogin.cgi

Ganti :

#$uamsecret = "ht2eb8ej6s4et3rg1ulp "; menjadi $uamsecret = " ht2eb8ej6s4et3rg1ulp ";
#$userpassword=1; menjadi $userpassword=1;

7. Konfigurasi radius

[root@FTPSVR radius_server]# vim /etc/raddb/radiusd.conf

Cari file :
# $INCLUDE ${confdir}/sql.conf
Kemudian edit menjadi

$INCLUDE ${confdir}/sql.conf
sqlcounter noresetcounter {
counter-name = Max-All-Session-Time
check-name = Max-All-Session
sqlmod-inst = sql
key = User-Name
reset = never
query = "SELECT SUM(AcctSessionTime) FROM radacct where UserName='%{%k}'"
}

Cari file : accounting
Kemudian edit menjadi :

accounting {
unix
radutmp
sql
}

Perhatikan pada bagian selain yang tiga di dalam kurung kurawal diatas harus di comment.

Cari file : instantiate
Kemudian edit menjadi :

instantiate {
exec
expr
noresetcounter
}

Cari file : authorize
Kemudian edit menjadi :

authorize {
preprocess
chap
mschap
suffix
sql
noresetcounter
}

8. konfigurasi client

[root@FTPSVR radius_server]# vim /etc/raddb/clients.conf

Tambahkan konfigurasi dibawah supaya client bisa dapat akses.

client 10.200.20.0/25 {
secret = testing123
shortname = localhost
}

9. konfigurasi slq

[root@FTPSVR radius_server]# yum install freeradius-mysql
[root@FTPSVR ~]# vim /etc/raddb/sql.conf

Edit konfigurasi dibawah dan sesuaikan dengan kondisi di gateway:

server = "localhost"
#login untuk mysql
login = "radius"
password = "3playplu5"
# Database yang harus dibuat untuk radius server
radius_db = "radius"

10. Instalasi phpMyPrePaid
Pastikan bahwa mysql server sudah terinstal di server anda.
Download file phpmyprepaid:

[root@FTPSVR ~]# cd /var/www/html/
[root@FTPSVR html]# wget http://waix.dl.sourceforge.net/
sourceforge/phpmyprepaid/phpmyprepaidRC3.tgz
Ekstrak file phpmyprepaidRC3.tgz yang akan menghasilkan file phpmyprepaid.
[root@FTPSVR html]# tar -zxvf phpmyprepaidRC3.tgz
[root@FTPSVR html]# chmod 777 /var/www/html/phpmyprepaid/www/

Konfigurasi lewat web browser :

http://10.200.16.17/phpmyprepaid/www/install/setup.php

Pembuatan user login:
user-interface-configuration
Konfigurasi database:
konfigurasi-database
Hasil akhir :
hasil-akhir

Untuk keamanan :
Hapus file install di /var/www/html/phpmyprepaid/www/install/

[root@FTPSVR html]# rm -rf /var/www/html/phpmyprepaid/www/install/
Ganti permission untuk var/www/html/phpmyprepaid/www
[root@FTPSVR html]# chmod 755 /var/www/html/phpmyprepaid/www/

Berikan grant akses kepada user yang bisa mengakses database radius :

[root@FTPSVR ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 5140
Server version: 5.0.45 Source distribution
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> GRANT ALL PRIVILEGES ON radius.* to 'radius'@'localhost' IDENTIFIED BY '3playplu5';
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)
mysql>

Dari perintah diatas dihasilkan sebuah user dengan nama radius dan password 3playplu5 yang mempunyai akses ke database radius.

11. Setting Firewall

[root@FTPSVR radius_server]# /etc/init.d/iptables stop
[root@FTPSVR radius_server]# /usr/share/doc/chillispot-1.0/firewall.iptables
[root@FTPSVR radius_server]# /etc/init.d/iptables save

Perhatikan : setiap service network melakukan restart, jika ada gangguan maka jalankan lagi perintah diatas, karena sering terjadi firewall bermasalah saat service network di restart.

[root@FTPSVR ~]# vim /etc/sysctl.conf
# Controls IP packet forwarding
net.ipv4.ip_forward = 1

12. menjalankan chilli dan radiusd
supaya otomatis start saat server di reboot.

[root@FTPSVR ~]#chkconfig chilli on
[root@FTPSVR ~]#chkconfig radiusd on

Jika ada perubahan konfigurasi restart chilli dan radiusd

[root@FTPSVR ~]#service chilli restart
[root@FTPSVR ~]# service radiusd restart

13. Pembuatan account
Pembuatan account bisa dilakukan dengan dua cara, yaitu lewat console linux dan lewat phpmyprepaid.
Cara pertama lewat console :

[root@FTPSVR html]# mysql -u radius -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 228
Server version: 5.0.45 Source distribution
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> INSERT INTO radcheck (UserName, Attribute, Value) VALUES ('budi', 'User-Password', 'budi');
mysql> quit

Cara kedua lewat phpMyPrePaid.
Pilih menu : Subscriber Expiration
cara-2

14. Testing Internet
Halaman login :

hal-login
Setelah sukses login :
sukses

Testing lewat console :

[root@FTPSVR html]#/usr/bin/radtest kaidxn gtg localhost 1812 testing123
Bila hasilnya seperti ini berarti radius server sudah berjalan dengan baik: rad_recv: Access-Accept packect from host 127.0.0.1:1812, id=1234, length=26 Session_Timeout = 28096

15. Referensi

http://www.technorody.com/membangun-server-hotspot-

dengan-chillispot-dan-freeradius.rody

http://www.chillispot.info/release.html

http://pinokiook.blogspot.com/2008/03/buat-hotspot-dengan-

menggunakan-apache_13.html

 

Instalasi Radius Server pada Centos 5.3

Sumber : http://url.stisitelkom.ac.id/29854

 

configur Iptablenya;

[root@FTPSVR radius_server]# /etc/init.d/iptables stop
[root@FTPSVR radius_server]# /usr/share/doc/chillispot-1.0/firewall.iptables
[root@FTPSVR radius_server]# /etc/init.d/iptables save

 

Testing lewat console :
[root@FTPSVR html]#/usr/bin/radtest kaidxn gtg localhost 1812 testing123
Bila hasilnya seperti ini berarti radius server sudah berjalan dengan baik: rad_recv: Access-Accept packect from host 127.0.0.1:1812, id=1234, length=26 Session_Timeout = 28096

 

Ga bisa konek antara root dengan localhost mas

  1. Itu masalahnya pada saat memasukkan user dan password ya ?

  2. coba jalankan perintah berikut lewat konsol :
    [root@FTPSVR html]#/usr/bin/radtest kaidxn gtg localhost 1812 testing123

    penjelasan : username= kaidxn
    password= gtg
    Secreet = testing123
    sesuaikan dengan server Anda.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from Just Shared on Tel-U

Subscribe now to keep reading and get access to the full archive.

Continue reading