Professional Documents
Culture Documents
Iptables
Iptables
Description: iptables controls the ports on a network interface where the packets will enter and exit.
if we don’t want to allow the traffic from a specific port we can close the port.
Theory:
IP tables is a rule based firewall system and it is normally pre-installed on a Unix Operating System
which is controlling the incoming and outgoing packets. By default the IP tables is running
withoutany rules, we can create, add, editrules into it.
IP tables is used to set up, maintain, and inspect the tables of IPpacket filter rules in the Linux kernel.
Several different tables may be defined. Each table contains a number of built-in chains and may also
contain user-defined chains. Each chain is a list of rules which can match a set of packets. Each rule
specifies what to do with a packet that matches. This is called a ‘target’, which may be a jump to a
user-defined chain in the same table.
It is the default table in IP tables. There is no need to specify the table name for defining the Rules.
Different inbuilt chains in this table.
1. INPUT Chain
This chain handles all packets that are addressed to your server.
2. FORWARD Chain
This chain is used to deal with traffic destined for other servers that are not created on your
server. This chainis basically a way to configure your server to route requests to other
machines.
3. OUTPUT Chain
This chain control packets from the server to outside. Here we can add different rules to
manage outbound connection from the server.
Targets:
Each and every chain contain three types of targets. Those are
RULES:
1. Displaying list of chains
-L : For displaying list of chains
-n: for displaying IP address and port number in numeric format
-v : for displaying the rules in detail
--line-numbers : to display rules in line numbers
Procedure:
1. Iptables -L