Iptables

From NovaOrdis Knowledge Base
Revision as of 20:33, 5 January 2016 by Ovidiu (talk | contribs) (→‎Lifecycle)
Jump to navigation Jump to search

External

Internal

Overview

iptables is a Linux command line tool used to query and manipulate the network packet filtering rules maintained by the Linux kernel. Network packet filtering in the kernel is implemented by the netfilter framework. The term "iptables" is also used to refer to the iptables service, which is a systemd service that uses the iptables tool to configure the packet filtering rules at boot. netfilter and iptables are used to implement network firewalls and NAT. The relationships between these concepts is explained in iptables Concepts: netfilter, iptables tool, iptables service and firewalld.

Concepts

iptables Concepts

iptables tool

iptables Service

Getting Information about iptables Service

systemctl status iptables

The following command tells whether the ip_tables modules are loaded:

lsmod | grep tables
ip_tables               9567  1 iptable_filter
ip6_tables             10867  1 ip6table_filter

iptables Service Installation

iptables service and firewalld are incompatible. If iptables service is used, firewalld must be disabled: firewalld#Disable.

yum install iptables
yum install iptables-services

Lifecycle

The iptables service starts by reading the individual iptables tool commands from its configuration rule file /etc/sysconfig/iptables. The rule commands are applied in order, then the commit command is issued.

iptables Service Configuration

Then enable the service to start at boot.

iptables Service Operations

Enable to Start at Boot

After rule configuration, enable the iptables service to start at boot:

systemctl enable iptables