We have talked about security in this space before, in more abstract terms. More specifically, we are going to review the basic setup and some simple access rules using the venerable and ever popular ‘iptables’ firewall available for every Linux distribution around.
Firewall Service Management
Depending on the distribution, you are able to manage your firewall service a number of ways. With the RPM based distributions (Red Hat, CentOS, Fedora), you can start the firewall as follows:
sudo service iptables start
and you can set it to autostart thereafter by executing:
sudo chkconfig iptables on
With Debian based distributions (Debian, Ubuntu and its variants and Mint), you manage both the start and autostart using a script called ‘ufw’ as follows:
sudo ufw enable
This will both start the firewall with default chain rulesets in place as well as configure the firewall to autostart on system boot. The valid states for ‘ufw’ are [enable/disable/status], status will let you know whether the firewall is started and configured to start on boot.