This shows you the differences between two versions of the page.
| getting_started:18_install_ubuntu_coova [2019/12/19 15:59] – created admin | getting_started:18_install_ubuntu_coova [2019/12/23 12:25] (current) – removed admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Install CoovaChilli on Ubuntu 18.04 ====== | ||
| - | ===== Introduction ===== | ||
| - | * RADIUSdesk can function perfectly without CoovaChilli. | ||
| - | * CoovaChilli is however the best open source captive portal software around. | ||
| - | * If you want to install CoovaChilli on a machine; <wrap hi>make sure that there are at least two functional network cards present</ | ||
| - | * One network card will be used by CoovaChilli as the Internet connection. | ||
| - | * The second network card will be used to run a captive portal on. This captive portal will be controlled by CoovaChilli who in turn receives it's instructions from FreeRADIUS (RADIUSdesk) | ||
| - | |||
| - | ===== Installing CoovaChilli ===== | ||
| - | * If you have a 32 bit machine the install of CoovaChilli will be a bit easier compared with the actions to install it on a 64 bit machine. They are however both easy to follow. | ||
| - | ==== 32 Bit Machines ==== | ||
| - | * We will assume that we are installing CoovaChilli on the same machine running RADIUSdesk. You are not required though to run them on the same machine. | ||
| - | * We also assume that the machine has an Internet connection on eth0 while eth1 will be used to run the captive portal on. | ||
| - | * Grab the latest binary build of CoovaChilli from this page. http:// | ||
| - | * As of this writing it is 1.3.0 | ||
| - | * Install it on the machine with the two network cards running RADIUSdesk | ||
| - | <code bash> | ||
| - | sudo dpkg --install coova-chilli_1.3.0_i386.deb | ||
| - | </ | ||
| - | * From the output of the dpkg command you will see that CoovaChilli is by default disabled. In the next section we will configure it to become a working entity. | ||
| - | ==== 64 bit Machines ==== | ||
| - | * We have to compile the 64 bit package from source. | ||
| - | * Download the latest version of the source here: http:// | ||
| - | * As of this writing it is at 1.3.0. | ||
| - | * Install the build tools, build and install the package | ||
| - | <code bash> | ||
| - | sudo apt-get install build-essential linux-headers-server libssl-dev | ||
| - | sudo apt install devscripts debhelper | ||
| - | tar -xzvf zxvf coova-chilli-1.3.0.tar.gz | ||
| - | cd coova-chilli-1.3.0/ | ||
| - | debuild -i -us -uc -b | ||
| - | cd .. | ||
| - | sudo dpkg --install coova-chilli_1.3.0_amd64.deb | ||
| - | </ | ||
| - | * From the output of the dpkg command you will see that CoovaChilli is by default disabled. In the next section we will configure it to become a working entity. | ||
| - | |||
| - | |||
| - | ===== Configuring CoovaChilli ===== | ||
| - | ==== Enable CoovaChilli ==== | ||
| - | * Edit the following file | ||
| - | <code bash> | ||
| - | sudo vi / | ||
| - | </ | ||
| - | * Change it to look like this | ||
| - | <code bash> | ||
| - | START_CHILLI=1 | ||
| - | CONFFILE="/ | ||
| - | HS_USER=" | ||
| - | </ | ||
| - | * Save the file and start CoovaChilli | ||
| - | <code bash> | ||
| - | sudo / | ||
| - | </ | ||
| - | * Make sure there is a tun interface present when you look at the feedback of the ifconfig command. | ||
| - | <code bash> | ||
| - | ifconfig | ||
| - | |||
| - | ..... | ||
| - | |||
| - | tun0 Link encap: | ||
| - | inet addr: | ||
| - | UP POINTOPOINT RUNNING | ||
| - | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
| - | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | ||
| - | collisions: | ||
| - | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) | ||
| - | |||
| - | ...... | ||
| - | </ | ||
| - | ==== Modify the configuration file ==== | ||
| - | * CoovaChilli is configured by editing or creating certail files unser the /etc/chilli directory. | ||
| - | |||
| - | |||
| - | ^ File ^ Comment | ||
| - | | **config** | ||
| - | | **default** | To avoid the splash screen we have to remove one line from this file | | ||
| - | | **ipup.sh** | Custom firewall rules for start-up | | ||
| - | | **ipdown.sh** | Custom firewall rule clean-up during shut-down. | | ||
| - | |||
| - | * Use the following / | ||
| - | <code bash> | ||
| - | HS_LANIF=eth1 | ||
| - | HS_NETWORK=10.1.0.0 | ||
| - | HS_NETMASK=255.255.0.0 | ||
| - | HS_UAMLISTEN=10.1.0.1 | ||
| - | HS_UAMPORT=3990 | ||
| - | HS_UAMUIPORT=4990 | ||
| - | HS_NASID=localhost | ||
| - | HS_RADIUS=localhost | ||
| - | HS_RADIUS2=localhost | ||
| - | HS_RADSECRET=testing123 | ||
| - | HS_UAMSECRET=greatsecret | ||
| - | HS_UAMALIASNAME=chilli | ||
| - | HS_SSID=" | ||
| - | HS_NASIP=127.0.0.1 | ||
| - | HS_UAMSERVER=$HS_UAMLISTEN | ||
| - | HS_UAMFORMAT=http:// | ||
| - | HS_MACAUTH=on | ||
| - | HS_TCP_PORTS=" | ||
| - | HS_MODE=hotspot | ||
| - | HS_TYPE=chillispot | ||
| - | HS_WWWDIR=/ | ||
| - | HS_WWWBIN=/ | ||
| - | HS_PROVIDER=Coova | ||
| - | HS_PROVIDER_LINK=http:// | ||
| - | HS_LOC_NAME=" | ||
| - | HS_COAPORT=3799 | ||
| - | </ | ||
| - | |||
| - | * Comment the following line out of /// | ||
| - | <code bash> | ||
| - | # Same principal goes for HS_UAMHOMEPAGE. | ||
| - | # | ||
| - | </ | ||
| - | |||
| - | * Also comment the DNS server settings out in /// | ||
| - | <code bash> | ||
| - | # OpenDNS Servers | ||
| - | # | ||
| - | # | ||
| - | </ | ||
| - | * Use the following /// | ||
| - | <code bash> | ||
| - | UAM server specified as 10.1.0.1 | ||
| - | iptables -I INPUT -i tun0 -p tcp -m tcp --dport 80 --dst 10.1.0.1 -j ACCEPT | ||
| - | iptables -I INPUT -i tun0 -p tcp -m tcp --dport 443 --dst 10.1.0.1 -j ACCEPT | ||
| - | iptables -I INPUT -i tun0 -p tcp -m tcp --dport 22 --dst 10.1.0.1 -j ACCEPT | ||
| - | iptables -I INPUT -i tun0 -p tcp -m tcp --dport 8000 --dst 10.1.0.1 -j ACCEPT | ||
| - | </ | ||
| - | * Use the following /// | ||
| - | <code bash> | ||
| - | UAM server specified as 10.1.0.1 | ||
| - | iptables -D INPUT -i tun0 -p tcp -m tcp --dport 80 --dst 10.1.0.1 -j ACCEPT | ||
| - | iptables -D INPUT -i tun0 -p tcp -m tcp --dport 443 --dst 10.1.0.1 -j ACCEPT | ||
| - | iptables -D INPUT -i tun0 -p tcp -m tcp --dport 22 --dst 10.1.0.1 -j ACCEPT | ||
| - | iptables -D INPUT -i tun0 -p tcp -m tcp --dport 8000 --dst 10.1.0.1 -j ACCEPT | ||
| - | </ | ||
| - | |||
| - | ===== Add NAT support ===== | ||
| - | * By default CoovaChilli does not do NAT between the two interfaces. We have to add NAT support during start-up in order to have a working system. | ||
| - | |||
| - | <WRAP center round alert 60%> | ||
| - | Failing to do this step will leave you with a broken system. | ||
| - | </ | ||
| - | |||
| - | * Edit the /// | ||
| - | <code bash> | ||
| - | test ${HS_ADMINTERVAL: | ||
| - | (crontab -l 2>&- | grep -v $0 | ||
| - | echo " | ||
| - | ) | crontab - 2>&- | ||
| - | } | ||
| - | |||
| - | #NAT mod | ||
| - | iptables -F POSTROUTING -t nat | ||
| - | iptables -I POSTROUTING -t nat -o $HS_WANIF -j MASQUERADE | ||
| - | #END NAT mod | ||
| - | |||
| - | ifconfig $HS_LANIF 0.0.0.0 | ||
| - | |||
| - | </ | ||
| - | |||
| - | ===== Test it out ===== | ||
| - | * Restart CoovaChilli for the latest changes to be effected. | ||
| - | <code bash> | ||
| - | sudo / | ||
| - | sudo / | ||
| - | </ | ||
| - | * Confirm it started fine | ||
| - | <code bash> | ||
| - | sudo tail / | ||
| - | |||
| - | ....... | ||
| - | |||
| - | May 23 13:17:01 RADIUSdesk-Beta1-1 CRON[2427]: (root) CMD ( cd / && run-parts --report / | ||
| - | May 23 13:18:28 RADIUSdesk-Beta1-1 coova-chilli[2109]: | ||
| - | May 23 13:20:48 RADIUSdesk-Beta1-1 crontab[2444]: | ||
| - | May 23 13:20:48 RADIUSdesk-Beta1-1 crontab[2446]: | ||
| - | May 23 13:20:48 RADIUSdesk-Beta1-1 coova-chilli[2109]: | ||
| - | May 23 13:20:48 RADIUSdesk-Beta1-1 coova-chilli[2448]: | ||
| - | May 23 13:20:51 RADIUSdesk-Beta1-1 coova-chilli[2561]: | ||
| - | May 23 13:20:51 RADIUSdesk-Beta1-1 coova-chilli[2561]: | ||
| - | May 23 13:20:51 RADIUSdesk-Beta1-1 coova-chilli[2563]: | ||
| - | May 23 13:21:01 RADIUSdesk-Beta1-1 cron[809]: (root) RELOAD (crontabs/ | ||
| - | |||
| - | ....... | ||
| - | </ | ||
| - | |||
| - | ===== Making things permanent ===== | ||
| - | * Ensure that CoovaChilli will start up after reboots. | ||
| - | <code bash> | ||
| - | sudo update-rc.d chilli start 99 2 3 4 5 . stop 20 0 1 6 . | ||
| - | </ | ||
| - | * Reboot the system and make sure CoovaChilli started up fine | ||