This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
user_guide:openvpn_bridges_prep_coova [2016/09/26 08:23] – admin | user_guide:openvpn_bridges_prep_coova [2016/10/06 06:18] (current) – [Making things permanent] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== OpenVPN Bridges => Prepare Coova Chilli ====== | + | ====== OpenVPN Bridges ====== |
+ | ===== | ||
+ | |||
+ | ===== Building and Installing Coova Chilli | ||
* Download the latest release of Coova Chilli. (Version 1.3.1.4 at the time of this writing) | * Download the latest release of Coova Chilli. (Version 1.3.1.4 at the time of this writing) | ||
* [[https:// | * [[https:// | ||
Line 15: | Line 18: | ||
#Save your changes | #Save your changes | ||
</ | </ | ||
+ | * Install the packages that is required for building **debs**. | ||
+ | <code bash> | ||
+ | sudo apt-get update | ||
+ | sudo apt-get install build-essential linux-headers-server libssl-dev | ||
+ | sudo apt install devscripts debhelper gengetopt libtool automake | ||
+ | </ | ||
+ | * Build and install the package: | ||
+ | <code bash> | ||
+ | cd coova-chilli-1.3.1.4/ | ||
+ | debuild -i -us -uc -b | ||
+ | cd .. | ||
+ | sudo dpkg --install coova-chilli_1.3.0_amd64.deb | ||
+ | </ | ||
+ | |||
+ | --------- | ||
+ | |||
+ | ===== Configuring Coova Chilli ===== | ||
+ | ==== 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. | ||
+ | |||
+ | ==== Create the main config file ==== | ||
+ | * Create a file called **/ | ||
+ | <file bash / | ||
+ | HS_WANIF=eth1 | ||
+ | HS_DNS1=4.4.4.4 | ||
+ | HS_DNS2=8.8.8.8 | ||
+ | HS_RADIUS=198.27.111.78 | ||
+ | HS_RADIUS2=198.27.111.78 | ||
+ | HS_RADSECRET=testing123 | ||
+ | HS_UAMSECRET=greatsecret | ||
+ | HS_UAMALIASNAME=chilli | ||
+ | HS_UAMSERVER=$HS_UAMLISTEN | ||
+ | HS_UAMFORMAT=http:// | ||
+ | HS_UAMHOMEPAGE=http:// | ||
+ | HS_MODE=hotspot | ||
+ | HS_TYPE=coovachilli | ||
+ | HS_WWWDIR=/ | ||
+ | HS_WWWBIN=/ | ||
+ | HS_PROVIDER=Coova | ||
+ | HS_PROVIDER_LINK=http:// | ||
+ | HS_LOC_NAME=" | ||
+ | </ | ||
+ | * Create the VLAN config directories | ||
+ | <code bash> | ||
+ | sudo su | ||
+ | cd /etc/chilli | ||
+ | ./ | ||
+ | ./ | ||
+ | ./ | ||
+ | </ | ||
+ | * Create the three VLAN configs | ||
+ | <file bash / | ||
+ | HS_LANIF=br0.101 | ||
+ | HS_NETWORK=10.101.0.0 | ||
+ | HS_NETMASK=255.255.0.0 | ||
+ | HS_UAMLISTEN=10.101.0.1 | ||
+ | HS_UAMPORT=3990 | ||
+ | HS_UAMUIPORT=4990 | ||
+ | |||
+ | HS_DYNIP=10.101.1.1 | ||
+ | HS_DYNIP_MASK=255.255.0.0 | ||
+ | HS_STATIP=10.101.0.1 | ||
+ | HS_STATIP_MASK=255.255.255.0 | ||
+ | # HS_DNS_DOMAIN= | ||
+ | |||
+ | HS_NASID=rd-vlan101 | ||
+ | HS_SSID=rd-vlan101-ssid | ||
+ | </ | ||
+ | |||
+ | -------------------- | ||
+ | |||
+ | <file bash / | ||
+ | HS_LANIF=br0.102 | ||
+ | HS_NETWORK=10.102.0.0 | ||
+ | HS_NETMASK=255.255.0.0 | ||
+ | HS_UAMLISTEN=10.102.0.1 | ||
+ | HS_UAMPORT=3991 | ||
+ | HS_UAMUIPORT=4991 | ||
+ | |||
+ | HS_DYNIP=10.102.1.1 | ||
+ | HS_DYNIP_MASK=255.255.0.0 | ||
+ | HS_STATIP=10.102.0.1 | ||
+ | HS_STATIP_MASK=255.255.255.0 | ||
+ | # HS_DNS_DOMAIN= | ||
+ | |||
+ | HS_NASID=rd-vlan102 | ||
+ | HS_SSID=rd-vlan102-ssid | ||
+ | |||
+ | </ | ||
+ | |||
+ | --------------- | ||
+ | |||
+ | <file bash / | ||
+ | HS_LANIF=br0.103 | ||
+ | HS_NETWORK=10.103.0.0 | ||
+ | HS_NETMASK=255.255.0.0 | ||
+ | HS_UAMLISTEN=10.103.0.1 | ||
+ | HS_UAMPORT=3992 | ||
+ | HS_UAMUIPORT=4992 | ||
+ | |||
+ | HS_DYNIP=10.103.1.1 | ||
+ | HS_DYNIP_MASK=255.255.0.0 | ||
+ | HS_STATIP=10.103.0.1 | ||
+ | HS_STATIP_MASK=255.255.255.0 | ||
+ | # HS_DNS_DOMAIN= | ||
+ | |||
+ | HS_NASID=rd-vlan103 | ||
+ | HS_SSID=rd-vlan103-ssid | ||
+ | |||
+ | </ | ||
+ | |||
+ | -------------------- | ||
+ | |||
+ | ===== 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 90%> | ||
+ | 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 / | ||
+ | </ | ||
+ | |||
+ | ------ | ||
+ | |||
+ | ===== Making things permanent ===== | ||
+ | * Ensure that CoovaChilli will start up after reboots. | ||
+ | * If your server only has one interface card, add this line to the **/ | ||
+ | <code bash> | ||
+ | #Add the startup of OpenVPN | ||
+ | / | ||
+ | |||
+ | #Start up Chill | ||
+ | / | ||
+ | |||
+ | exit 0 | ||
+ | |||
+ | </ | ||
+ | * If your server has two interface cards, issue the following command: | ||
+ | <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 | ||
+ | |||
+ | |||
+ | |||
+ | |||