Anda di halaman 1dari 17

This is a Raspberry Pi and a USB WIFI support with Raspberry Pi to apply to the WIFI Hotspot

system by the Internet from the port of Raspberry Pi to the WAN pin. Wireless USB to be. LAN
Hotspot. If the device to connect to the access point released from USB Wireless will receive
the IP in the Hotspot, and when launched, the web browser Hotspot system will run the Login
page to allow users to use the Hotspot. And password to enter. User-use system that will be
available in the Database of the system to access it. It also has an administrator's admin page
for user management and other system information.


## Wiresless must support the USB with Raspberry Pi and Driver must have a Raspberry Pi to a

## CoovaChilli Coova of Chilli act as a DHCP Server in the management of IP and IP to deal with
the Client to connect to the WIFI

##. RADIUS (Common Remote Authentication Dial In User Server) Authentication and
Authentication System Freeradius

## daloRADIUS is a web application for administering hotspots, user management, graphical

reporting, accounting and billing engines. DaloRADIUS is developed with PHP and JavaScript.
Support for various databases such as MySQL and PostgreSQl.

## Captive Portal is to force the user to access the HTTP page to force the user to authenticate
the user before accessing the resource.
Turn off turbo mode

bash -c "echo options smsc95xx turbo_mode = N> /etc/modprobe.d/smscnonturbo.conf"

Set up your interface in / etc / network / interfaces. And modified

sudo nano / etc / network / interfaces

Add to file as follows:

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
post-up echo 1> / proc / sys / net / ipv4 / ip_forward

Open the Forwarding interface on line 29 of the /etc/sysctl.conf file.

sudo nano /etc/sysctl.conf
Restore network
/etc/init.d/networking restart

Install mysql and configure it for databases.

apt-get install -y debconf-utils

Configure the following:

mysql-server mysql-server / root_password password raspbian '

debconf-set-selections <<<' mysql-server mysql-server / root_password_again password
raspbian '
apt-get install -y debhelper libssl-dev libcurl4-gnutls-dev mysql-freeradius freeradius-mysql
gcc make libnl1 libnl-dev pkg-config iptables

Create database in MySQL to FreeRadius.

echo "create database radius;" | mysql -u root -praspbian

Install database schema radius and directors and install tables for NAS.
mysql -u root -praspbian radius </etc/freeradius/sql/mysql/schema.sql
mysql -u root -praspbian radius </etc/freeradius/sql/mysql/admin.sql
mysql -u root -praspbian radius </ etc /freeradius/sql/mysql/nas.sql

Edit the file /etc/freeradius/radiusd.conf by removing the # in line 700.

sudo nano /etc/freeradius/radiusd.conf
Open the MySQL Database authentication in the / etc / freeradius / sites-enabled / default
file by removing the # in these lines. 177, 406, 454
sudo nano / etc / freeradius / sites-enabled / default

Stop freeradius service and freeradius test

service freeradius stop
freeradius -X
Test usertest usernames and passwd passwords to test connection.
echo "insert into radcheck (username, attribute, op, value) values ('usertest', 'Cleartext-
Password', ': =', 'passwd'); | mysql -u root -praspbian radius

Test the configuration in the file. /etc/freeradius/clients.conf Used to connect FreeRadius

and NAS

radtest usertest passwd localhost 0 testing123

Compilation and installation of CoovaChilli
Download and install CoovaChilli.

cd / usr / src
tar zxvf coova-chilli-1.3.0.tar.gz
cd co-chilli-1.3.0

Start CoovaChilli settings

/configure --prefix = / usr --mandir = $$ {prefix} / share / man \
--infodir = \ $$ {prefix} / share / info \
--sysconfdir = / etc --localstatedir = / var --enable-largelimits \
--enable-binstatusfile --enable-statusfile --enable-chilliproxy \
--enable-chilliradsec --enable-chilliredir --with-openssl --with-curl \
--with-poll - enable-dhcpopt --enable-sessgarden --enable-dnslog \
--enable-ipwhitelist --enable-redirdnsreq --enable-miniconfig \
--enable-libjson --enable-layer3 --enable-proxyvsa --enable-miniportal \
--enable-chilliscript --enable-eapol --enable-uamdomainfile \
--enable-modules --enable-multiroute

echo 9> debian / compat

Change the directory in /usr/src/coova-chilli-1.3.0/debian/rules to 54.

sudo nano /usr/src/coova-chilli-1.3.0/debian/rules

$ (MAKE) DESTDIR = / install

The compilation takes about 20 minutes.

dpkg-buildpackage -us -uc

Install the package and select N.

cd ..
dpkg -i coova-chilli_1.3.0_armhf.deb
Compilation and installation of Haserl

Download a file and install Haserl for UNIX scripts or LUA scripts and it will generate CGI.

cd / usr / src
tar zxvf haserl-0.9.35.tar.gz
cd haserl-0.9.35
./configure && make && make install

./configure && make && make install

Set up CoovaChilli in the /etc/chilli/ file.

sudo nano /etc/chilli/

Configure CoovaChilli
Add the text below to the bottom.
iptables -I POSTROUTING -t nat -o $ HS_WANIF -j MASQUERADE

Edit the file / etc / default / chilli Change the value from 0 to 1 instead.
sudo nano / etc / default / chilli

START_CHILLI = 0 resolve to START_CHILLI = 1

Edit file / etc / chilli / wwwsh of line 9 is haserl = / usr / local / bin / haserl
sudo nano / etc / chilli / wwwsh

Solution is haserl = / usr / local / bin / haserl

Edit the sudo nano / etc / chilli / defaults file. By configuring the interfaces used passwd
network, etc., the following values are deleted by removing the # after the edit.
sudo nano / etc / chilli / defaults
Edit as:

HS_WANIF = eth0
HS_LANIF = wlan0
HS_SSID = PiHomeServerAP
Update chilli values and start chilli.
update-rc.d chilli start 99 2 3 4 5. stop 20 0 1 6.
service chilli start

Check out the tun0 interface for chilli with the command.

Install hostapd to see WIFI signals.

sudo apt-get install -y hostapd

Edit the / etc / default / hostapd file. Add to the end of the line.

DAEMON_CONF = "/ etc / hostapd / hostapd.conf"

Creates the /etc/hostapd/hostapd.conf file.

sudo nano /etc/hostapd/hostapd.conf

And add it to the file as follows:

# Wi-Fi
interface = wlan0
# nl80211 avec tous les drivers Linux mac80211
driver = nl80211
# Nom du Wi-Fi Wi-Fi
= PiHomeServerAP
# mode Wi-Fi (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.1g)
hw_mode = g
# canal de fréquence Wi-Fi (1-14)
channel = 6
# Wi-Fi ouvert, pas d'authentification!
auth_algs = 1
# Beacon interval in kus (1.024 ms)
beacon_int = 100
# DTIM (delivery traffic information message)
dtim_period = 2
# Maximum number of stations allowed in station table max_num_sta = 255
# RTS / CTS threshold; 2347 = disabled (default)
rts_threshold = 2347
# Fragmentation threshold; 2346 = disabled (default)
fragm_threshold = 2346
Start service
service hostapd start

Test Connection WiFi

Test the wifi connection from raspberry pi using 9 9 computers. When the web browser
opens, the system will run to the login page

user = usertest
password = passwd
If the code is valid, can connect to the internet.
Install web server and Nginx.

get -y

Download daloRadius
cd / usr / src
tar zxvf daloradius-0.9-9.tar.gz -C / usr / share / nginx / www /
/usr/share/nginx/www/daloradius-0.9-9 mv-/ Usr / Share / NGINX / the www / Daloradius
a cd / Usr / Share / NGINX / the www / Daloradius.

Add data using daloRadius in the FreeRadius database.

-u root RADIUS -praspbian the mysql </usr/share/nginx/www/daloradius/contrib/db/fr2-
the mysql -u root -praspbian
the GRANT the ALL the ON RADIUS. * To 'RADIUS'. @ 'localhost';
GRANT ALL ON radius. * To 'radius'@'127.0.01';

In the /usr/share/nginx/www/daloradius/library/daloradius.conf.php file, set the database to

the following:
sudo nano /usr/share/nginx/www/daloradius/library/daloradius.conf.php

$ configValues ['CONFIG_DB_USER'] = 'radius';

$ configValues ['CONFIG_DB_PASS'] = 'radpass';
$ configValues ['CONFIG_DB_NAME'] = 'radius';
Edit / etc / nginx / sites-enabled / default
sudo nano / etc / nginx / sites-enabled / default

Add the following command to the file from line 25.

index.php index.html index.html;

Then remove the # from the / etc / nginx / sites-enabled / default file.
location ~ .php $ {
fastcgi_split_path_info ^ (. + \. php) (/.+) $;
fastcgi_pass unix: /var/run/PHP5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;

Restore service nginx

service nginx restart
how to create a user
Test the daloRADIUS page by opening the webbrowser http: // <ip de votre raspberry> /

Login: administrator / Password: radius

Create user in use.

List User

online user
Status System