Ip Tables: Presented By)
Ip Tables: Presented By)
Presented by
MOHD MUKEEM( 08CSS42 )
MOHD MUDASSIR(08CSS41)
What is iptable?
Description :---
• Iptables is used to set up and maintain the tables for ip
packet filter rules in the linux kernel
• Several tables are defined.
• each tables contains built-in chain.
• There may be also user define.
• Each chain has the list of rules
which can match with the set of packet.
• Each rules specified what to do with the matching
packets. This is called the “TARGET”.
TARGET:-
• Firewall specified the criteria for the packet and the
target.
1. filter :--
• This is the default table when no –t option is uesd
• It has three built-in chain
1) INPUT :-- for packet destined to local socket.
2) FORWARD :-- for packet being routed through the box.
3) OUTPUT:-- For the packet which generated locally.
NAT(Network address translation)
This table is used when the new connection is
created.
There is three type of the built chain
1. PREROUTING:-- for altering the as soon as they
come.
2. POSROUTING:-- for altering the packet as they
are about to go.
3. OUTPUT:-- for altering locally generated packet.
4. the following commands are used to list all the
rules in the iptables
Iptables -L
Iptables -L –t nat
Iptables -L –t mangle
Iptable(conti….)
Mangle :--
this table is used to modify the specialized packets.
Kernel 2.4.17 has two built-in chain(PRERUOTING and
OUTPUT) while kernel 2.4.18 has three more built-in chain
(INPUT ,POSTROUTING and FORWARD)
PREROUTING:--for modification of the incoming packet
before the routing.
OUTPUT:-- for modification of locally generated packet
before the routing.
INPUT :--for modification of incoming packet into the box
itself.
FORWARD:-- for altering the packet being routed through
the box.
POSTROUTING:-- for altering the packet as they are
about to go.
Implementation :--
commands:-
Short form
Short form Long form
iptables -L iptables --list
iptables -A iptables --append
iptables -D iptables --delete
iptables -R iptables --replace
iptables -F iptables --flush
iptables -N iptables –new-chain
iptables –E old-chain new-chain iptables –rename chain
iptables -h iptables –help
iptables –X chain iptables –delete-chain
commands (conti…) :-
Short form
Short form Long form
iptables -p protocol iptables –protocol protocol
iptables –-dport port add iptables –-destination -port
iptables –-sport port add. iptables -–source-port
iptables –s ip add iptables –-source
iptables –d ip add. iptables –destination
THE END