Mastering the basics of iptables

iptables consists of five tables of rules, each with its own distinct purpose:

  • Filter table: For basic protection of our servers and clients, this might be the only table that we use.
  • Network Address Translation (NAT) table: NAT is used to connect the public internet to private networks.
  • Mangle table: This is used to alter network packets as they go through the firewall.
  • Raw table: This is for packets that don't require connection tracking.
  • Security table: The security table is only used for systems that have SELinux installed.

Since we're currently only interested in basic host protection, we will only look at the filter table for the time being. (In a few moments, I'll show you a couple of fancy tricks ...

Get Mastering Linux Security and Hardening - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.