SlideShare a Scribd company logo
1 of 23
Download to read offline
SYSTEM AND NETWORK
ADMINISTRATION
IP TABLES
AND
FILTERING
OUTLINE
• What is Internet Protocols?
• What dose these protocols do?
• Firewall utilities
• Before Iptables
• Iptables Definition
• Basic Structure of IPTable
• IPTables Filtering
• Rules in Chains
• Targets
• Types OfTables
3
What is Internet Protocol ?
Internet Protocol
•An Internet Protocol is a set of rules that governs the
communications between computers on a network.
•A set of guidelines for implementing networking
communications between computers.
4
What Dose these Internet Protocol Do ?
• An internet protocol sometimes referred to as an access method, is used to
define a method of exchanging data over a computer network, such as
local area network, Internet, Intranet, etc
• These protocols are formal standards, policies and formulation of rules,
procedures and formats that define communication between two or more
devices over a network. Internet protocols are used to govern the end-to-
end processes of timely, secure and managed data or network
communication.
5
What is IP Addressing ?
• An Internet Protocol address (IP address) is a numerical label assigned to
each device connected to a computer network that uses the Internet
Protocol for communication.
• An IP address is an address used in order to uniquely identify a device on a
network.The address is made up of 32 binary bits, which can be divisible
into a network portion and host portion with the help of a subnet mask.
• A subnetwork or subnet is a logical subdivision of an network.The practice
of dividing a network into two or more networks is called subnetting.
 For more detail s read the notes given below.
6
Firewall Utilities
• A firewall is a software utility or hardware device that acts as a filter for data
entering or leaving a network or computer.You could think of a firewall as a
security guard that decides who enters or exits a building. A firewall works by
blocking or restricting network ports. Firewalls are commonly used to help
prevent unauthorized access to both company and home networks.
•A firewall utility is a program or device that acts as a barrier to keep
destructive elements out of a network or specific computer.
•A firewall controls network traffic to and from a computer, permitting or
denying communications based on a security policy.
For more details check the link given below
7
Levels Of implementation
SOFTWARE FIREWALLS
• Software firewalls are designed to
protect a computer by blocking
certain programs from sending and
receiving information from a local
network or the Internet.
HARDWARE FIREWALLS
• Hardware firewalls are found on most network
routers and can be configured through the
router setup screen. Firewall hardware or
device (ZyXEL Zywall), is a Unified Security
Gateway with a firewall and other security
features.
8
IP Tables with FILTERING
Mechanism
9
BEFORE IPTABLES
• Before Iptables the most popular firewall / NAT package running on Linux
was ipchains. It had a number of limitations, the primary one being that it
ran as a separate program and not as part of the kernel. The Netfilter
organization decided to create a new product called iptables in order to
rectify this shortcoming. As a result of this, iptables is considered a faster
and more secure alternative. IPtables has now become the default firewall
package installed under RedHat and Fedora Linux.
10
IPTABLES
• The basic firewall software used in Linux is called iptables .
• IPtables is a command-line firewall utility that uses policy chains to allow or
block traffic.When a connection tries to establish itself on your system,
iptables looks for a rule in its list to match it . If it doesn’t find one, it resorts
to the default action.
• We can call, it’s the basics of Firewall for Linux. Iptables is a rule based
firewall system and it is normally pre-installed firewall which is controlling
the incoming and outgoing packets. By-default the iptables is running
without any rules, we can create, add, edit rules into it.
• The Linux kernel has the built-in ability to filter packets, allowing some of
them into the system while stopping others.
11
BASIC STRUCTURE OF IPTABLE
• The default structure of iptables is like:
“Tables which has Chains and the Chains which contains Rules”
• Tables —> Chains —> Rules.
• The rules are defined to control the packets for Input/output.
12
IPTable Filtering
• The kernel will inspect data packets and decide based on these rules
what to do with each packet.
• IP filtering is simply a mechanism that decides which types of IP
datagram will be processed normally and which will be discarded. By
discarded we mean that the datagram is deleted and completely
ignored, as if it had never been received.
• The main difference between packet forwarding and packet filtering
is: Packet forwarding uses only a routing table to make decisions,
packet filtering uses a list of rules for filtering.
• The Linux kernel has the built-in ability to filter packets, allowing
some of them to be received by or pass through the system while
stopping.
13
Types of rules in chains
There are five types of rules implemented in all types of IP table chains:
• Input: The input chain is used for any packet coming into the system. Input Chain
is for managing packets input to the server and Used by mangle and filter tables.
• Output: The output chain is for any packet leaving the system and it is Used by
Mangle, NAT and Filter tables.
• Forward: The forward chain is for packets that are forwarded (routed) through the
system and used by Mangle and Filter tables.
• Prerouting: Prerouting allows altering of packets before they reach the input chain
and used by Mangle and NAT tables.
• Postrouting: Postrouting allows altering packets after they exit the output chain
and used by Mangle and NAT tables.
For more detail read notes given below
14
Targets
• Every iptables rules have some "target" which is executed when it is
matched against a "criteria". Following are the most common targets:
• ACCEPT: Packet is accepted and goes to the application for processing.
• DROP: Packet is dropped. No information regarding the drop is sent to the
sender.
• REJECT: Packet is dropped and information (error) message is sent to the
sender.
• LOG: Packet details are sent to for logging.
• DNAT: Rewrites the destination IP of the packet
• SNAT: Rewrites the source IP of the packet
16
Types of IP tables use in Filtering
• The three built-in tables with chains of rules. They are as follows:
• Filter :The default table for handling network packets.
• NAT : Used to alter packets that create a new connection.
• Mangle : Used for specific types of packet alteration.
16
GraphicalView of IP tables, Chains and Rules
17
FilterTable
• Filter is default table for iptables. So, if we don’t define our own table this
table will created by default.
• The filter table is mainly used for filtering packets.We can match packets
and filter them in whatever way we want.This is the place that we actually
take action against packets and look at what they contain and DROP or
/ACCEPT them, depending on their content.
• The built-in chains for the filter table are as follows:
•INPUT — Applies to network packets that are targeted for the server. Input Chain
is for managing packets input to the server.
•Here we can add rules to control input connections from client to the server.
•It means reply of a http request made by your browser will go through INPUT chain.
•OUTPUT — Applies to locally-generated network packets.
•Outgoing from firewall. For packets generated locally and going out of the local server.
•FORWARD — Applies to network packets routed through the host. Packet for
another NIC on the local server. For packets routed through the server.
18
FilerTable Processing Flow:
19
NATTable
• Network address translation (NAT) is a methodology of modifying network
address information in Internet Protocol (IP) datagram packet headers. So
these tables are used for Network AddressTranslation.
• A NAT is a technique that change the source and/or target ip-address in
packets. It is typically used to connect multiple computers in a private
address range with the (public) internet.
• This table should only be used for NAT (Network AddressTranslation) on
different packets. In simple words, it should only be used to translate the
packet's source field or destination field.
• The built-in chains for the NAT table are as follows:
•PREROUTING — As the name indicates its translate packets before routing.Alters
network packets when they arrive.
•OUTPUT — Alters network packets before they are sent out.
•POSTROUTING — Alters network packets before leave.
20
NAT table Processing Flow
21
MangleTable
• Mangling refers to modifying the IP Packet.Any sort of modification
in the packet can be called Mangling.
• Mangle is used for specialized packet alterations and used for packet
alternation.
• The built-in chains for the mangle table are as follows:
•INPUT — Alters network packets targeted for the host.
•OUTPUT — Alters locally-generated network packets before they are sent out.
•FORWARD — Alters network packets routed through the host.
•PREROUTING — Alters incoming network packets before they are routed.
•POSTROUTING — Alters network packets before they are sent out.
22
23

More Related Content

What's hot

What's hot (20)

Linux security
Linux securityLinux security
Linux security
 
Subnetting
SubnettingSubnetting
Subnetting
 
Iptables the Linux Firewall
Iptables the Linux Firewall Iptables the Linux Firewall
Iptables the Linux Firewall
 
TCP/ IP
TCP/ IP TCP/ IP
TCP/ IP
 
Introduction to Network and System Administration
Introduction to Network and System AdministrationIntroduction to Network and System Administration
Introduction to Network and System Administration
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
Samba server
Samba serverSamba server
Samba server
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
System Administration: Introduction to system administration
System Administration: Introduction to system administrationSystem Administration: Introduction to system administration
System Administration: Introduction to system administration
 
System and network administration network services
System and network administration network servicesSystem and network administration network services
System and network administration network services
 
Presentation on samba server
Presentation on samba serverPresentation on samba server
Presentation on samba server
 
Internet Protocol
Internet ProtocolInternet Protocol
Internet Protocol
 
Network management
Network managementNetwork management
Network management
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 
Basics Of Networking (Overview)
Basics Of Networking (Overview)Basics Of Networking (Overview)
Basics Of Networking (Overview)
 
DHCP
DHCPDHCP
DHCP
 
IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6
 

Similar to IP tables and Filtering

IP Tables And Filtering
IP Tables And FilteringIP Tables And Filtering
IP Tables And FilteringSuperstarRr
 
Iptables fundamentals
Iptables fundamentalsIptables fundamentals
Iptables fundamentalsram_b17
 
Packet Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferencePacket Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferenceCengage Learning
 
IPTABLES_linux_Firewall_Administration (1).pdf
IPTABLES_linux_Firewall_Administration (1).pdfIPTABLES_linux_Firewall_Administration (1).pdf
IPTABLES_linux_Firewall_Administration (1).pdfmpassword
 
Network security chapter 6 and 7 internet architecture
Network security chapter  6 and 7 internet   architectureNetwork security chapter  6 and 7 internet   architecture
Network security chapter 6 and 7 internet architectureMuhammad ismail Shah
 
Basic Introduction to Technology (networking).pdf
Basic Introduction to Technology (networking).pdfBasic Introduction to Technology (networking).pdf
Basic Introduction to Technology (networking).pdftthind
 
98 366 mva slides lesson 5
98 366 mva slides lesson 598 366 mva slides lesson 5
98 366 mva slides lesson 5suddenven
 
Internet protocols Report Slides
Internet protocols Report SlidesInternet protocols Report Slides
Internet protocols Report SlidesBassam Kanber
 
Basic networking
Basic networkingBasic networking
Basic networkingajeeshr3
 
Link i pv4
Link i pv4Link i pv4
Link i pv4NARESH A
 
IP routing in linux
IP routing in linuxIP routing in linux
IP routing in linuxgamer007
 

Similar to IP tables and Filtering (20)

IP Tables And Filtering
IP Tables And FilteringIP Tables And Filtering
IP Tables And Filtering
 
Firewall
FirewallFirewall
Firewall
 
Iptables fundamentals
Iptables fundamentalsIptables fundamentals
Iptables fundamentals
 
Packet Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferencePacket Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing Conference
 
IPTABLES_linux_Firewall_Administration (1).pdf
IPTABLES_linux_Firewall_Administration (1).pdfIPTABLES_linux_Firewall_Administration (1).pdf
IPTABLES_linux_Firewall_Administration (1).pdf
 
Network security chapter 6 and 7 internet architecture
Network security chapter  6 and 7 internet   architectureNetwork security chapter  6 and 7 internet   architecture
Network security chapter 6 and 7 internet architecture
 
Basic Introduction to Technology (networking).pdf
Basic Introduction to Technology (networking).pdfBasic Introduction to Technology (networking).pdf
Basic Introduction to Technology (networking).pdf
 
03 linuxfirewall1
03 linuxfirewall103 linuxfirewall1
03 linuxfirewall1
 
MVA slides lesson 5
MVA slides lesson 5MVA slides lesson 5
MVA slides lesson 5
 
98 366 mva slides lesson 5
98 366 mva slides lesson 598 366 mva slides lesson 5
98 366 mva slides lesson 5
 
Internet protocols Report Slides
Internet protocols Report SlidesInternet protocols Report Slides
Internet protocols Report Slides
 
TCP/IP model
TCP/IP modelTCP/IP model
TCP/IP model
 
SDN Introduction
SDN IntroductionSDN Introduction
SDN Introduction
 
Basic networking
Basic networkingBasic networking
Basic networking
 
TCP/IP
TCP/IPTCP/IP
TCP/IP
 
Link i pv4
Link i pv4Link i pv4
Link i pv4
 
Linux and firewall
Linux and firewallLinux and firewall
Linux and firewall
 
Iptables
IptablesIptables
Iptables
 
IPTABLES
IPTABLESIPTABLES
IPTABLES
 
IP routing in linux
IP routing in linuxIP routing in linux
IP routing in linux
 

Recently uploaded

CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 

Recently uploaded (20)

CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 

IP tables and Filtering

  • 3. OUTLINE • What is Internet Protocols? • What dose these protocols do? • Firewall utilities • Before Iptables • Iptables Definition • Basic Structure of IPTable • IPTables Filtering • Rules in Chains • Targets • Types OfTables 3
  • 4. What is Internet Protocol ? Internet Protocol •An Internet Protocol is a set of rules that governs the communications between computers on a network. •A set of guidelines for implementing networking communications between computers. 4
  • 5. What Dose these Internet Protocol Do ? • An internet protocol sometimes referred to as an access method, is used to define a method of exchanging data over a computer network, such as local area network, Internet, Intranet, etc • These protocols are formal standards, policies and formulation of rules, procedures and formats that define communication between two or more devices over a network. Internet protocols are used to govern the end-to- end processes of timely, secure and managed data or network communication. 5
  • 6. What is IP Addressing ? • An Internet Protocol address (IP address) is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. • An IP address is an address used in order to uniquely identify a device on a network.The address is made up of 32 binary bits, which can be divisible into a network portion and host portion with the help of a subnet mask. • A subnetwork or subnet is a logical subdivision of an network.The practice of dividing a network into two or more networks is called subnetting.  For more detail s read the notes given below. 6
  • 7. Firewall Utilities • A firewall is a software utility or hardware device that acts as a filter for data entering or leaving a network or computer.You could think of a firewall as a security guard that decides who enters or exits a building. A firewall works by blocking or restricting network ports. Firewalls are commonly used to help prevent unauthorized access to both company and home networks. •A firewall utility is a program or device that acts as a barrier to keep destructive elements out of a network or specific computer. •A firewall controls network traffic to and from a computer, permitting or denying communications based on a security policy. For more details check the link given below 7
  • 8. Levels Of implementation SOFTWARE FIREWALLS • Software firewalls are designed to protect a computer by blocking certain programs from sending and receiving information from a local network or the Internet. HARDWARE FIREWALLS • Hardware firewalls are found on most network routers and can be configured through the router setup screen. Firewall hardware or device (ZyXEL Zywall), is a Unified Security Gateway with a firewall and other security features. 8
  • 9. IP Tables with FILTERING Mechanism 9
  • 10. BEFORE IPTABLES • Before Iptables the most popular firewall / NAT package running on Linux was ipchains. It had a number of limitations, the primary one being that it ran as a separate program and not as part of the kernel. The Netfilter organization decided to create a new product called iptables in order to rectify this shortcoming. As a result of this, iptables is considered a faster and more secure alternative. IPtables has now become the default firewall package installed under RedHat and Fedora Linux. 10
  • 11. IPTABLES • The basic firewall software used in Linux is called iptables . • IPtables is a command-line firewall utility that uses policy chains to allow or block traffic.When a connection tries to establish itself on your system, iptables looks for a rule in its list to match it . If it doesn’t find one, it resorts to the default action. • We can call, it’s the basics of Firewall for Linux. Iptables is a rule based firewall system and it is normally pre-installed firewall which is controlling the incoming and outgoing packets. By-default the iptables is running without any rules, we can create, add, edit rules into it. • The Linux kernel has the built-in ability to filter packets, allowing some of them into the system while stopping others. 11
  • 12. BASIC STRUCTURE OF IPTABLE • The default structure of iptables is like: “Tables which has Chains and the Chains which contains Rules” • Tables —> Chains —> Rules. • The rules are defined to control the packets for Input/output. 12
  • 13. IPTable Filtering • The kernel will inspect data packets and decide based on these rules what to do with each packet. • IP filtering is simply a mechanism that decides which types of IP datagram will be processed normally and which will be discarded. By discarded we mean that the datagram is deleted and completely ignored, as if it had never been received. • The main difference between packet forwarding and packet filtering is: Packet forwarding uses only a routing table to make decisions, packet filtering uses a list of rules for filtering. • The Linux kernel has the built-in ability to filter packets, allowing some of them to be received by or pass through the system while stopping. 13
  • 14. Types of rules in chains There are five types of rules implemented in all types of IP table chains: • Input: The input chain is used for any packet coming into the system. Input Chain is for managing packets input to the server and Used by mangle and filter tables. • Output: The output chain is for any packet leaving the system and it is Used by Mangle, NAT and Filter tables. • Forward: The forward chain is for packets that are forwarded (routed) through the system and used by Mangle and Filter tables. • Prerouting: Prerouting allows altering of packets before they reach the input chain and used by Mangle and NAT tables. • Postrouting: Postrouting allows altering packets after they exit the output chain and used by Mangle and NAT tables. For more detail read notes given below 14
  • 15. Targets • Every iptables rules have some "target" which is executed when it is matched against a "criteria". Following are the most common targets: • ACCEPT: Packet is accepted and goes to the application for processing. • DROP: Packet is dropped. No information regarding the drop is sent to the sender. • REJECT: Packet is dropped and information (error) message is sent to the sender. • LOG: Packet details are sent to for logging. • DNAT: Rewrites the destination IP of the packet • SNAT: Rewrites the source IP of the packet 16
  • 16. Types of IP tables use in Filtering • The three built-in tables with chains of rules. They are as follows: • Filter :The default table for handling network packets. • NAT : Used to alter packets that create a new connection. • Mangle : Used for specific types of packet alteration. 16
  • 17. GraphicalView of IP tables, Chains and Rules 17
  • 18. FilterTable • Filter is default table for iptables. So, if we don’t define our own table this table will created by default. • The filter table is mainly used for filtering packets.We can match packets and filter them in whatever way we want.This is the place that we actually take action against packets and look at what they contain and DROP or /ACCEPT them, depending on their content. • The built-in chains for the filter table are as follows: •INPUT — Applies to network packets that are targeted for the server. Input Chain is for managing packets input to the server. •Here we can add rules to control input connections from client to the server. •It means reply of a http request made by your browser will go through INPUT chain. •OUTPUT — Applies to locally-generated network packets. •Outgoing from firewall. For packets generated locally and going out of the local server. •FORWARD — Applies to network packets routed through the host. Packet for another NIC on the local server. For packets routed through the server. 18
  • 20. NATTable • Network address translation (NAT) is a methodology of modifying network address information in Internet Protocol (IP) datagram packet headers. So these tables are used for Network AddressTranslation. • A NAT is a technique that change the source and/or target ip-address in packets. It is typically used to connect multiple computers in a private address range with the (public) internet. • This table should only be used for NAT (Network AddressTranslation) on different packets. In simple words, it should only be used to translate the packet's source field or destination field. • The built-in chains for the NAT table are as follows: •PREROUTING — As the name indicates its translate packets before routing.Alters network packets when they arrive. •OUTPUT — Alters network packets before they are sent out. •POSTROUTING — Alters network packets before leave. 20
  • 22. MangleTable • Mangling refers to modifying the IP Packet.Any sort of modification in the packet can be called Mangling. • Mangle is used for specialized packet alterations and used for packet alternation. • The built-in chains for the mangle table are as follows: •INPUT — Alters network packets targeted for the host. •OUTPUT — Alters locally-generated network packets before they are sent out. •FORWARD — Alters network packets routed through the host. •PREROUTING — Alters incoming network packets before they are routed. •POSTROUTING — Alters network packets before they are sent out. 22
  • 23. 23

Editor's Notes

  1. This era is said to be the era of computers. Computers have significantly changed the way we live. A computing device when connected to other computing device(s) enables us to share data and information at lightning fast speed. There are hundred n thousands of mechanism for connecting a computer to another computer, a network to another network and at the end of the edge it forms a world wide network known as Internet.
  2. Additional Information: If definitions are helpful to you, use these vocabulary terms in order to get you started: Address - The unique number ID assigned to one host or interface in a network. Subnet - A portion of a network that shares a particular subnet address. Subnet mask - A 32-bit combination used to describe which portion of an address refers to the subnet and which part refers to the host. Interface - A network connection. The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal and separated by a period (dot). For this reason, an IP address is said to be expressed in dotted decimal format (for example, 172.16.81.100). The value in each octet ranges from 0 to 255 decimal, or 00000000 - 11111111 binary. The right most bit, or least significant bit, of an octet holds a value of 20. The bit just to the left of that holds a value of 21. This continues until the left-most bit, or most significant bit, which holds a value of 27. Subnet: A smaller network created by dividing a larger network into equal parts. Subnet Mask: A 32-bit number used to distinguish the network and host portions of an IP address. It divides the IP address into network address and host address.
  3. For more detail: http://www.pctools.com/security-news/what-does-a-firewall-do/
  4. The basic firewall software most commonly used in Linux is called iptables . The iptables firewall works by interacting with the packet filtering hooks in the Linux kernel's networking stack. These kernel hooks are known as the netfilter framework. Netfilter is a utility in Linux 2.4 (and later releases) that facilitates Network Address Translation (NAT), packet filtering, and packet mangling. NAT is the process of converting an Internet protocol (IP) address into another IP address. Netfilter Hooks There are five netfilter hooks that programs can register with. As packets progress through the stack, they will trigger the kernel modules that have registered with these hooks. The hooks that a packet will trigger depends on whether the packet is incoming or outgoing, the packet's destination, and whether the packet was dropped or rejected at a previous point. The following hooks represent various well-defined points in the networking stack: NF_IP_PRE_ROUTING: This hook will be triggered by any incoming traffic very soon after entering the network stack. This hook is processed before any routing decisions have been made regarding where to send the packet. NF_IP_LOCAL_IN: This hook is triggered after an incoming packet has been routed if the packet is destined for the local system. NF_IP_FORWARD: This hook is triggered after an incoming packet has been routed if the packet is to be forwarded to another host. NF_IP_LOCAL_OUT: This hook is triggered by any locally created outbound traffic as soon it hits the network stack. NF_IP_POST_ROUTING: This hook is triggered by any outgoing or forwarded traffic after routing has taken place and just before being put out on the wire. Kernel modules that wish to register at these hooks must provide a priority number to help determine the order in which they will be called when the hook is triggered. This provides the means for multiple modules (or multiple instances of the same module) to be connected to each of the hooks with deterministic ordering. Each module will be called in turn and will return a decision to the netfilter framework after processing that indicates what should be done with the packet.
  5. Input – This chain is used to control the behaviour for incoming connections. For example, if a user attempts to SSH into your PC/server, iptables will attempt to match the IP address and port to a rule in the input chain. Forward – This chain is used for incoming connections that aren’t actually being delivered locally. Think of a router – data is always being sent to it but rarely actually destined for the router itself; the data is just forwarded to its target. Unless you’re doing some kind of routing, NATing, or something else on your system that requires forwarding, you won’t even use this chain. Output – This chain is used for outgoing connections. For example, if you try to ping howtogeek.com, iptables will check its output chain to see what the rules are regarding ping and howtogeek.com before making a decision to allow or deny the connection attempt. http://blog.adityapatawari.com/2011/12/ip-packet-filtering-iptables-explained.html