Getting to Know the Basic Iptables Commands on Linux for beginner . This time Matob will only discuss the basics of iptables on GNU/Linux. Iptables itself is a firewall rule that is used to regulate the entry and exit of traffic on the network on the Linux system that we use. In short, iptables is a data traffic controller on the GNU/Linux system that we use.

Since the mid 90’s Linux has inserted a new feature, namely the existence of a firewall. This technology has undergone several changes (the previous generation was known as ipfwadm or ipchains) and now what we know as packet filtering is iptables. Rules or parameters that can be used on Iptables itself are the same in all distributions. So even if you are using a Debian family distro, a RHELL family distro, or another distro, the commands or options are the same.

Rule Table in IPtables

Each table above has rules or rules called chains . The filter has 3 chains:

NAT has 3 chains:

Mangle has 5 chains: Mangle itself has 5 chains, namely PREROUTING, POSTROUTING, INPUT, OUTPUT, FORWARD. All chains are assigned to TCP Packet Quality of Service before the routing process is executed.

Basic Iptables Commands on Linux

COMMAND

Commands and rules installed in iptables (firewall) have conditions. Basically iptables on a computer is considered an IP TABLE according to its name. The system will only run the existing rules in the table. While the existing rules in iptables can also be deleted or replaced with other rules. Here are some commands for adding, deleting and similar operations that will be treated against the rule. List of Commands with description

PARAMETER

The iptables parameter is used as a necessary complement for the purpose of the rule specification

TARGET

Target is the goal of treatment of the rule. At this target lies the decision, what to do with the data packet, whether to reject it, or forward it or process it first. The following is a list of iptables target tables. The following targets Description

Examples Case

iptables -I INPUT -s 11.22.33.44/32 -j DROP

In the example above, we add a rule to the INPUT chain to block traffic from ip 11.22.33.44. If the IP accesses our network, the traffic will be dropped immediately.

For more detailed information about iptables, you can check using the command

man iptables

or

iptables –help

Alright, so an introduction to iptables on linux. If you have something to ask, please comment.