WiFi: HotSpot - Instalasi CoovaChilli

From OnnoWiki
Revision as of 09:19, 11 May 2010 by Onnowpurbo (talk | contribs) (→‎Pranala Menarik)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Ada dua (2) metoda untuk menginstalasi CoovaChilli di Ubuntu, yaitu,

  • Paket
  • Source

Kedua metoda tersebut di jelaskan di bawah ini.

Instalasi CoovaChilli menggunakan paket

Untuk menginstalasi paket CoovaChilli, pertama-tama kita perlu men-download versi terakhir yag tersedia dari http://www.coova.org/CoovaChilli, misalnya:

sudo wget http://ap.coova.org/chilli/coova-chilli_1.0.13-1_i386.deb

Kemudian menginstallnya menggunakan perintah

sudo dpkg -i coova-chilli_1.0.13-1_i386.deb

Copy file konfigurasi default dan konfigurasi Apache melalui perintah:

cp /etc/chilli/defaults /etc/chilli/config
mkdir /var/www/hotspot
cd /var/www/hotspot
cp /etc/chilli/www/* /var/www/hotspot
mkdir /var/www/hotspot/images
cp /var/www/hotspot/coova.jpg /var/www/hotspot/images/
mkdir /var/www/hotspot/uam
cd /var/www/hotspot/uam
wget http://ap.coova.org/uam/
wget http://ap.coova.org/js/chilli.js

Ubah Host Address

Edit index.html untuk menggunakan chilli.js dari mesin lokal (dalam contoh ini menggunakan host IP address 10.1.0.1)

sed -i 's/ap.coova.org\/js\/chilli.js/10.1.0.1\/uam\/chilli.js/g' /var/www/hotspot/uam/index.html

Edit ChilliLibrary.js untuk menggunakan IP address host yang benar (dalam contoh ini menggunakan 10.1.0.1):

sed -i 's/192.168.182.1/10.1.0.1/g' /etc/chilli/www/ChilliLibrary.js
sed -i 's/192.168.182.1/10.1.0.1/g' /var/www/hotspot/ChilliLibrary.js

Untuk bisa mengaktifkan coovachilli ubah START_CHILLI menjadi 1

vi /etc/default/chilli

Pastikan

START_CHILLI=1
CONFFILE="/etc/chilli.conf"

Untuk me-restart kita bisa melakukan melalui

sudo /etc/init.d/chilli start

Menginstalasi CoovaChilli dari Source Code

sudo apt-get install build-essential linux-headers-server
wget http://ap.coova.org/chilli/coova-chilli-1.2.2.tar.gz
cp coova-chilli-1.2.2.tar.gz /usr/local/src
cd /usr/local/src
tar xzf coova-chilli-1.2.2.tar.gz && cd coova-chilli-1.2.2
./configure
make
sudo make install

Copy file konfigurasi default dan konfigurasi Apache:

cp /etc/chilli/defaults /etc/chilli/config
mkdir /var/www/hotspot
cd /var/www/hotspot
cp /etc/chilli/www/* /var/www/hotspot
mkdir /var/www/hotspot/uam
cd /var/www/hotspot/uam
wget http://ap.coova.org/uam/
wget http://ap.coova.org/js/chilli.js

Edit index.html untuk menggunakan chilli.js dari mesin lokal (default adalah 192.168.2.1 untuk jaringan kecil dengan banyak host)

sed -i 's/ap.coova.org\/js\/chilli.js/192.168.2.1\/uam\/chilli.js/g' /var/www/hotspot/uam/index.html

Script untuk startup adalah sebagai berikut:

cd /etc/init.d/
wget http://dev.coova.org/svn/coova-chilli/debian/coova-chilli.chilli.init
mv chilli chilli.bak && mv coova-chilli.chilli.init chilli && chmod 755 chilli
sed '21,30s/**/# &/' chilli > chilli.tmp && mv chilli.tmp chilli && chmod 755 chilli

perintah terakhir untuk meng-remarks line 21 sampai 30

Check konfigurasi dengan menjalankan chilli melalui perintah

sudo /etc/init.d/chilli start

Untuk mengaktifkan chilli script saat booting kita dapat menggunakan perintah

update-rc.d chilli defaults

Kita perlu memastikan bahwa file chilli dapat dijalankan menggunakan perintah

chmod +x /etc/init.d/chilli

Konfigurasi Dasar

Lihat file /etc/chilli/defaults untuk melihat kemungkinan konfigurasi. Copy file ini ke file baru dengan nama "config" (di directory yang sama) dan edit setting-an jika di perlukan. Untuk menghasilkan settingan yang di perlukan dan menjalankan chilli, jalankan perintah "/etc/init.d/chilli start". Perintah ini akan menghasilkan file main.conf, local.conf, dan hs.conf di /etc/chilli/. Jika ingin membuat perubahan In order to make changes to the settings at a later date, rerun chilli start.

NOTE: the chilli config file only generates the main.conf if the service is restarted by /etc/init.d/chilli which we start to configure now. When you start chilli in debug mode by entering "chilli --debug --fg" then coovachilli gets started with the main.conf. If you change the config file and restart chilli in debug mode nothing would change. So you can ether edit the main.conf and edit in debug mode or edit the config file and restart the service

Per default, it is assumed that Ethernet device eth0 is your connection to the Internet and eth1 is the interface you want to have clients (subscribers) on. If this is not the case, then change the HS_WANIF configuration to be your Internet connected device and HS_LANIF to be your WiFi device, for example. With the right devices configured, restart chilli and you are on your way.

vi /etc/chilli/config

Edit the first 63 lines of the file to the following until the HS_UAMSERVICE url is defined.

# -*- /bin/sh -*-
#
#   Coova-Chilli Default Configurations.
#   To customize, copy this file to /etc/chilli/config
#   and edit to your liking. This is included in shell scripts
#   that configure chilli and related programs before file 'config'.

# HS_WANIF=eth0            # WAN Interface toward the Internet
HS_LANIF=eth1              # Subscriber Interface for client devices
HS_NETWORK=10.1.0.0     # HotSpot Network (must include HS_UAMLISTEN)
HS_NETMASK=255.255.255.0   # HotSpot Network Netmask
HS_UAMLISTEN=10.1.0.1   # HotSpot IP Address (on subscriber network)
HS_UAMPORT=3990            # HotSpot Port (on subscriber network)

# Allow some additional local ports (used in the up.sh script when 
# setting the firewall for the created tun/tap)
HS_TCP_PORTS="80 443"

# HS_DYNIP=
# HS_DYNIP_MASK=255.255.255.0
# HS_STATIP=
# HS_STATIP_MASK=255.255.255.0
# HS_DNS_DOMAIN=
# if your interface eth0 for example has the ip 192.168.5.2 
# and your router where your internet connection is established has the address 
# 192.168.5.1 than you are allowed to access the router from your wlan network 192.168.2.0/24
# so you have don't have to define the dns servers below
#
# HS_DNS2=62.72.64.237  
# HS_DNS1=192.168.2.1  

###
#   HotSpot settings for simple Captive Portal
#
HS_NASID=nas01
HS_UAMSECRET=uamsecret
HS_RADIUS=127.0.0.1
HS_RADIUS2=127.0.0.1
HS_RADSECRET=radiussecret
# please provide here the address for your router too. 
# From the example above it has the address 192.168.0.1 (comma separated)
HS_UAMALLOW=10.1.0.0/24,192.168.0.1

#   Put entire domains in the walled-garden with DNS inspection
# HS_UAMDOMAINS=".paypal.com,.paypalobjects.com" 

#   Optional initial redirect and RADIUS settings
# HS_SSID=<ssid>           # To send to the captive portal
# HS_NASMAC=<mac address>  # To explicitly set Called-Station-Id
# HS_NASIP=<ip address>    # To explicitly set NAS-IP-Address

#   The server to be used in combination with HS_UAMFORMAT to
#   create the final chilli 'uamserver' url configuration.
HS_UAMSERVER=10.1.0.1

#   Use HS_UAMFORMAT to define the actual captive portal url.
#   Shell variable replacement takes place when evaluated, so here
#   HS_UAMSERVER is escaped and later replaced by the pre-defined
#   HS_UAMSERVER to form the actual "--uamserver" option in chilli.
HS_UAMFORMAT=https://\$HS_UAMSERVER/uam/

#   Same principal goes for HS_UAMHOMEPAGE.
HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN:\$HS_UAMPORT/www/coova.html

#   This option will be configured to be the WISPr LoginURL as well
#   as provide "uamService" to the ChilliController. The UAM Service is
#   described in: http://coova.org/wiki/index.php/CoovaChilli/UAMService
#
HS_UAMSERVICE=https://10.1.0.1/cgi-bin/hotspotlogin.cgi

Pranala Menarik