Sie sind auf Seite 1von 6

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/sitesenabled/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
and then later in /etc/raddb/sites-enabled/default in the accounting section uncomment the sql
about line 343,
sql
and then later in /etc/raddb/sites-enabled/default in the session section uncomment the sql about
line 370,

sql
and then finally in /etc/raddb/sites-enabled/default in the post-auth section uncomment the sql
about line 370,
sql
That should be it. Now update the counter.conf in the next section.
FreeRadius SQL counter.conf settings needed
To 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-Timeout
check-name = Session-Timeout
reply-name = Session-Timeout
sqlmod-inst = sql
key = User-Name
reset = never
query = SELECT SUM(Acctsessiontime) FROM radacct WHERE UserName=%{%k}'
}
sqlcounter chillispot_max_bytes {
counter-name = ChilliSpot-Max-Total-Octets
check-name = ChilliSpot-Max-Total-Octets
reply-name = ChilliSpot-Max-Total-Octets
sqlmod-inst = sql
key = User-Name
reset = never
query = SELECT SUM(AcctInputOctets) + SUM(AcctOutputOctets) FROM radacct WHERE
UserName=%{%k}'
}
IMPORTANT: Make sure you comment out all occurrences ldap and files in /etc/raddb/sitesenabled/default
Setup easyhotspot database to be used by FreeRadius
Go 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 p

mysql> 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> quit
Install Daloradius 0.9-9 (personally. I like this option)
Prerequisites
$ sudo apt-get install php5-common php5-gd php-pear php-db libapache2-mod-php5
Download 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.php
For 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-andfreeradius.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 -p
Open 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.log

Installation is complete. Now login


YOURSERVERIPADDRESS/daloradius-0.9-9/login.php.
Username: administrator
Password: radius
Ref: help.ubuntu.com/community/CategoryNetworking/daloRADIUS
Setup Raddb To Use radiusdb Database
Edit /etc/raddb/sql.conf and set the following:# vi /etc/raddb/sql.conf
# Connection info:
server = localhost
#port = 3306
login = raddbuser
password = raddbpass
# Database table configuration for everything except Oracle
radius_db = radiusdb
Install/Setup Captive Portal
(www.clearfoundation.com/docs/howtos/captive_portal)
Preparation
You 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.rpm
wget www.clearcenter.com/media/dev/haserl
cp haserl /usr/sbin/
chmod +x /usr/sbin/haserl
Install the code
rpm -Uvh coova-chilli-1.2.5-1.i386.rpm
Configure Coovachilli
/etc/chilli/defaults

Set 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.com
Start Coova Chilli
#service chilli start
Testing
Connect 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.x
If so, open a web browser on the client. You should get a redirection to the coova login page.
daloRADIUS 0.9-9 QUCIK START
Create Profiles Time Based Profile
Go to Management tab > Select Profiles > Create New Profiles >Add Profile Attributes
Type Profile Name, e.g. 60Mins
Add attributes
Check Attributes
Simultaneous-Use = 1
Max-All-Session = 3600
[this is in seconds, for 60mins = 3600seconds]
Session-Timeout = 3600
Reply Attributes
Session-Timeout = 3600

Idle-Timeout = 60
Acct-Interim-Interval = 120
Billing Plans Time Based
Go to Billing Tab> Select Plans > New Plan
1. Enter Plan Information details from Plan Name to Plan Active
2. Enter Time Settings details
3. Select Profile from the drop-down
Add Hotspot
Go to Management Tab > Hotspots > Click New Hotspot
Enter Hotspot Name and MAC Address of interface connected to clients, Click Apply
Add NAS
Go to Management > Nas > Click New NAS
Enter NAS Info, IP, NAS secret (e.g. testing123), NAS type, Other and NAS shortname. Set
NAS Ports to 3997, Click Apply
Create Pre-paid Vouchers Batch Users Walk-In
Go to Management > Batch Users > Click Batch Add Users
Enter 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 Apply
You can print the vouchers/tickets.
Create Member User Accounts
Go to Management > Users > Click New User
Enter Account Info, username, password and select Group. You can also enter User Info
First/Last names, email, etc. Click Apply
Testing Login
Trying login in to the Hotspot using either a Batch User or a Member User

Das könnte Ihnen auch gefallen