Difference between revisions of "WiFi: HotSpot - Instalasi CoovaChilli"

From OnnoWiki
Jump to navigation Jump to search
Line 1: Line 1:
Install CoovaChilli
+
Ada dua (2) metoda untuk menginstalasi CoovaChilli di Ubuntu, yaitu,
  
There are two methods of installing coovachilli on ubuntu.
+
* Paket
 +
* Source
  
    * Package
+
Kedua metoda tersebut di jelaskan di bawah ini.
    * Source
 
  
Both methods are listed below
+
==Instalasi CoovaChilli menggunakan paket==
 
 
CoovaChilli Package Installation
 
  
 
To install the CoovaChilli package, first download it (or the latest version available from http://www.coova.org/CoovaChilli):
 
To install the CoovaChilli package, first download it (or the latest version available from http://www.coova.org/CoovaChilli):
  
sudo wget http://ap.coova.org/chilli/coova-chilli_1.0.13-1_i386.deb
+
sudo wget http://ap.coova.org/chilli/coova-chilli_1.0.13-1_i386.deb
  
 
Then install it:
 
Then install it:
  
sudo dpkg -i coova-chilli_1.0.13-1_i386.deb
+
sudo dpkg -i coova-chilli_1.0.13-1_i386.deb
  
 
Copy the default configuration files and Apache site configuration:
 
Copy the default configuration files and Apache site configuration:
  
cp /etc/chilli/defaults /etc/chilli/config
+
cp /etc/chilli/defaults /etc/chilli/config
mkdir /var/www/hotspot
+
mkdir /var/www/hotspot
cd /var/www/hotspot
+
cd /var/www/hotspot
cp /etc/chilli/www/* /var/www/hotspot
+
cp /etc/chilli/www/* /var/www/hotspot
mkdir /var/www/hotspot/images
+
mkdir /var/www/hotspot/images
cp /var/www/hotspot/coova.jpg /var/www/hotspot/images/
+
cp /var/www/hotspot/coova.jpg /var/www/hotspot/images/
mkdir /var/www/hotspot/uam
+
mkdir /var/www/hotspot/uam
cd /var/www/hotspot/uam
+
cd /var/www/hotspot/uam
wget http://ap.coova.org/uam/
+
wget http://ap.coova.org/uam/
wget http://ap.coova.org/js/chilli.js
+
wget http://ap.coova.org/js/chilli.js
  
 
Change Host Address
 
Change Host Address
Line 35: Line 33:
 
Edit index.html to use chilli.js from local (this example uses the host IP address as 10.1.0.1)
 
Edit index.html to use chilli.js from local (this example uses the host IP address as 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
+
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 to use the correct host IP address (again, example uses 10.1.0.1):
 
Edit ChilliLibrary.js to use the correct host IP address (again, example uses 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' /etc/chilli/www/ChilliLibrary.js
sed -i 's/192.168.182.1/10.1.0.1/g' /var/www/hotspot/ChilliLibrary.js
+
sed -i 's/192.168.182.1/10.1.0.1/g' /var/www/hotspot/ChilliLibrary.js
  
 
To enable coovachilli change START_CHILLI to 1
 
To enable coovachilli change START_CHILLI to 1
  
nano -w /etc/default/chilli
+
nano -w /etc/default/chilli
  
 
To enable on reboot
 
To enable on reboot
  
START_CHILLI=1
+
START_CHILLI=1
CONFFILE="/etc/chilli.conf"
+
CONFFILE="/etc/chilli.conf"
  
 
To enable without a reboot
 
To enable without a reboot
  
sudo /etc/init.d/chilli start
+
sudo /etc/init.d/chilli start
  
CoovaChilli Source Installation
+
==Menginstalasi CoovaChilli dari Source Code==
  
To build from source:
 
  
sudo apt-get install build-essential linux-headers-server
+
sudo apt-get install build-essential linux-headers-server
wget http://ap.coova.org/chilli/coova-chilli-1.0.13.tar.gz
+
wget http://ap.coova.org/chilli/coova-chilli-1.0.13.tar.gz
tar xzf coova-chilli-1.0.13.tar.gz && cd coova-chilli-1.0.13
+
tar xzf coova-chilli-1.0.13.tar.gz && cd coova-chilli-1.0.13
./configure
+
./configure
make
+
make
sudo make install
+
sudo make install
  
 
Copy the default configuration files and Apache site configuration:
 
Copy the default configuration files and Apache site configuration:
  
cp /etc/chilli/defaults /etc/chilli/config
+
cp /etc/chilli/defaults /etc/chilli/config
mkdir /var/www/hotspot
+
mkdir /var/www/hotspot
cd /var/www/hotspot
+
cd /var/www/hotspot
cp /etc/chilli/www/* /var/www/hotspot
+
cp /etc/chilli/www/* /var/www/hotspot
mkdir /var/www/hotspot/uam
+
mkdir /var/www/hotspot/uam
cd /var/www/hotspot/uam
+
cd /var/www/hotspot/uam
wget http://ap.coova.org/uam/
+
wget http://ap.coova.org/uam/
wget http://ap.coova.org/js/chilli.js
+
wget http://ap.coova.org/js/chilli.js
  
 
Edit index.html to use chilli.js from local (default is 192.168.2.1 for few networks and many hosts)
 
Edit index.html to use chilli.js from local (default is 192.168.2.1 for few networks and many hosts)
  
sed -i 's/ap.coova.org\/js\/chilli.js/192.168.2.1\/uam\/chilli.js/g' /var/www/hotspot/uam/index.html
+
sed -i 's/ap.coova.org\/js\/chilli.js/192.168.2.1\/uam\/chilli.js/g' /var/www/hotspot/uam/index.html
  
 
The startup script:
 
The startup script:
  
cd /etc/init.d/
+
cd /etc/init.d/
wget http://dev.coova.org/svn/coova-chilli/debian/coova-chilli.chilli.init
+
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
+
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
+
sed '21,30s/**/# &/' chilli > chilli.tmp && mv chilli.tmp chilli && chmod 755 chilli
  
 
the last command comments out the lines 21 to 30
 
the last command comments out the lines 21 to 30
Line 92: Line 89:
 
please check the startup file for your special paths and start chilli with
 
please check the startup file for your special paths and start chilli with
  
sudo /etc/init.d/chilli start
+
sudo /etc/init.d/chilli start
  
 
To enable our chilli start up script at boot.
 
To enable our chilli start up script at boot.
  
update-rc.d chilli defaults
+
update-rc.d chilli defaults
  
 
We also need to make our chilli file executable by using the following command.
 
We also need to make our chilli file executable by using the following command.
  
chmod +x /etc/init.d/chilli
+
chmod +x /etc/init.d/chilli
 +
 
 +
 
 +
==Konfigurasi Dasar==
  
 
Basic Configuration
 
Basic Configuration
Line 110: Line 110:
 
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.
 
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.
  
nano /etc/chilli/config
+
nano /etc/chilli/config
  
 
Edit the first 63 lines of the file to the following until the HS_UAMSERVICE url is defined.
 
Edit the first 63 lines of the file to the following until the HS_UAMSERVICE url is defined.
  
# -*- /bin/sh -*-
+
# -*- /bin/sh -*-
#
+
#
#  Coova-Chilli Default Configurations.
+
#  Coova-Chilli Default Configurations.
#  To customize, copy this file to /etc/chilli/config
+
#  To customize, copy this file to /etc/chilli/config
#  and edit to your liking. This is included in shell scripts
+
#  and edit to your liking. This is included in shell scripts
#  that configure chilli and related programs before file 'config'.
+
#  that configure chilli and related programs before file 'config'.
 
+
# HS_WANIF=eth0            # WAN Interface toward the Internet
+
# HS_WANIF=eth0            # WAN Interface toward the Internet
HS_LANIF=eth1              # Subscriber Interface for client devices
+
HS_LANIF=eth1              # Subscriber Interface for client devices
HS_NETWORK=10.1.0.0    # HotSpot Network (must include HS_UAMLISTEN)
+
HS_NETWORK=10.1.0.0    # HotSpot Network (must include HS_UAMLISTEN)
HS_NETMASK=255.255.255.0  # HotSpot Network Netmask
+
HS_NETMASK=255.255.255.0  # HotSpot Network Netmask
HS_UAMLISTEN=10.1.0.1  # HotSpot IP Address (on subscriber network)
+
HS_UAMLISTEN=10.1.0.1  # HotSpot IP Address (on subscriber network)
HS_UAMPORT=3990            # HotSpot Port (on subscriber network)
+
HS_UAMPORT=3990            # HotSpot Port (on subscriber network)
 
+
# Allow some additional local ports (used in the up.sh script when  
+
# Allow some additional local ports (used in the up.sh script when  
# setting the firewall for the created tun/tap)
+
# setting the firewall for the created tun/tap)
HS_TCP_PORTS="80 443"
+
HS_TCP_PORTS="80 443"
 
+
# HS_DYNIP=
+
# HS_DYNIP=
# HS_DYNIP_MASK=255.255.255.0
+
# HS_DYNIP_MASK=255.255.255.0
# HS_STATIP=
+
# HS_STATIP=
# HS_STATIP_MASK=255.255.255.0
+
# HS_STATIP_MASK=255.255.255.0
# HS_DNS_DOMAIN=
+
# HS_DNS_DOMAIN=
# if your interface eth0 for example has the ip 192.168.5.2  
+
# 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  
+
# 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
+
# 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
+
# so you have don't have to define the dns servers below
#
+
#
# HS_DNS2=62.72.64.237   
+
# HS_DNS2=62.72.64.237   
# HS_DNS1=192.168.2.1   
+
# HS_DNS1=192.168.2.1   
 
+
###
+
###
#  HotSpot settings for simple Captive Portal
+
#  HotSpot settings for simple Captive Portal
#
+
#
HS_NASID=nas01
+
HS_NASID=nas01
HS_UAMSECRET=uamsecret
+
HS_UAMSECRET=uamsecret
HS_RADIUS=127.0.0.1
+
HS_RADIUS=127.0.0.1
HS_RADIUS2=127.0.0.1
+
HS_RADIUS2=127.0.0.1
HS_RADSECRET=radiussecret
+
HS_RADSECRET=radiussecret
# please provide here the address for your router too.  
+
# please provide here the address for your router too.  
# From the example above it has the address 192.168.0.1 (comma separated)
+
# 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
+
HS_UAMALLOW=10.1.0.0/24,192.168.0.1
 
+
#  Put entire domains in the walled-garden with DNS inspection
+
#  Put entire domains in the walled-garden with DNS inspection
# HS_UAMDOMAINS=".paypal.com,.paypalobjects.com"
+
# HS_UAMDOMAINS=".paypal.com,.paypalobjects.com"  
 
+
#  Optional initial redirect and RADIUS settings
+
#  Optional initial redirect and RADIUS settings
# HS_SSID=<ssid>          # To send to the captive portal
+
# HS_SSID=<ssid>          # To send to the captive portal
# HS_NASMAC=<mac address>  # To explicitly set Called-Station-Id
+
# HS_NASMAC=<mac address>  # To explicitly set Called-Station-Id
# HS_NASIP=<ip address>    # To explicitly set NAS-IP-Address
+
# HS_NASIP=<ip address>    # To explicitly set NAS-IP-Address
 
+
#  The server to be used in combination with HS_UAMFORMAT to
+
#  The server to be used in combination with HS_UAMFORMAT to
#  create the final chilli 'uamserver' url configuration.
+
#  create the final chilli 'uamserver' url configuration.
HS_UAMSERVER=10.1.0.1
+
HS_UAMSERVER=10.1.0.1
 
+
#  Use HS_UAMFORMAT to define the actual captive portal url.
+
#  Use HS_UAMFORMAT to define the actual captive portal url.
#  Shell variable replacement takes place when evaluated, so here
+
#  Shell variable replacement takes place when evaluated, so here
#  HS_UAMSERVER is escaped and later replaced by the pre-defined
+
#  HS_UAMSERVER is escaped and later replaced by the pre-defined
#  HS_UAMSERVER to form the actual "--uamserver" option in chilli.
+
#  HS_UAMSERVER to form the actual "--uamserver" option in chilli.
HS_UAMFORMAT=https://\$HS_UAMSERVER/uam/
+
HS_UAMFORMAT=https://\$HS_UAMSERVER/uam/
 
+
#  Same principal goes for HS_UAMHOMEPAGE.
+
#  Same principal goes for HS_UAMHOMEPAGE.
HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN:\$HS_UAMPORT/www/coova.html
+
HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN:\$HS_UAMPORT/www/coova.html
 
+
#  This option will be configured to be the WISPr LoginURL as well
+
#  This option will be configured to be the WISPr LoginURL as well
#  as provide "uamService" to the ChilliController. The UAM Service is
+
#  as provide "uamService" to the ChilliController. The UAM Service is
#  described in: http://coova.org/wiki/index.php/CoovaChilli/UAMService
+
#  described in: http://coova.org/wiki/index.php/CoovaChilli/UAMService
#
+
#
HS_UAMSERVICE=https://10.1.0.1/cgi-bin/hotspotlogin.cgi
+
HS_UAMSERVICE=https://10.1.0.1/cgi-bin/hotspotlogin.cgi
 
 
 
 
  
 
==Pranala Menarik==
 
==Pranala Menarik==

Revision as of 13:24, 7 April 2010

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

  • Paket
  • Source

Kedua metoda tersebut di jelaskan di bawah ini.

Instalasi CoovaChilli menggunakan paket

To install the CoovaChilli package, first download it (or the latest version available from http://www.coova.org/CoovaChilli):

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

Then install it:

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

Copy the default configuration files and Apache site configuration:

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

Change Host Address

Edit index.html to use chilli.js from local (this example uses the host IP address as 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 to use the correct host IP address (again, example uses 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

To enable coovachilli change START_CHILLI to 1

nano -w /etc/default/chilli

To enable on reboot

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

To enable without a reboot

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.0.13.tar.gz
tar xzf coova-chilli-1.0.13.tar.gz && cd coova-chilli-1.0.13
./configure
make
sudo make install

Copy the default configuration files and Apache site configuration:

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 to use chilli.js from local (default is 192.168.2.1 for few networks and many hosts)

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

The startup script:

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

the last command comments out the lines 21 to 30

please check the startup file for your special paths and start chilli with

sudo /etc/init.d/chilli start

To enable our chilli start up script at boot.

update-rc.d chilli defaults

We also need to make our chilli file executable by using the following command.

chmod +x /etc/init.d/chilli


Konfigurasi Dasar

Basic Configuration

See /etc/chilli/defaults file for details on possible configurations. Copy this to a new file called "config" (in the same directory) and edit the settings. To load the settings and start chilli, run "/etc/init.d/chilli start". This will generate main.conf, local.conf, and hs.conf files in /etc/chilli/ for you. 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.

nano /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