WiFi: HotSpot - CoovaChilli Instalasi Firewall

From OnnoWiki
Revision as of 13:24, 7 April 2010 by Onnowpurbo (talk | contribs)
Jump to navigation Jump to search

Install Firewall

IPtables

The creators of CoovaChilli have predefined rules for iptables, but their script needs a little help before it works. CoovaChilli's iptables config is done in the /etc/chilli/up.sh script which runs after the tun interface is up, so that the exact tun interface is known.

Fix up.sh by adding these lines at the very end of the file:

# may not have been populated the first time; run again
[ -e "/var/run/chilli.iptables" ] && sh /var/run/chilli.iptables 2>/dev/null
# force-add the final rule necessary to fix routing tables
iptables -I POSTROUTING -t nat -o $HS_WANIF -j MASQUERADE

/etc/chilli/up.sh calls /etc/chilli/ipup.sh, if it exists. By default, it does not. If you need to run your own commands after the main iptables configuration is done, create /etc/chilli/ipup.sh and populate it however you like, being sure to make it executable (chmod +x /etc/chilli/ipup.sh) when done.

In the chilli config above, we set the DNS server to that of the local interface. So, your system should be running a DNS server. In ubuntu, it's just a matter of:

tasksel

Then select DNS Server and install


Pranala Menarik