Simple Linux Firewall with Lokkit
Most Linux distros have ipchains or iptables available however writing your own rules is kindof a pain.
There are multiples tools to help with this.
Here i'm gonna use "
It's very small and simple.
If you are on a desktop it has a web interface (Gnome), and if you are on a server, you can configure it from the console with it's n-curse based interface.
- Installation (Debian)
- Setting up the rules
lokkit -n
You will want to keep the setting to high, and click "customize to enable the services you need, for example on a web server maybe SSH, WWW, 443(https), 25: mail smtp, 993(imap) etc ...
Then we can checkout the generated rules and make sure it seems ok
vi /etc/default/lokkit
Just in case, you might want to add an entry to the crontab so that it shuts down the firewall in 5mn, just in case the firewall locks you out:
crontab -e
crontab -e
#sa it's 1:58 right now, so stop it at 2:05. 05 02 * * * /etc/init.d/lokkit stop #....
Ok now we can start the firewall, and test it (make sure whatever should be opened is).
/etc/init.d/lokkit start
If all goes well, don’t forget to remove the crontab entry !
crontab -e remove the line: 05 02 * * * /etc/init.d/lokkit stop
crontab -e remove the line: 05 02 * * * /etc/init.d/lokkit stop
Back to top

