8
daloradius coova-chilli and freeradius for ipfire Copi paste sesuai kan dengan folder yg ada di IPFIRE Coova-Chilli 1.2.5 http://forum.ipfire.org/index.php?action=dlattach;topic=3313.0;attach=1200 Freeradius with mysql http://forum.ipfire.org/index.php?action=dlattach;topic=3313.0;attach=1201 Configure FreeRadius2 to use SQL Edit radius.conf file To do this, edit /etc/raddb/radiusd.conf and pretty much ignore everything except around about line 640 in the modules section uncomment or make sure that you have, $INCLUDE sql.conf and then further down make sure you have, $INCLUDE sql/mysql/counter.conf Then further around line 710 in the instantiate section make sure you have, chillispot_max_bytes noresetcounter which are our counters which we define in the next section. Then in /etc/raddb/sites-enabled/default, in the authorise section after it has the “Look in an SQL database…” it has an “sql” entry that may be commented out so uncomment it and add the new counters so that it is now, sql chillispot_max_bytes noresetcounter

daloradius coova

Embed Size (px)

DESCRIPTION

Hotspot

Citation preview

daloradius coova-chilli and freeradius foripfireCopi paste sesuai kan dengan folder yg ada di IPFIRECoova-Chilli 1.2.5http://forum.ipfire.org/index.php?action=dlattach;topic=3313.0;attach=1200Freeradius with mysqlhttp://forum.ipfire.org/index.php?action=dlattach;topic=3313.0;attach=1201Configure FreeRadius2 to use SQLEdit radius.conf fileTo do this, edit /etc/raddb/radiusd.conf and pretty much ignore everything except around about line 640 in the modules section uncomment or make sure that you have,$INCLUDE sql.confand then further down make sure you have,$INCLUDE sql/mysql/counter.confThen further around line 710 in the instantiate section make sure you have,chillispot_max_bytesnoresetcounterwhich are our counters which we define in the next section. Then in /etc/raddb/sites-enabled/default, in the authorise section after it has the Look in an SQL database it has an sql entry that may be commented out so uncomment it and add the new counters so that it is now,sqlchillispot_max_bytesnoresetcounterand then later in /etc/raddb/sites-enabled/default in the accounting section uncomment the sql about line 343,sqland then later in /etc/raddb/sites-enabled/default in the session section uncomment the sql about line 370,sqland then finally in /etc/raddb/sites-enabled/default in the post-auth section uncomment the sql about line 370,sqlThat should be it. Now update the counter.conf in the next section.FreeRadius SQL counter.conf settings neededTo match the radcheck and radgroupchecks we use then you also need to add two matching counter.conf checks as follows. Edit the /etc/radddb/sql/mysql/counter.conf file (unless the counter is already defined in that), add the following at the end,sqlcounter noresetcounter {counter-name = Session-Timeoutcheck-name = Session-Timeoutreply-name = Session-Timeoutsqlmod-inst = sqlkey = User-Namereset = neverquery = SELECT SUM(Acctsessiontime) FROM radacct WHERE UserName=%{%k}'}sqlcounter chillispot_max_bytes {counter-name = ChilliSpot-Max-Total-Octetscheck-name = ChilliSpot-Max-Total-Octetsreply-name = ChilliSpot-Max-Total-Octetssqlmod-inst = sqlkey = User-Namereset = neverquery = SELECT SUM(AcctInputOctets) + SUM(AcctOutputOctets) FROM radacct WHERE UserName=%{%k}'}IMPORTANT: Make sure you comment out all occurrences ldap and files in /etc/raddb/sites-enabled/defaultSetup easyhotspot database to be used by FreeRadiusGo to Webconfig>Server>MySQL and set MySQL to Auto start On Boot and start the Service. You will be required to supply a password for MySQL (if you have not set one already)On the terminal:#mysql u root pmysql> create database radiusdb;mysql>CREATE USER raddbuser@localhost';mysql>SET PASSWORD FOR raddbuser@localhost = PASSWORD(raddbpass);mysql>GRANT ALL ON radiusdb.* to raddbuser@localhost';mysql> quitInstall Daloradius 0.9-9 (personally. I like this option)Prerequisites$ sudo apt-get install php5-common php5-gd php-pear php-db libapache2-mod-php5Download daloRADIUS. sourceforge.net/projects/daloradius/ tar-zxvf daloradius-0.9-9.tar.gz.Move the directory to the location of a web of daloradius command. cp daloradius-0.9-9 /var/www/html -R. chown apache:apache /var/www/html/daloradius-0.9-9 -R. chmod 644 / var/www/html/daloradius-0.9-9/library/daloradius.conf.phpFor the database name is radiusdb in this step. echo create database radiusdb; | mysql -u root -p mysql -u root -p radiusdb < /var/www/daloradius-0.9-9/contrib/db/fr2-mysql-daloradius-and-freeradius.sql echo create user raddbuser@localhost'; | mysql -u root -p echo grant create, insert, select, delete, update on raddiusdb.* to raddbuser@localhost identified by YOURPASSWORD' | mysql -u root -pOpen the configuration file. nano /var/www/daloradius-0.9-9/library/daloradius.conf.php. $configValues['DALORADIUS_VERSION'] = 0.9-9; $configValues['FREERADIUS_VERSION'] = 2; $configValues['CONFIG_DB_ENGINE'] = mysql'; $configValues['CONFIG_DB_HOST'] = localhost'; $configValues['CONFIG_DB_USER'] = raddbuser'; $configValues['CONFIG_DB_PASS'] = raddbpass'; $configValues['CONFIG_DB_NAME'] = radiusdb'; $configValues['CONFIG_DB_TBL_RADCHECK'] = radcheck'; $configValues['CONFIG_DB_TBL_RADREPLY'] = radreply'; $configValues['CONFIG_DB_TBL_RADGROUPREPLY'] = radgroupreply'; $configValues['CONFIG_DB_TBL_RADGROUPCHECK'] = radgroupcheck'; $configValues['CONFIG_DB_TBL_RADUSERGROUP'] = radusergroup';Touch daloradius log file. touch /var/log/daloradius.logInstallation is complete. Now loginYOURSERVERIPADDRESS/daloradius-0.9-9/login.php.Username: administratorPassword: radiusRef: help.ubuntu.com/community/CategoryNetworking/daloRADIUSSetup Raddb To Use radiusdb DatabaseEdit /etc/raddb/sql.conf and set the following:-# vi /etc/raddb/sql.conf# Connection info:server = localhost#port = 3306login = raddbuserpassword = raddbpass # Database table configuration for everything except Oracleradius_db = radiusdbInstall/Setup Captive Portal(www.clearfoundation.com/docs/howtos/captive_portal)PreparationYou will need the working RADIUS server to get this going. Be sure to do the Additional setup items at the bottom so that PAP is working.You will need to set up localhost as an authorized client of the RADIUS server.Create a user called coovachilli with mail only and make a group called chilli.Get the code.wget www.clearcenter.com/media/dev/coova-chilli-1.2.5-1.i386.rpmwget www.clearcenter.com/media/dev/haserlcp haserl /usr/sbin/chmod +x /usr/sbin/haserlInstall the coderpm -Uvh coova-chilli-1.2.5-1.i386.rpmConfigure Coovachilli/etc/chilli/defaultsSet the following values: HS_LANIF, change this value if it is wrong (ie. HS_LANIF=eth2).HS_NETWORK, set this to the values of your network (ie. HS_NETWORK=192.168.1.0).HS_NETMASK, change this value if it is wrong (ie. HS_NETMASK=255.255.255.128).HS_UAMLISTEN, set this to the IP of your server (ie. HS_UAMLISTEN=192.168.1.1).HS_DNS1 and HS_DNS1, set these to the IP address of your local DNS server, in this case your server (ie. HS_DNS1=192.168.1.1 and HS_DNS2=192.168.1.1).HS_RADSECRET, set this to the secret password that you placed in the RADIUS configuration for the localhost entry in Webconfig (ie. HS_RADSECRET=mysecretpassword).HS_RAD_PROTO=mschapv2, set this so the program knows to use the NT-Password infrastructure of LDAP described in the PAP section of the FreeRADIUS 2 Howto. This value does NOT exist and you must define it (set this to HS_RAD_PROTO=mschapv2).HS_UAMDOMAINS, set all the domains that you want for your walled garden. These sites will work even if users dont authenticate via your captive portal:HS_UAMDOMAINS=.clearcenter.com,.clearfoundation.comStart Coova Chilli#service chilli start

TestingConnect a client to network (or Wireless Network). This is where eth1 on your clearOS server is connected.-The client should receive an IP address of say 10.1.0.xIf so, open a web browser on the client. You should get a redirection to the coova login page.

daloRADIUS 0.9-9 QUCIK STARTCreate Profiles Time Based ProfileGo to Management tab > Select Profiles > Create New Profiles >Add Profile AttributesType Profile Name, e.g. 60MinsAdd attributesCheck AttributesSimultaneous-Use = 1Max-All-Session = 3600[this is in seconds, for 60mins = 3600seconds]Session-Timeout = 3600Reply AttributesSession-Timeout = 3600Idle-Timeout = 60Acct-Interim-Interval = 120Billing Plans Time BasedGo to Billing Tab> Select Plans > New Plan1. Enter Plan Information details from Plan Name to Plan Active2. Enter Time Settings details3. Select Profile from the drop-downAdd HotspotGo to Management Tab > Hotspots > Click New HotspotEnter Hotspot Name and MAC Address of interface connected to clients, Click ApplyAdd NASGo to Management > Nas > Click New NASEnter NAS Info, IP, NAS secret (e.g. testing123), NAS type, Other and NAS shortname. Set NAS Ports to 3997, Click ApplyCreate Pre-paid Vouchers Batch Users Walk-InGo to Management > Batch Users > Click Batch Add UsersEnter Account Info, Batch Id/Name, e.g. 60Mins_12_11_12, a Batch Description, Select Hotspot.I use Create Random Users, with default username/password length of 8, and set number of instances to create (number of vouchers).Select Group, e.g. 60Mins for 1 hour vouchers, Group Priority 0 or 1 is fine and then the Plan name for 1 hour. Click ApplyYou can print the vouchers/tickets.Create Member User AccountsGo to Management > Users > Click New UserEnter Account Info, username, password and select Group. You can also enter User Info First/Last names, email, etc. Click ApplyTesting LoginTrying login in to the Hotspot using either a Batch User or a Member User