SlideShare une entreprise Scribd logo
1  sur  39
[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Modification of the TCP packet quality of service bits before routing occurs (Rarely used in SOHO environments) PREROUTING POSTROUTING OUTPUT INPUT FORWARD TCP header modification Mangle Filters packets originating from the firewall OUTPUT   Filters packets destined to the firewall. INPUT   Filters packets to servers accessible by another NIC on the firewall. FORWARD Packet filtering Filter     Chain Function chain in Queue Queue Function Queue Type
[object Object],Network address translation for packets generated by the firewall. (Rarely used in SOHO environments) OUTPUT   Address translation occurs after routing. This implies that there was no need to modify the destination IP address of the packet as in pre-routing. Used with NAT of the source IP address using either one-to-one or many-to-one NAT. This is known as source NAT, or SNAT. POSTROUTING Address translation occurs before routing. Used with NAT of the destination IP address, also known as destination NAT or DNAT. PREROUTING Network Address Translation   Nat     Chain Function Chain in Queue Queue Function Queue Type
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object]
[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],--reject-with  qualifier   Qualifiers include:   icmp-port-unreachable (default) icmp-net-unreachable icmp-host-unreachable >  Works like the DROP target, but will also return an error message to the host sending the packet that the packet was blocked REJECT N/A   >   iptables  stops further processing. >  The packet is blocked DROP N/A >  iptables  stops further processing. >  The packet is handed over to the end application or the operating system for processing ACCEPT Most common options Description Target
[object Object],[--to-ports <port>[-<port>]]   Specifies the range of source ports to which the original source port can be mapped. >  Used to do Source Network Address Translation. >  By default the source IP address is the same as that used by the firewall's interface MASQUERADE   -- to-source   <address>[-<address>][:<port>-<port>]   Specifies the source IP address and ports to be used by SNAT. > Used to do source network address translation rewriting the source IP address of the packet >  The source IP address is user defined SNAT -- to-destination   ipaddress   Tells iptables what the destination IP address should be > Used to do destination network address translation. ie. rewriting the destination IP address of the packet DNAT Most common options Description Target
[object Object],Match &quot;output&quot; interface on which the packet exits -o  <interface-name> Match &quot;input&quot; interface on which the packet enters. -i  <interface-name> Match destination IP address -d  <ip-address> Match source IP address -s  <ip-address> Match protocol. Types include,  icmp ,  tcp ,  udp , and  all -p  <protocol-type> Jump to the specified target chain when the packet matches the current rule. -j  <target> If you don't specify a table, then the  filter  table is assumed. As discussed before, the possible built-in tables include: filter, nat, mangle -t  <table> Description Iptables  command
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Used to identify a new TCP connection request -p tcp --syn TCP destination port Can be a single value or a range in the format: starting-port:ending-port -p tcp --dport  <port> TCP source port Can be a single value or a range in the format: start-port-number:end-port-number -p tcp --sport   <port> Description Switch
[object Object],iptables -A FORWARD -s 0/0 -i eth0 -d 192.168.1.58 -o eth1  -p TCP --sport  1024:65535  --dport  80 -j ACCEPT   UDP destination port Can be a single value or a range in the format: starting-port:ending-port -p udp --dport  <port> UDP source port Can be a single value or a range in the format: starting-port:ending-port -p udp --sport   <port> Description Switch
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],iptables -A FORWARD -s 0/0 -i eth0 -d 192.168.1.58 -o eth1 -p TCP --sport 1024:65535  -m multiport   --dport 80,443  -j ACCEPT   A variety of TCP/UDP ports separated by commas. Source and destination ports are assumed to be the same and they do not have to be within a range. -m multiport --ports  <port, port> A variety of TCP/UDP destination ports separated by commas. Unlike when  -m  isn't used, they do not have to be within a range. -m multiport --dport  <port, port> A variety of TCP/UDP source ports separated by commas. Unlike when  -m  isn't used, they do not have to be within a range.  -m multiport --port  <port, port> Description Switch
[object Object],iptables -A FORWARD -d 0/0 -o eth0 -s 192.168.1.58 -i eth1 -p TCP  -m state --state ESTABLISHED  -j ACCEPT   The most frequently tested states are:   ESTABLISHED: The packet is part of a connection that has seen packets in both directions   NEW: The packet is the start of a new connection   RELATED: The packet is starting a new secondary connection. This is a common feature of such protocols such as an FTP data transfer, or an ICMP error. INVALID: The packet couldn't be identified. Could be due to insufficient system resources, or ICMP errors that don't match an existing data flow. -m --state   <state> Description Switch
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]

Contenu connexe

Tendances

Subnetting Presentation
Subnetting PresentationSubnetting Presentation
Subnetting Presentation
Touhidul Fahim
 
CCNA 200-301 Chapter 1-Introduction to TCP IP Networking.pptx
CCNA 200-301 Chapter 1-Introduction to TCP IP Networking.pptxCCNA 200-301 Chapter 1-Introduction to TCP IP Networking.pptx
CCNA 200-301 Chapter 1-Introduction to TCP IP Networking.pptx
BabarYunus1
 
CCNA Introducing Networks
CCNA Introducing NetworksCCNA Introducing Networks
CCNA Introducing Networks
Dsunte Wilson
 
Routing Information Protocol
Routing Information ProtocolRouting Information Protocol
Routing Information Protocol
Kashif Latif
 

Tendances (20)

IPv4
IPv4IPv4
IPv4
 
6lowpan
6lowpan6lowpan
6lowpan
 
Subnetting Presentation
Subnetting PresentationSubnetting Presentation
Subnetting Presentation
 
Ip address
Ip address Ip address
Ip address
 
CCNA 200-301 Chapter 1-Introduction to TCP IP Networking.pptx
CCNA 200-301 Chapter 1-Introduction to TCP IP Networking.pptxCCNA 200-301 Chapter 1-Introduction to TCP IP Networking.pptx
CCNA 200-301 Chapter 1-Introduction to TCP IP Networking.pptx
 
CCNA Introducing Networks
CCNA Introducing NetworksCCNA Introducing Networks
CCNA Introducing Networks
 
Arp spoofing
Arp spoofingArp spoofing
Arp spoofing
 
Routing protocols
Routing protocolsRouting protocols
Routing protocols
 
Ppt of routing protocols
Ppt of routing protocolsPpt of routing protocols
Ppt of routing protocols
 
MAC & IP addresses
MAC & IP addressesMAC & IP addresses
MAC & IP addresses
 
Routing Information Protocol
Routing Information ProtocolRouting Information Protocol
Routing Information Protocol
 
IP address
IP addressIP address
IP address
 
Address resolution protocol (ARP)
Address resolution protocol (ARP)Address resolution protocol (ARP)
Address resolution protocol (ARP)
 
Concept of networking
Concept of networkingConcept of networking
Concept of networking
 
Troubleshooting Network and Network Utilities
Troubleshooting Network and Network UtilitiesTroubleshooting Network and Network Utilities
Troubleshooting Network and Network Utilities
 
Ip addressing
Ip addressingIp addressing
Ip addressing
 
Basics of IP Addressing
Basics of IP AddressingBasics of IP Addressing
Basics of IP Addressing
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
 
Traceroute- A Networking Tool
Traceroute- A Networking ToolTraceroute- A Networking Tool
Traceroute- A Networking Tool
 
Open shortest path first (ospf)
Open shortest path first (ospf)Open shortest path first (ospf)
Open shortest path first (ospf)
 

En vedette (9)

6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Iptables presentation
Iptables presentationIptables presentation
Iptables presentation
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Linux booting process!!
Linux booting process!!Linux booting process!!
Linux booting process!!
 
Packet Filtering Using Iptables
Packet Filtering Using IptablesPacket Filtering Using Iptables
Packet Filtering Using Iptables
 
System and network administration network services
System and network administration network servicesSystem and network administration network services
System and network administration network services
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Processes
ProcessesProcesses
Processes
 

Similaire à Iptables

IP Tables And Filtering
IP Tables And FilteringIP Tables And Filtering
IP Tables And Filtering
SuperstarRr
 
Iptables fundamentals
Iptables fundamentalsIptables fundamentals
Iptables fundamentals
ram_b17
 
Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntax
guestcc37e8c
 
Firewalls rules using iptables in linux
Firewalls rules using iptables in linuxFirewalls rules using iptables in linux
Firewalls rules using iptables in linux
aamir lucky
 
iptable casestudy by sans.pdf
iptable casestudy by sans.pdfiptable casestudy by sans.pdf
iptable casestudy by sans.pdf
Admin621695
 
25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples
chinkshady
 
IPTABLES_linux_Firewall_Administration (1).pdf
IPTABLES_linux_Firewall_Administration (1).pdfIPTABLES_linux_Firewall_Administration (1).pdf
IPTABLES_linux_Firewall_Administration (1).pdf
mpassword
 
25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples
Teja Bheemanapally
 

Similaire à Iptables (20)

Firewall
FirewallFirewall
Firewall
 
03 linuxfirewall1
03 linuxfirewall103 linuxfirewall1
03 linuxfirewall1
 
IP Tables And Filtering
IP Tables And FilteringIP Tables And Filtering
IP Tables And Filtering
 
Iptables fundamentals
Iptables fundamentalsIptables fundamentals
Iptables fundamentals
 
Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntax
 
Chapter 6 firewall
Chapter 6 firewallChapter 6 firewall
Chapter 6 firewall
 
Firewalls rules using iptables in linux
Firewalls rules using iptables in linuxFirewalls rules using iptables in linux
Firewalls rules using iptables in linux
 
IP Tables Getting Started - Part 2
IP Tables Getting Started - Part 2IP Tables Getting Started - Part 2
IP Tables Getting Started - Part 2
 
IPTables Primer - Part 2
IPTables Primer - Part 2IPTables Primer - Part 2
IPTables Primer - Part 2
 
CN 1.docx
CN 1.docxCN 1.docx
CN 1.docx
 
nwlab-ex1.pdf
nwlab-ex1.pdfnwlab-ex1.pdf
nwlab-ex1.pdf
 
Iptables Configuration
Iptables ConfigurationIptables Configuration
Iptables Configuration
 
iptable casestudy by sans.pdf
iptable casestudy by sans.pdfiptable casestudy by sans.pdf
iptable casestudy by sans.pdf
 
IP tables and Filtering
IP tables and FilteringIP tables and Filtering
IP tables and Filtering
 
25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples
 
Basic Introduction to Technology (networking).pdf
Basic Introduction to Technology (networking).pdfBasic Introduction to Technology (networking).pdf
Basic Introduction to Technology (networking).pdf
 
IPTABLES_linux_Firewall_Administration (1).pdf
IPTABLES_linux_Firewall_Administration (1).pdfIPTABLES_linux_Firewall_Administration (1).pdf
IPTABLES_linux_Firewall_Administration (1).pdf
 
I ptable
I ptableI ptable
I ptable
 
[2019.01.12] hst iptables 101 to 301
[2019.01.12] hst   iptables 101 to 301[2019.01.12] hst   iptables 101 to 301
[2019.01.12] hst iptables 101 to 301
 
25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples25 most frequently used linux ip tables rules examples
25 most frequently used linux ip tables rules examples
 

Plus de leminhvuong

Module 7 Sql Injection
Module 7   Sql InjectionModule 7   Sql Injection
Module 7 Sql Injection
leminhvuong
 
Lession1 Linux Preview
Lession1 Linux PreviewLession1 Linux Preview
Lession1 Linux Preview
leminhvuong
 
Lession3 Routing
Lession3 RoutingLession3 Routing
Lession3 Routing
leminhvuong
 
Module 1 Introduction
Module 1   IntroductionModule 1   Introduction
Module 1 Introduction
leminhvuong
 
Net Security Intro
Net Security IntroNet Security Intro
Net Security Intro
leminhvuong
 
Module 10 Physical Security
Module 10   Physical SecurityModule 10   Physical Security
Module 10 Physical Security
leminhvuong
 
Module 8 System Hacking
Module 8   System HackingModule 8   System Hacking
Module 8 System Hacking
leminhvuong
 
Module 6 Session Hijacking
Module 6   Session HijackingModule 6   Session Hijacking
Module 6 Session Hijacking
leminhvuong
 
Module 5 Sniffers
Module 5  SniffersModule 5  Sniffers
Module 5 Sniffers
leminhvuong
 
Module 4 Enumeration
Module 4   EnumerationModule 4   Enumeration
Module 4 Enumeration
leminhvuong
 
Module 3 Scanning
Module 3   ScanningModule 3   Scanning
Module 3 Scanning
leminhvuong
 
Module 2 Foot Printing
Module 2   Foot PrintingModule 2   Foot Printing
Module 2 Foot Printing
leminhvuong
 

Plus de leminhvuong (20)

Proxy
ProxyProxy
Proxy
 
Lession2 Xinetd
Lession2 XinetdLession2 Xinetd
Lession2 Xinetd
 
Module 7 Sql Injection
Module 7   Sql InjectionModule 7   Sql Injection
Module 7 Sql Injection
 
Lession1 Linux Preview
Lession1 Linux PreviewLession1 Linux Preview
Lession1 Linux Preview
 
Http
HttpHttp
Http
 
Dns
DnsDns
Dns
 
Net Admin Intro
Net Admin IntroNet Admin Intro
Net Admin Intro
 
Lession4 Dhcp
Lession4 DhcpLession4 Dhcp
Lession4 Dhcp
 
Lession3 Routing
Lession3 RoutingLession3 Routing
Lession3 Routing
 
Module 1 Introduction
Module 1   IntroductionModule 1   Introduction
Module 1 Introduction
 
Wire Less
Wire LessWire Less
Wire Less
 
Net Security Intro
Net Security IntroNet Security Intro
Net Security Intro
 
Module 10 Physical Security
Module 10   Physical SecurityModule 10   Physical Security
Module 10 Physical Security
 
Module 9 Dos
Module 9   DosModule 9   Dos
Module 9 Dos
 
Module 8 System Hacking
Module 8   System HackingModule 8   System Hacking
Module 8 System Hacking
 
Module 6 Session Hijacking
Module 6   Session HijackingModule 6   Session Hijacking
Module 6 Session Hijacking
 
Module 5 Sniffers
Module 5  SniffersModule 5  Sniffers
Module 5 Sniffers
 
Module 4 Enumeration
Module 4   EnumerationModule 4   Enumeration
Module 4 Enumeration
 
Module 3 Scanning
Module 3   ScanningModule 3   Scanning
Module 3 Scanning
 
Module 2 Foot Printing
Module 2   Foot PrintingModule 2   Foot Printing
Module 2 Foot Printing
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Iptables

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.