Facebook Developers Network

Join MamakSpot Fb Developer Network


New Project unleashed !!!
Build You Own SMS System at home
http://cakesms.blogspot.com

Introduction to MamakSpot



Watch the demo video here

What is MamakSpot ?
A wifi controller. You can control your wifi users using a web based management system.

Features ? You can control the users by
1.by maximum usage hours
2.by expire date
3.by upload/download speed in kbps

How many versions of MamakSpot ?
1. MamakSpot Prepaid Edition
2. MamakSpot Manage Edition

MamakSpot Prepaid Edition ?
MamakSpot prepaid is targeted to people who wants to run prepaid business using Wifi. Admin can create X numbers of prepaid and registered or public users can buy the prepaid for their internet usage.

Mamakspot Manage Edition ?
This is fork from version 1 of MamakSpot. User must be registered first. Admin the, can select which user have the rights to surf the net. Admin simply enable particular user with some credentials like
1. upload/bandwith speed
2. Expiry date
Admin can check every connected user internet history like :
1. When he/she online
2. Number of hours online by day,month,year
3. Total bandwidth downloaded/uploaded
4. Sites visited
Who are the developer for MamakSpot ?
Currently, I'm the only one doing the RnD. From understanding how Radius server works to Web Management Interface. I can be contacted at 014.6412.911 ( Malaysia ) or by email at azril.nazli@gmail.com


Mamakspot V1 is free ( http://code.google.com/p/mamakspot/ )

Wednesday, April 16, 2008

Tutorial 3 : Free Radius 2.0.3

Okay, sudah sampai ke tahap nak install Free Radius. Sila download source code di URL di bawah :

http://freeradius.org/download.html

Download version 2.0.3 dan baca installation procedure. RTFM!. Saya galakkan compile dari source dari install guna RPM.

Download Free Radius

-bash-3.1$ wget ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-2.0.3. tar.gz
--08:33:54-- ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-2.0.3.ta r.gz
=> `freeradius-server-2.0.3.tar.gz'
Resolving ftp.freeradius.org... 66.135.41.84
Connecting to ftp.freeradius.org|66.135.41.84|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /pub/freeradius ... done.
==> SIZE freeradius-server-2.0.3.tar.gz ... 3488944
==> PASV ... done. ==> RETR freeradius-server-2.0.3.tar.gz ... done.
Length: 3488944 (3.3M)

100%[====================================================================================================================>] 3,488,944 134K/s in 27s

08:34:25 (126 KB/s) - `freeradius-server-2.0.3.tar.gz' saved [3488944]


Untar Free Radius
-bash-3.1$ tar zxvf freeradius-server-2.0.3.tar.gz

Configure Free Radius

-bash-3.1$ pwd
/var/www/html/freeradius-server-2.0.3
-bash-3.1$ ./configure
.
.
.
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h


Make Free Radius ( kalau tiada error )

-bash-3.1$ make


Kemudian kita install Free Radius

-bash-3.1$ make install


Kalau berjaya akan dapat mesej berikut

----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
[root@localhost freeradius-server-2.0.3]#


Dan binary berikut adalah yang berasal dari freeradius

[root@localhost freeradius-server-2.0.3]# rad
radclient radlast radtest radzap
radeapclient radsqlrelay radwho
[root@localhost freeradius-server-2.0.3]# rad


Nak uninstall Free Radius ? Malangnya, dalam Free Radius tidak diberikan sekali command make uninstall . Tapi boleh guna teknik di bawah :

You can use checkinstall to uninstall FreeRADIUS.

http://www.asic-linux.com.mx/~izto/checkinstall/

What you do is use checkinstall to install FreeRADIUS a second time from freeradius-server-2.0.2.tar.gz. You use the commands:

./configure
make
checkinstall

checkinstall will create a deb or rpm package for you. You then install the deb or rpm package and then uninstall it.


Ok. Skrg dah berjaya install Free Radius. Cuba local di mana radiusd ( Radius Daemon ) disimpan dan kita akan run untuk pertama kali


[root@localhost freeradius-server-2.0.3]# whereis radiusd
radiusd: /usr/local/sbin/radiusd


Runkan radius daemon dengan option -X ( so kita nampak apa yang sedang berlaku )

[root@localhost freeradius-server-2.0.3]# /usr/local/sbin/radiusd -X
.
.
.
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on proxy address * port 1814
Ready to process requests.

Berdasarkan maklumat di atas freeradius akan menggunakan 3 port iaitu 1812,1813 dan 1814.

Kita akan buat ujian Radtest untuk menguji server tersebut.Perlu diingatkan, fail configuration radius semuanya terletak di folder berikut
/usr/local/etc/raddb/

CD ke folder tersebut dan edit fail users

[root@localhost raddb]# vi /usr/local/etc/raddb/users


Dan letak configurasi berikut di bahagian paling bawah

# mamakspot user radtest demonstration
mankuk Cleartext-Password := "hayun"


Save fail tersebut dan laksanakan arahan berikut: ( kill radiusd dan run kembali dahulu )

radtest mankuk hayun 127.0.0.1 1812 testing123

Sila lihat gambar di bawah untuk hasil command tersebut.


Cuba lihat mesej radiusd -X yang mengatakan

auth: type "PAP"
+- entering group PAP
rlm_pap: login attempt with password "hayun"
rlm_pap: Using clear text password "hayun"
rlm_pap: User authenticated successfully
++[pap] returns ok
Login OK: [mankuk/hayun] (from client localhost port 1812)

Bermaksud anda memasukkan username dan password yang betul dan dapat reply status Login OK. Cuba masukkan username dengan password yang salah

auth: type "PAP"
+- entering group PAP
rlm_pap: login attempt with password "xhayun"
rlm_pap: Using clear text password "hayun"
rlm_pap: Passwords don't match
++[pap] returns reject
auth: Failed to validate the user.
Login incorrect (rlm_pap: CLEAR TEXT password check failed): [mankuk/xhayun] (from client localhost port 1812)
Found Post-Auth-Type Reject
+- entering group REJECT
expand: %{User-Name} -> mankuk
attr_filter: Matched entry DEFAULT at line 11
++[attr_filter.access_reject] returns updated


Anda akan direject.Dan sistem tidak akan authenticate anda.

Untuk mengubah nas secret "testing123", ubah fail clients.conf dan cari entry untuk 127.0.0.1


Jika anda telah berjaya ke tahap ini, itu sudah memadai. Tutorial seterusnya ialah kita akan ubah configuration radius server untuk menggunakan database MySQL sebagai storage. Buat masa ini anda boleh surf Google untuk maklumat menggunakan Free Radius

13 comments:

  1. Freeradius adalah untuk radius server.... jradius pulak untuk apa lak? saya dapat ni dari coova.org

    ReplyDelete
  2. jradius coova specifik.....saya tak pernah guna jradius.

    Yang biasa guna winradius ( 100 user fre ) dengan freeradius.

    Actually boleh guna winradius untuk authentication...cuma masalah lesen dia limit 100 orang aja

    http;//ad.protonmania.com ( th busy buat benda nih skrg )

    ReplyDelete
  3. ape maksud nih...

    /var/www/html/freeradius-server-2.0.3

    samada mv or ape?

    ReplyDelete
  4. bukan mv, cuma hanya pergi ker directory itu untuk configure software tue ..

    cd freeradius-server-2.0.3
    ./configure
    make
    make install

    ReplyDelete
  5. " Save fail tersebut dan laksanakan arahan berikut: ( kill radiusd dan run kembali dahulu ) "

    macam mana nak kill radiusd...
    kalau key in
    "root@student:# kill radiusd"
    tak dapat stop dia kata
    "bash: kill: radiusd: argument must be process or job IDs

    Dah tak paham kat sini....

    ReplyDelete
  6. bila cuba test
    #radtest mankuk hayun 127.0.0.1 1812 testing123

    dapat:

    Usage: radtest user passwd radius-server[:port] nas-port-number secret [ppphint] [nasname]


    apa maksud error nie? salah username @ password ker??

    ReplyDelete
  7. sepatutnya dapat reply radius

    username : mankuk
    password : hayun
    nas-secret: testing123
    accounting port : 1812
    host: 127.0.0.1

    radtest mankuk hayun 127.0.0.1 1812 testing123

    ReplyDelete
  8. boleh tak install freeradius guna

    yum install freeradius??

    Kalau boleh mana file source freeradius??

    ReplyDelete
  9. boleh aja, aslakan guna freeradius 2.0

    http://www.freeradius.org

    ReplyDelete
  10. mcm mne plk nk setting login page?
    x jpe la dlm nie.

    ReplyDelete
  11. Aku dapat error ni:

    [root@freeradius freeradius-server-2.0.3]# radtest zainal optimal3 127.0.0.1 1812 testing123
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    User-Name = "zainal"
    User-Password = "optimal3"
    NAS-IP-Address = 203.106.203.238
    NAS-Port = 1812
    radclient: no response from server for ID 250 socket 3

    ReplyDelete
  12. Guna VMware Player

    ReplyDelete
  13. bila buat radtest mankuk hayun 127.0.0.1 1812 testing123

    dia akan keluar cam nih..

    sending access-request of id 100 to 127.0.0.1 port 1812

    User-name = "mankuk"
    User-Password ="hayun"
    Nas-IP-address = 127.0.0.1
    Nas-Port = 1812

    rad_recv : Access-Reject packet from host 127.0.0.1 port 1812, id 100, length=20

    kenaper reject ? ..

    ReplyDelete