This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
getting_started:18_install_ubuntu_coovachilli [2019/12/21 04:34] – [Enable CoovaChilli] admin | getting_started:18_install_ubuntu_coovachilli [2019/12/23 12:27] (current) – [Installing CoovaChilli] admin | ||
---|---|---|---|
Line 25: | Line 25: | ||
<code bash> | <code bash> | ||
+ | # If you downloaded with wget | ||
tar -xzvf 1.5.tar.gz | tar -xzvf 1.5.tar.gz | ||
+ | # If you downloaded with the browser | ||
+ | tar -xzvf coova-chilli-1.5.tar.gz | ||
cd coova-chilli-1.5/ | cd coova-chilli-1.5/ | ||
Line 80: | Line 83: | ||
* Save the file and start CoovaChilli | * Save the file and start CoovaChilli | ||
<code bash> | <code bash> | ||
+ | # | ||
sudo systemctl enable chilli | sudo systemctl enable chilli | ||
# Feedback code should be... | # Feedback code should be... | ||
Line 150: | Line 154: | ||
* Use the following / | * Use the following / | ||
<code bash> | <code bash> | ||
+ | HS_WANIF=enp0s3 | ||
HS_LANIF=enp0s8 | HS_LANIF=enp0s8 | ||
HS_NETWORK=10.1.0.0 | HS_NETWORK=10.1.0.0 | ||
Line 165: | Line 170: | ||
HS_NASIP=127.0.0.1 | HS_NASIP=127.0.0.1 | ||
HS_UAMSERVER=$HS_UAMLISTEN | HS_UAMSERVER=$HS_UAMLISTEN | ||
- | HS_UAMFORMAT=http:// | + | HS_UAMFORMAT=http:// |
HS_MACAUTH=on | HS_MACAUTH=on | ||
HS_TCP_PORTS=" | HS_TCP_PORTS=" | ||
Line 176: | Line 181: | ||
HS_LOC_NAME=" | HS_LOC_NAME=" | ||
HS_COAPORT=3799 | HS_COAPORT=3799 | ||
+ | #Please specify the DNS servers of your choice here | ||
+ | #Here we specified out own DSL router and as a fallback one of the Google servers | ||
+ | HS_DNS1=192.168.1.1 | ||
+ | HS_DNS2=8.8.8.8 | ||
</ | </ | ||
Line 184: | Line 193: | ||
</ | </ | ||
- | * Also comment the DNS server settings out in /// | ||
- | <code bash> | ||
- | # OpenDNS Servers | ||
- | # | ||
- | # | ||
- | </ | ||
* Use the following /// | * Use the following /// | ||
<code bash> | <code bash> | ||
- | UAM server specified as 10.1.0.1 | + | #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 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 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 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 | iptables -I INPUT -i tun0 -p tcp -m tcp --dport 8000 --dst 10.1.0.1 -j ACCEPT | ||
+ | # force-add the final rule necessary to fix routing tables (Enabling NAT) | ||
+ | iptables -F POSTROUTING -t nat | ||
+ | iptables -I POSTROUTING -t nat -o $HS_WANIF -j MASQUERADE | ||
</ | </ | ||
* Use the following /// | * Use the following /// | ||
<code bash> | <code bash> | ||
- | UAM server specified as 10.1.0.1 | + | #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 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 443 --dst 10.1.0.1 -j ACCEPT | ||
Line 207: | Line 213: | ||
</ | </ | ||
- | ===== 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 ===== | ===== Test it out ===== | ||
* Restart CoovaChilli for the latest changes to be effected. | * Restart CoovaChilli for the latest changes to be effected. | ||
<code bash> | <code bash> | ||
- | sudo / | + | sudo systemctl |
- | sudo / | + | sudo systemctl status |
+ | sudo systemctl | ||
</ | </ | ||
* Confirm it started fine | * Confirm it started fine | ||
<code bash> | <code bash> | ||
- | sudo tail / | + | sudo systemctl status chilli |
....... | ....... | ||
+ | ● chilli.service - LSB: Start CoovaChilli daemon at boot time | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | Process: 7619 ExecStart=/ | ||
+ | Tasks: 1 (limit: 1108) | ||
+ | | ||
+ | | ||
- | May 23 13:17:01 RADIUSdesk-Beta1-1 CRON[2427]: (root) CMD ( | + | Dec 21 03:05:26 osboxes systemd[1]: Started LSB: Start CoovaChilli daemon at boo |
- | May 23 13:18:28 RADIUSdesk-Beta1-1 coova-chilli[2109]: chilli.c: 5511: DHCP Released MAC=08-00-27-90-61-AE IP=10.1.0.2 | + | Dec 21 03:05:26 osboxes chilli[7706]: PID 7706 saving options to /var/run/chilli |
- | May 23 13:20:48 RADIUSdesk-Beta1-1 crontab[2444]: (root) LIST (root) | + | Dec 21 03:05:26 osboxes |
- | May 23 13:20:48 RADIUSdesk-Beta1-1 crontab[2446]: (root) REPLACE (root) | + | Dec 21 03:05:26 osboxes chilli[7706]: Loading modules |
- | May 23 13:20:48 RADIUSdesk-Beta1-1 coova-chilli[2109]: chilli.c: 7544: CoovaChilli shutting down | + | Dec 21 03:05:26 osboxes chilli[7706]: CoovaChilli 1.4. Copyright 2002-2005 Mondr |
- | May 23 13:20:48 RADIUSdesk-Beta1-1 | + | Dec 21 03:05:26 osboxes |
- | May 23 13:20:51 RADIUSdesk-Beta1-1 | + | Dec 21 03:05:26 osboxes |
- | May 23 13:20:51 RADIUSdesk-Beta1-1 | + | Dec 21 03:05:26 osboxes |
- | May 23 13:20:51 RADIUSdesk-Beta1-1 | + | Dec 21 03:05:26 osboxes |
- | May 23 13:21:01 RADIUSdesk-Beta1-1 cron[809]: (root) RELOAD (crontabs/ | + | Dec 21 03:05:26 osboxes |
....... | ....... | ||
</ | </ | ||
- | ===== Making | + | * Reboot the system and make sure CoovaChilli started up fine |
- | * Ensure that CoovaChilli will start up after reboots. | + | |
+ | ===== Troubleshooting tips ===== | ||
+ | * When things | ||
+ | * It might help if you see the captive portal as a mini router with a WAN side and a LAN side. | ||
+ | * So then there are a couple of important things to check. | ||
+ | |||
+ | ==== Are you getting an IP address | ||
+ | * The captive portal also serve as a DHCP server and a device connecting to it with DHCP enabled should get an IP address from it. | ||
+ | * You can check both sides (server and client) | ||
+ | * To check on the server issue the following command. | ||
<code bash> | <code bash> | ||
- | sudo update-rc.d chilli start 99 2 3 4 5 . stop 20 0 1 6 . | + | sudo chilli_query list |
+ | 08-00-27-54-A5-85 10.1.0.3 dnat 157706717100000002 0 08-00-27-54-A5-85 0/0 0/0 0/0 0/0 0 0 0/0 0/0 - | ||
+ | 08-00-27-8C-D3-32 10.1.0.2 dnat 157706713900000001 0 08-00-27-8C-D3-32 0/0 0/0 0/0 0/0 0 0 0/0 0/0 - | ||
</ | </ | ||
- | * Reboot | + | * You can read more about the **chilli_query** command here: [[https:// |
+ | * After consulting the documentation we can conclude that the captive portal has two clients connected but none has been authenticated. | ||
+ | * This means that they ' | ||
+ | * If you are not redirected to a login page we can try the following procedure which basically comes down to two things that is not working as intended. | ||
+ | * The routing between the LAN and WAN is not working correct. | ||
+ | * The DNS on the setup is not working correct. | ||
+ | |||
+ | ==== Forcing the login page to display ==== | ||
+ | * CoovaChilli | ||
+ | * The URL is http:// | ||
+ | * If you do get a login page you can next try to test the routing and the DNS. | ||
+ | |||
+ | ==== Test the routing | ||
+ | * To test the routing you can use the chilli_query command and manually authorize the client. | ||
+ | <code bash> | ||
+ | #Show the current list | ||
+ | sudo chilli_query list | ||
+ | 08-00-27-54-A5-85 10.1.0.3 dnat 157706717100000002 0 08-00-27-54-A5-85 0/0 0/0 0/0 0/0 0 0 0/0 0/0 http:// | ||
+ | 08-00-27-8C-D3-32 10.1.0.2 dnat 157706713900000001 0 08-00-27-8C-D3-32 0/0 0/0 0/0 0/0 0 0 0/0 0/0 - | ||
+ | #Authorize the client we want to test | ||
+ | sudo chilli_query authorize ip 10.1.0.3 | ||
+ | #Note how ' | ||
+ | system@osboxes: | ||
+ | 08-00-27-54-A5-85 10.1.0.3 pass 157706717100000002 1 08-00-27-54-A5-85 6/0 0/0 7073/0 3253/0 0 0 0%/0 0%/0 http:// | ||
+ | 08-00-27-8C-D3-32 10.1.0.2 dnat 157706713900000001 0 08-00-27-8C-D3-32 0/0 0/0 0/0 0/0 0 0 0/0 0/0 - | ||
+ | </ | ||
+ | * On the client you can now try to go to an IP Address that is reachable on the WAN side. I tried to get to the IP Address of my DSL router (192.168.1.1) and could reach it. This means that the traffic flow between the LAN of my captive portal to the LAN of the captive portal is fine. | ||
+ | * I can now again log this client off using the chilli_query command | ||
+ | <code bash> | ||
+ | sudo chilli_query logoff ip 10.1.0.3 | ||
+ | #' | ||
+ | system@osboxes: | ||
+ | 08-00-27-54-A5-85 10.1.0.3 dnat 157706939200000002 0 08-00-27-54-A5-85 0/0 0/0 460326/0 146821/0 0 0 0/0 0/0 http:// | ||
+ | 08-00-27-8C-D3-32 10.1.0.2 dnat 157706713900000001 0 08-00-27-8C-D3-32 0/0 0/0 0/0 0/0 0 0 0/0 0/0 - | ||
+ | </ | ||
+ | * Next we will test DNS | ||
+ | |||
+ | ==== Test the DNS ==== | ||
+ | * DNS traffic has to flow regardless of a client being authurised (pass) or not (dnat). | ||
+ | * In order for the client to magically pop up the login page, DNS has also to work correct. | ||
+ | * A common problem is that sometimes the client has their own DNS servers specified and then (depending on the configuration settings of CoovaChilli) it might not allow the DNS traffic to those server through. (Leaving things broken). | ||
+ | * After you confirmed that the client does not have any hard defined DNS servers you can try a ping test. | ||
+ | * With a ping test you just want to test and confirm that the DNS is working correct on the client. | ||
+ | * You can try and ping any known FQDN and see if the system resolve that to an IP address. | ||
+ | * Here I try to ping www.radiusdesk.com. As you can see the name resolution worked correct, but since I am not yet authorized (still in dnat state) the pings are not going through which is fine. | ||
+ | <code bash> | ||
+ | ping www.radiusdesk.com | ||
+ | PING radiusdesk.com (164.160.91.12) 56(84) bytes of data. | ||
+ | ^C | ||
+ | --- radiusdesk.com ping statistics --- | ||
+ | 2 packets transmitted, | ||
+ | </ | ||
+ | |||
+ | ==== Conclusion | ||
+ | * By using these check points on the captive portal setup, you can now point to a component which does not work as intended and try to resolve it. | ||
+ | * Be it the login page. | ||
+ | * The routing between WAN and LAN. | ||
+ | * The DNS service. |