Sie sind auf Seite 1von 10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.

04forMikrotikHotspot/PPoE/PPTP
0

Lainnya BlogBerikut

pribadi.teguh90@gmail.com Dasbor Keluar

AndrewPakpahan
MyThoughts,MyIdeas,MyExperiences,MyFriends
Sunday,August19,2012

Labels

InstallingandConfiguringFreeradius+MySQLand
Daloradius+MySQLonUbuntuServer12.04forMikrotik
Hotspot/PPoE/PPTP(updated)

apple(4)

InstallingandConfiguringFreeradius

FedoraCore(8)

ThefirststepistoInstallFreeradius(ensureyoualreadyupdateyouraptwithaptupdate)

GakPenting(1)

$sudoaptgetinstallfreeradius
*StartingFreeRADIUSdaemonfreeradius[OK]

BandwidthManagement(2)
Bandwidthd(1)

GoogleChrome(2)

Settingupfreeradiusutils(2.1.10+dfsg3build2)...

Info(4)

Thenpreparethedatabaseforfreeradius.Createdatabaseradiusandassignusernameand
passwordforaccessingit.

LAMP(1)
Linux(12)

#mysqlurootp
Enterpassword:
WelcometotheMySQLmonitor.Commandsendwithor\g.

MailServer(3)
Mikrotik(1)

YourMySQLconnectionidis51
Serverversion:5.5.240ubuntu0.12.04.1(Ubuntu)

MyExperiences(12)

Copyright(c)2000,2011,Oracleand/oritsaffiliates.Allrightsreserved.

MySQL(1)

OracleisaregisteredtrademarkofOracleCorporationand/orits
affiliates.Othernamesmaybetrademarksoftheirrespective

Network(9)
Newtechnologies(8)

owners.

Security(1)
Type'help'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.
mysql>createdatabaseradius
mysql>grantallonradius.*toradius@localhostidentifiedby"thepassword"
QueryOK,0rowsaffected(0.00sec)

Server(9)
Ubuntu(2)
Virus(1)

ThenextstepwastoinsertthedatabaseschemaandIrealizedthatIcouldnotfindthedatabase
schemein/etc/freeradius.

BlogArchive
ObviouslyIshouldinstallfreeradiusmysqlpackagefirst.

2012(5)

#aptgetinstallfreeradiusmysql

September(1)

Settingupfreeradiusmysql(2.1.10+dfsg3build2)...

August(2)

*ReloadingFreeRADIUSdaemonfreeradius[OK]

Theninsertthedatabasescheme
#mysqlurootpradius</etc/freeradius/sql/mysql/schema.sql
Enterpassword:
#mysqlurootpradius</etc/freeradius/sql/mysql/nas.sql
Enterpassword:

Nowwetrytoinsertnewuserfortestingpurposeindatabase.

HowtoenableMySQL
remoteaccesson
UbuntuServer...
InstallingandConfiguring
Freeradius+MySQL
and...
May(2)
2011(2)

#mysqlurootp

2010(5)

Enterpassword:

2009(3)

WelcometotheMySQLmonitor.Commandsendwithor\g.
YourMySQLconnectionidis72

2008(18)

Serverversion:5.5.240ubuntu0.12.04.1(Ubuntu)

2007(19)

Copyright(c)2000,2011,Oracleand/oritsaffiliates.Allrightsreserved.

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

2006(9)
1/10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.04forMikrotikHotspot/PPoE/PPTP

2005(14)
OracleisaregisteredtrademarkofOracleCorporationand/orits
affiliates.Othernamesmaybetrademarksoftheirrespective
owners.
Type'help'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.
mysql>useradius
Readingtableinformationforcompletionoftableandcolumnnames
YoucanturnoffthisfeaturetogetaquickerstartupwithA
Databasechanged
mysql>INSERTINTOradcheck(UserName,Attribute,Value)VALUES('sqltest','Password',
'testpwd')
QueryOK,1rowaffected(0.04sec)
mysql>exit
Bye

ThenextstepisweneedtoconfiguretheFreeradiusfiles.
Edit/etc/freeradius/sql.conffile.Settingdatabasetype,loginandpasswordthatwealreadysetup
before.
#vim/etc/freeradius/sql.conf

database=mysql
login=radius
password=thepassword
readclients=yes

Theneditthe/etc/freeradius/sitesenabled/defaultfile
#vim/etc/freeradius/sitesenabled/default

Uncommentsqlonauthorize{}
#SeeAuthorizationQueriesinsql.conf
sql
Uncommentsqlonaccounting{}
#SeeAccountingqueriesinsql.conf
sql
Uncommentsqlonsession{}
#SeeSimultaneousUseCheckingQueriesinsql.conf
sql
Uncommentsqlonpostauth{}
#SeeAuthenticationLoggingQueriesinsql.conf
sql

Thenweedit/etc/freeradius/radiusd.conffile
#vim/etc/freeradius/radiusd.conf

LiveTrafficFeed
AvisitorfromSemarang,
JawaTengahviewed
"AndrewPakpahan:
InstallingandConfiguring
Freeradius+MySQLand
Daloradius+MySQLon
UbuntuServer12.04for
AvisitorfromIndonesia
Mikrotik
viewed"Andrew
Hotspot/PPoE/PPTP
Pakpahan:Membatasi
(updated)"28secsago
voucherhotspotmikrotik
AvisitorfromIndonesia
berdasarkanwaktuaktif"
19minsago
viewed"Andrew
Pakpahan:Membatasi
voucherhotspotmikrotik
berdasarkanwaktuaktif"
AvisitorfromIndonesia
46minsago
viewed"Andrew
Pakpahan:Mengganti
timezoneUbuntuServer
MenjadiWaktuIndonesia
AvisitorfromPolska,
(Asia/Jakarta)"47mins
KujawskoPomorskie
ago
viewed"Andrew
Pakpahan:Network"3hrs
AvisitorfromJakarta,
2minsago
JakartaRayaviewed
"AndrewPakpahan:How
toenableMySQLremote
accessonUbuntuServer
12.04"4hrs10minsago
AvisitorfromNeuquen
viewed"Andrew
Pakpahan:HowTo
MonitorNetworkwith
NtoponUbuntu10.04
AvisitorfromEngen,
andMikrotik"4hrs54
BadenWurttemberg
minsago
viewed"Andrew
Pakpahan:Installingand
ConfiguringFreeradius+
MySQLandDaloradius+
MySQLonUbuntu
AvisitorfromMesa,
Server12.04forMikrotik
Arizonaviewed"Andrew
Hotspot/PPoE/PPTP
Pakpahan:Howtoenable
(updated)"4hrs56mins
SNMPMonitoringon
ago
UbuntuServer12.04.2"5
AvisitorfromBrescia,
hrs16minsago
Lombardiaviewed
"AndrewPakpahan:
InstallingandConfiguring
Freeradius+MySQLand
Daloradius+MySQLon
UbuntuServer12.04for
RealtimeviewGetFeedjit

#Uncomment#$INCLUDEsql.conf
$INCLUDEsql.conf

Totestourconfiguration,firstwemuststopthefreeradiusservice(ifalreadyrunning)
#/etc/init.d/freeradiusstop
*StoppingFreeRADIUSdaemonfreeradius[OK]

Thenrunthiscommandtorunfreeradiusindebuggingmode.Ifthereisnoerror,youaregoodtogo.
#freeradiusX

Onanewshellorwindowwetestedtheconnection
$radtestsqltesttestpwdlocalhost18128testing123
SendingAccessRequestofid65to127.0.0.1port1812

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

2/10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.04forMikrotikHotspot/PPoE/PPTP
UserName="sqltest"
UserPassword="testpwd"
NASIPAddress=127.0.1.1
NASPort=18128
rad_recv:AccessAcceptpacketfromhost127.0.0.1port1812,id=65,length=20

ThetestrunningwellwithAcceptresponsefromtheserver.
ToenableMikrotikdevicetoaccessourserverweneedtoaddclientinclients.conffile.
#vim/etc/freeradius/clients.conf
client10.0.0.0/8{
secret=testingpassword
shortname=testing
nastype=mikrotik
}

*note:weneedtostopfreeradiusXandthenrunningitagaintotestourconfiguration
Update(Jan27,2013):IfwewanttoaddspecificvalueforMikrotik,weneedtoaddmikrotik
dictionary
#vim/etc/freeradius/dictionary

Thenaddthislinebelow

$INCLUDE/usr/share/freeradius/dictionary.mikrotik

MikrotikConfiguration
WeneedtoconfigureourMikrotikdevicestouseournewradiusserver.WeneedtologintoMikrotik
deviceandconfiguretheradiusinRadiusmenu.
Belowimageisanexampleofourconfiguration.

*Note:weincreasetimeoutsetttingto3000mstoenableinvalidloginnotifications.(notworkingwith
default300ms)
DaloradiusInstallation
First,weneedtodownloaddaloradiusfile
$wgethttp://downloads.sourceforge.net/project/daloradius/daloradius/daloradius0.99/daloradius
0.99.tar.gz?
r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fdaloradius%2Ffiles%2F&ts=1345296201&use_mirror=nchc

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

3/10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.04forMikrotikHotspot/PPoE/PPTP
Renameandextractthefile
#tarxvfzdaloradius0.99.tar.gz
#mvdaloradius0.99daloradius

Movethefiletothewebserverdirectory.InthiscaseIuseapacheonUbuntusothelocationisat
/var/www
#mvdaloradius0.99daloradius
#mvdaloradius/var/www

Thenweneedtosetupthedatabase.BecausealreadysetupthefreeradiususingMySQL,sowe
don'tneednewdatabase.Allweneedtodoistoimportthedaloradiusschemeintoourexisting
radiusdatabase.
#cd/var/www/daloradius/contrib/db
#mysqlurootpradius<mysqldaloradius.sql

Afterdatabasesuccessfullyaltered,weneedtoconfigurethedaloradiussetting.
#vim/var/www/daloradius/library/daloradius.conf.php

Changethedatabasepassword
$configValues['CONFIG_DB_PASS']='thepassword'

Thenwecantrytoaccessdaloradiususinghttp://ipaddressoftheserver/daloradius
*Note:Inmyinstallation,ihadaproblembecauseIdidn'thavephp5gdphppearandphpdb
packagesinstalledonmyUbuntuserver.
Todealwiththisproblemyoucaninstallthepackagesusing
#aptgetinstallphp5gdphppearphpdb

References,
Mastaqim(2012),http://www.mastaqim.web.id/2012/08/installfreeradiusmysqlubuntuserver.html
Daud(2012),http://daud.rasadigital.com/installdaloradiusdiubuntuserver/

PostedbyAndrewPakpahanat3:23PM

35comments:
Anonymoussaid...
amtotallynewtoubuntu.
supposeirunsomethinglikethis"videbian/rules"andifinishwitheditingthescript,how
doisaveitandgobacktothemainterminal.
iamstrandedhere.iendupclosingtheterminalthinkingitwouldaskmetosave
changesbutnothing.Thechangesarenoteffectedwhenigobacktocheckonthescript
again.
Wednesday,August22,2012

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

4/10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.04forMikrotikHotspot/PPoE/PPTP
AndrewPakpahansaid...
Toexitfromviyoucanpress[esc]thenpress[:wq!]thenenter.
Wednesday,August22,2012
Golgotsaid...
Greatjob,Thanks,
attheendtologintodaloradiuspage:
http://youripaddress/daloradius
Logintothemanagement:
username:administrator
password:radius
Wednesday,September19,2012
RizhaArdiantosaid...
ThanksforyournicepostAndrew.
Imtryingtousecoovachillibutstillnotworking.Anyideashowtouseitwithdaloradius
inthispost?
Thankyou
Monday,September24,2012
RizhaArdiantosaid...
ThanksforyournicepostAndrew.
Imtryingtogetcoovachilliwork,butstillnoluck.Anyideashowtomakeitworkwith
thissetup?
Bigthanks
Monday,September24,2012
AndrewPakpahansaid...
@Golgot:Thanks:)
@Rizha:Ihaven'ttriedcoovachilli,butIthinkyourproblemisinthecoovachilli
configurationwithfreeradius.
Tuesday,September25,2012
hidrargiumsaid...
Hi,Andrew.
Thankyouforagoodarticle.
Somenotes:
AfteraddingnewgranstinMySQL:

grantallonradius.*toradius@localhostidentifiedby"thepassword"

Youneedtopreformnextcommand:

flushprivileges

Tuesday,October09,2012
Rizhasaid...
Andrew,
howifwewanttouseanexternalradiusserver?
Thursday,October11,2012

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

5/10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.04forMikrotikHotspot/PPoE/PPTP
GoldenNetworkssaid...
#vim/etc/freeradius/clients.conf
client10.0.0.0/8{
secret=testingpassword
shortname=testing
nastype=mikrotik
}
whenienterdowninthelastalready34entries/24/32etc
whereihavetoaddthisentryoredittheexistingone???
Pleasequickreplyimstuckontheedge.
Monday,October22,2012
AndrewPakpahansaid...
@GoldenNetwork:
Justaddasnewlines.Putcommentsonallpreviouslines.
Monday,October22,2012
GoldenNetworkssaid...
Wellihavedoneeverythingthroughurblognigottheresultinpositivewhenigive
commandforradtest.itseemstobok
butasimusingubuntuserver12.04Ltssoimunabletoaccessdaloradiuspage.
127.0.0.1/daloradius.
idontknowhowtoattachitwiththemikrotikbycable
Tuesday,October23,2012
AndrewPakpahansaid...
@GoldenNetwork
DoyouunderstandIPaddressconcept?Youneedtounderstandthisbeforeeventrying
thissetup.
Thursday,October25,2012
GoldenNetworkssaid...
Thanxforreply...ididsameasumentionedthesameips10.0.0.0/8eveninmikrotik
10.0.0.50
hotspotsetupalreadyworkinginrouterboard.
shouldiuse1simpleethernetcablebetweendaloradiusnmikrotik???
whatipwouldbeassignedtothemikrotikinterface???
shouldiusethistopology:http://bejatijampang.files.wordpress.com/2012/07/slide2
300x296.jpg
shouldihavetoadd2lancardsinubuntuboxorafterthesetupremovetheinternetfrom
ubuntuandput1jumperbetweenmikrotiknubuntuasilinkeduptopology???
Thedaloradiusboxisreadymyproblemishowtomakeconnectionsbetween
routerboardanddaloradiusboxtogetaccessdaloradiouswebpage
Friday,October26,2012
VanderwykSiahaansaid...
whyifoundmessage
"noresponsefromserverforID210socket3"
howtoresolftit?
Monday,December03,2012
DivyaSsaid...
thankusir..ithelpedusalot:)
Tuesday,January29,2013

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

6/10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.04forMikrotikHotspot/PPoE/PPTP
Rossosaid...
HelloAndrew,thnkforthisblog.
Ihaveasmallquestion,caniputtheserveronadifferentlocation.
Willthismakealltrafficgototheexternalserver?
Friday,March29,2013
HamadAhmedsaid...
HiAll,
FirstthankstoAndrew.
IamtryingtoinstalldaloRADIUS,butIamfacingsomeissueswithsqlmodule
configurations.WhenIuncommentthesqlfromtheconfigurationfileIreceivedthe
followingerror.
/etc/freeradius/sql.conf[22]:Instantiationfailedformodule"sql"
/etc/freeradius/sitesenabled/default[159]:Failedtoloadmodule"sql".
/etc/freeradius/sitesenabled/default[62]:Errorsparsingauthorizesection.
anyonecanhelp?
Thanks,
Hamad
Wednesday,April24,2013
Pavlossaid...
Greatarticle.Ifolloweditanditseamsitworks.
Ihaveaquestion.Nowafterconfiguringtheserverandthemikrotik.
FirsthowcanIcheckiftheycommunicate?
SecondhowcanItestifauserauthenticateswhenitconnectstowifi?
Thankyou
Monday,May20,2013
AndrewPakpahansaid...
@Pavlos:Youcantrytoactivatehotspotonyourwirelessinterface.Thentrytologin
withyouradiusaccount.
Tuesday,May21,2013
Alejandrosaid...
Congratulationsforyourcoolpostandthanksforsharingyourexperience.
I'vetwoquestions:
Isthenumberofuserslimited?
WhichisthehomepageforthehotspotloginusersandcanIconfigureanewone?
Thanksinadvance.
Greetings.
Wednesday,September04,2013
Kevinsaid...
ThanksAndrew.Afterfollowyourblog,Igottohttp://localhost/daloradiusaftertypingin:
username:administrator
password:radius
Ireceiveanerrormessage."DatabaseconnectionerrorDBerrorextensionnotfound.
Pleasehelp.
Thanks.
Saturday,January11,2014
Anonymoussaid...
Thanksyouforyourhelp,Greatjobworkedformewithoutmuchtrouble.
Wednesday,February12,2014

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

7/10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.04forMikrotikHotspot/PPoE/PPTP
Anonymoussaid...
IhavebeenworkingmywaythroughthisconfigasnewtoUbuntu
Allseemedtobegoingwelluntilitestedusingradtestwhichreturnsthefollowingerror:
Invalidoctetstring"sqltest"forattributename"UserName"
radclient:Nothingtosend.
Ihaveviewedthetablecontentsanditalllooksinorderanddoublecheckedthe
config??
Anyhelpwouldbeverymuchappreciated.Thanks
Wednesday,March26,2014
alfurqansaid...
hi,
wouldyouhelpme,whatmeansthat:unabletoopenfile
"/etc/freeradius/sql/mysql/ippooldhcp.conf":nosuchfileordirectory
errorsreadingorparsing/etc/freeradius/radiusd.conf
Saturday,June14,2014
Anonymoussaid...
Hi,
Ihavefollowedthislinkforreferenceinrunningdaloradiuswithfreereadius.
https://help.ubuntu.com/community/CategoryNetworking/daloRADIUS
butIcan'tseemtogetpasstheloginpage.
http://192.168.2.133/daloradius/dologin.php
Databaseconnectionerror
ErrorMessage:DBError:connectfailed
couldyoupointoutwhatIhavemissed?
Ihaveusedboth12.04and14.04LTSandbothhavesameerrormessage
whatoutputdoyouneedinordertofurthertroubleshootthis?
manythanks,
Tuesday,July08,2014
Anonymoussaid...
IhaveFreeradiusrunningonUbuntu12.04server,toauthenticateiBurstclientsofmy
ISP.Itisworkingfine,theonlyissueisthatIdon'tknowhowtomanagetheseclients.
ForexampleifaclienthasnotpayedtouseInternet,Ineedtobeabletodisconnect
him/herandreconnecthim/heroncethepaymenthasbeendone.TheonlywaythatI
knowistoeditthe/etc/freeradius/usersfileandcommenttheFramedIPAddressline
whichisnoteasytodoeverytime.Also,IfearthatImightaccidentallydamagethefile
ifIcontinueaccessingiteverydayandmodifyingit.
Iwouldliketoknowifthereisanyotherwaytodothis(preferablythroughawebclient).I
foundonecalledDialupadminwebinterface,butIdon'tknowifIhavetoinstall
FreeradiusfromscratchtobeabletousethewebinterfaceorifIcanjustinstallthisand
usetheexistingFreeradiuswithoutreinstallation.
Thursday,July17,2014
odik'ssaid...
Andrew,plshelp!iamamtryingtoinstalldaloRADIUS,butIamfacingsomeissues
withsqlmoduleconfigurations.WhenIuncommentthesqlfromtheconfigurationfileI
receivedthefollowingerror.
/etc/freeradius/sql.conf[22]:Instantiationfailedformodule"sql"
/etc/freeradius/sitesenabled/default[159]:Failedtoloadmodule"sql".
/etc/freeradius/sitesenabled/default[62]:Errorsparsingauthorizesection.

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

8/10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.04forMikrotikHotspot/PPoE/PPTP
Monday,July28,2014
Hermansaid...
Thankyouforthegreatguide!
Workslikeacharm.
Herman
Monday,October20,2014
Anonymoussaid...
Ialsogetthiserror:
Databaseconnectionerror
ErrorMessage:DBError:extensionnotfound
Pleasehelp.Thanks.
Tuesday,January13,2015
Anonymoussaid...
Thesolutionfor
Databaseconnectionerror
ErrorMessage:DBError:extensionnotfound
isaptgetinstallphpmysql
Wednesday,January14,2015
samansupriadisaid...
igoterrorslikethis,whereisfalsemister,imrunningfreeradiusinfreebsd10.01
root@saman:/usr/home/saman#radtestsqltesttestpwd127.0.0.11812testing123
SendingAccessRequestofid154to127.0.0.1port1812
UserName="sqltest"
UserPassword="testpwd"
NASIPAddress=10.20.30.124
NASPort=1812
MessageAuthenticator=0x00000000000000000000000000000000
SendingAccessRequestofid154to127.0.0.1port1812
UserName="sqltest"
UserPassword="testpwd"
NASIPAddress=10.20.30.124
NASPort=1812
MessageAuthenticator=0x00000000000000000000000000000000
SendingAccessRequestofid154to127.0.0.1port1812
UserName="sqltest"
UserPassword="testpwd"
NASIPAddress=10.20.30.124
NASPort=1812
MessageAuthenticator=0x00000000000000000000000000000000
radclient:noresponsefromserverforID154socket3
Saturday,May16,2015
Anonymoussaid...
Andrew,Ifoundyourpostinterestingandveryinformative.Thanksfortakingthetimeto
writethearticle.Justasmallnote,didyoumeantomovethedaloradiustotherootfor
www?Issothenthenextlineisincorrect.Itshouldbe/var/www/contribandnot
/var/www/daloradius/contrib.
Thanksagainforyourtime!
Sunday,May17,2015
JosephDodoshsaid...
Thiscommenthasbeenremovedbytheauthor.
Monday,June15,2015
CounterStrikeConditionZeroFullVersionsaid...
Thankyouforthegreatguide!

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

9/10

12/19/2015 AndrewPakpahan:InstallingandConfiguringFreeradius+MySQLandDaloradius+MySQLonUbuntuServer12.04forMikrotikHotspot/PPoE/PPTP
Workslikeacharm.
Tuesday,September01,2015
RoshanMoresaid...
Sir,
Wheniexecuteacommandforradtestitgivesmeanoutputaccessrejectfromhost.
plshelpmeoutsir..
Wednesday,December02,2015
PostaComment

NewerPost

Home

OlderPost

Subscribeto:PostComments(Atom)

http://andrewpakpahan.blogspot.co.id/2012/08/installingandconfiguringfreeradius.html

10/10

Das könnte Ihnen auch gefallen