06 February 2014

How To: Set basic iptables rules

Create a shell script which does the following:

  1. Delete all existing rules
  2. Set default chain policies
  3. Allow inbound SSH
  4. Allow inbound HTTP
  5. Allow outbound SSH

Create the set-iptables-rules.sh
# nano set-iptables-rules.sh

and copy-paste the following: