{"id":14684,"date":"2024-02-04T14:10:03","date_gmt":"2024-02-04T10:40:03","guid":{"rendered":"https:\/\/www.itpiran.net\/blog\/?p=14684"},"modified":"2024-02-04T14:10:03","modified_gmt":"2024-02-04T10:40:03","slug":"how-to-list-and-delete-iptables-firewall-rules","status":"publish","type":"post","link":"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/","title":{"rendered":"How to list and delete Iptables firewall rules"},"content":{"rendered":"<h2 id=\"%d9%85%d9%82%d8%af%d9%85%d9%87\">Introduction<\/h2>\n<p>Iptables is a firewall that plays a fundamental role in network security for most Linux systems. While many iptables tutorials teach you how to create firewall rules to secure your server, this one focuses on a different aspect of firewall management: listing and deleting rules.<\/p>\n<p>In this tutorial, we will cover how to perform the following iptables tasks:<\/p>\n<ul>\n<li>List the rules<\/li>\n<li>Clear packet and byte counters<\/li>\n<li>Delete rules<\/li>\n<li>Flushing a chain (deleting all rules in a chain)<\/li>\n<li>Clear all chains and tables, remove all chains, and accept all traffic<\/li>\n<\/ul>\n<h5 id=\"%d9%be%db%8c%d8%b4-%d9%86%db%8c%d8%a7%d8%b2%d9%87%d8%a7\">Prerequisites<\/h5>\n<p>This tutorial assumes that you are using a Linux server with the iptables command installed and that your user has sudo privileges. If you need help with this initial setup, please refer to the guide to initial server setup with Ubuntu 20.04.<\/p>\n<h2 id=\"%d9%81%d9%87%d8%b1%d8%b3%d8%aa-%d8%a8%d9%86%d8%af%db%8c-%d9%82%d9%88%d8%a7%d9%86%db%8c%d9%86-%d8%a8%d8%b1-%d8%a7%d8%b3%d8%a7%d8%b3-%d9%85%d8%b4%d8%ae%d8%b5%d8%a7%d8%aa\">Listing rules by specification<\/h2>\n<p>Let&#039;s first look at how to list rules. There are two different ways to view active iptables rules: in a table or as a list of rule specifications. Both methods provide roughly the same information in different formats.<\/p>\n<p>To list all active iptables rules by specification, run the iptables command with the -S option:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -S<\/code><\/pre>\n<\/div>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>Output\r\n-P INPUT DROP\r\n-P FORWARD DROP\r\n-P OUTPUT ACCEPT\r\n-N ICMP\r\n-N TCP\r\n-N UDP\r\n-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT\r\n-A INPUT -i lo -j ACCEPT\r\n-A INPUT -m conntrack --ctstate INVALID -j DROP\r\n-A INPUT -p udp -m conntrack --ctstate NEW -j UDP\r\n-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j TCP\r\n-A INPUT -p icmp -m conntrack --ctstate NEW -j ICMP\r\n-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable\r\n-A INPUT -p tcp -j REJECT --reject-with tcp-reset\r\n-A INPUT -j REJECT --reject-with icmp-proto-unreachable\r\n-A TCP -p tcp -m tcp --dport 22 -j ACCEPT\r\n...<\/code><\/pre>\n<\/div>\n<p>As you can see, the output is exactly like the commands used to create them, without the previous iptables command. If you have ever used iptables-persistent or iptables save, this will also be similar to the iptables rules configuration files.<\/p>\n<h2 id=\"%d9%81%d9%87%d8%b1%d8%b3%d8%aa-%da%a9%d8%b1%d8%af%d9%86-%db%8c%da%a9-%d8%b2%d9%86%d8%ac%db%8c%d8%b1%d9%87-%d8%ae%d8%a7%d8%b5\">Listing a specific chain<\/h2>\n<p>If you want to limit the output to a specific chain (INPUT, OUTPUT, TCP, etc.), you can specify the chain name directly after the option. <code>-S<\/code> For example, to show all the rules in the TCP chain, run this command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -S TCP<\/code><\/pre>\n<\/div>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>Output\r\n-N TCP\r\n-A TCP -p tcp -m tcp --dport 22 -j ACCEPT<\/code><\/pre>\n<\/div>\n<p>Now let&#039;s take a look at an alternative way to view active iptables rules, as a rules table.<\/p>\n<h2 id=\"%d9%81%d9%87%d8%b1%d8%b3%d8%aa-%da%a9%d8%b1%d8%af%d9%86-%d9%82%d9%88%d8%a7%d9%86%db%8c%d9%86-%d8%a8%d9%87-%d8%b5%d9%88%d8%b1%d8%aa-%d8%ac%d8%af%d8%a7%d9%88%d9%84\">List rules in tables<\/h2>\n<p>Listing iptables rules in a table view can be useful for comparing different rules with each other. To output all active iptables rules in a table, run the iptables command with the -L option:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -L<\/code><\/pre>\n<\/div>\n<p>This will generate all current rules sorted by chain.<\/p>\n<p>If you want to limit the output to a specific chain (INPUT, OUTPUT, TCP, etc.), you can specify the chain name directly after the -L option.<\/p>\n<p>Let&#039;s look at an input chain example:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -L INPUT<\/code><\/pre>\n<\/div>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>Output\r\nChain INPUT (policy DROP)\r\ntarget prot opt source destination\r\nACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED\r\nACCEPT all -- anywhere anywhere\r\nDROP all -- anywhere anywhere ctstate INVALID\r\nUDP udp -- anywhere anywhere ctstate NEW\r\nTCP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK\/SYN ctstate NEW\r\nICMP icmp -- anywhere anywhere ctstate NEW\r\nREJECT udp -- anywhere anywhere reject-with icmp-port-unreachable\r\nREJECT tcp -- anywhere anywhere reject-with tcp-reset\r\nREJECT all -- anywhere anywhere reject-with icmp-proto-unreachable<\/code><\/pre>\n<\/div>\n<p>The first line of output shows the name of the chain (INPUT in this case) followed by its default policy (DROP). The next line contains the headers for each column in the table, followed by the chain rules. Let&#039;s review what each header represents:<\/p>\n<ul>\n<li>target: If a packet matches a rule, the target specifies what to do with it. For example, a packet can be accepted, dropped, logged, or sent to another chain to be compared against more rules.<\/li>\n<li>prot: protocol, such as tcp, udp, icmp, or all<\/li>\n<li>opt: Rarely used, this column shows IP options<\/li>\n<li>source: The source IP address or subnet of the traffic or anywhere<\/li>\n<li>destination: The destination IP address or subnet of the traffic or anywhere<\/li>\n<\/ul>\n<p>The last column, which is not labeled, shows the options for a rule. This is any part of the rule that is not shown in the previous columns. This can be anything from the source and destination ports to the state of the packet connection.<\/p>\n<h2 id=\"%d9%86%d9%85%d8%a7%db%8c%d8%b4-%d8%aa%d8%b9%d8%af%d8%a7%d8%af-%d8%a8%d8%b3%d8%aa%d9%87-%d9%87%d8%a7-%d9%88-%d8%a7%d9%86%d8%af%d8%a7%d8%b2%d9%87-%da%a9%d9%84\">Display number of packages and total size<\/h2>\n<p>When listing iptables rules, it is possible to show the number of packets and the total size of the packets in bytes that match each particular rule. This is often useful when trying to get a general idea of which rules match which packets. To do this, use the -L and -v options together.<\/p>\n<p>For example, let&#039;s look again at the INPUT chain with the -v option:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -L INPUT -v<\/code><\/pre>\n<\/div>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>Output\r\nChain INPUT (policy DROP 0 packets, 0 bytes)\r\npkts bytes target prot opt in out source destination\r\n284K 42M ACCEPT all -- any any anywhere anywhere ctstate RELATED,ESTABLISHED\r\n0 0 ACCEPT all -- lo any anywhere anywhere\r\n0 0 DROP all -- any any anywhere anywhere ctstate INVALID\r\n396 63275 UDP udp -- any any anywhere anywhere ctstate NEW\r\n17067 1005K TCP tcp -- any any anywhere anywhere tcp flags:FIN,SYN,RST,ACK\/SYN ctstate NEW\r\n2410 154K ICMP icmp -- any any anywhere anywhere ctstate NEW\r\n396 63275 REJECT udp -- any any anywhere anywhere reject-with icmp-port-unreachable\r\n2916 179K REJECT all -- any any anywhere anywhere reject-with icmp-proto-unreachable\r\n0 0 ACCEPT tcp -- any any anywhere anywhere tcp dpt:ssh ctstate NEW,ESTABLISHED<\/code><\/pre>\n<\/div>\n<p>Notice that the list now has two additional columns, <code>pkts<\/code> and <code>bytes<\/code> It is.<\/p>\n<p>Now that you know how to list active firewall rules in different ways, let&#039;s see how you can reset the packet and byte counters.<\/p>\n<h2 id=\"%d8%aa%d9%86%d8%b8%db%8c%d9%85-%d9%85%d8%ac%d8%af%d8%af-%d8%aa%d8%b9%d8%af%d8%a7%d8%af-%d8%a8%d8%b3%d8%aa%d9%87-%d9%87%d8%a7-%d9%88-%d8%a7%d9%86%d8%af%d8%a7%d8%b2%d9%87-%da%a9%d9%84\">Reset the number of packets and total size<\/h2>\n<p>If you want to clear or zero the packet and byte counters for your rules, use the -Z option. They will also reset on reboot. This is useful if you want to see if your server is receiving new traffic that matches your existing rules.<\/p>\n<p>To clear the counters for all chains and rules, use the option <code>-Z<\/code> Use alone:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -Z<\/code><\/pre>\n<\/div>\n<p>To clear the counters for all rules in a specific chain, use the option <code>-Z<\/code> Use and specify the chain. For example, to clear chain counters <code>INPUT<\/code> Run this command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -Z INPUT<\/code><\/pre>\n<\/div>\n<p>If you want to clear the counters for a specific rule, specify the chain name and rule number. For example, to clear the counters for the first rule in the chain, <code>INPUT<\/code>, run this:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -Z INPUT 1<\/code><\/pre>\n<\/div>\n<p>Now that you know how to reset iptables packet and byte counters, let&#039;s take a look at two methods that can be used to remove them.<\/p>\n<h2 id=\"%d8%ad%d8%b0%d9%81-%d9%82%d9%88%d8%a7%d9%86%db%8c%d9%86-%d8%a8%d8%b1-%d8%a7%d8%b3%d8%a7%d8%b3-%d9%85%d8%b4%d8%ae%d8%b5%d8%a7%d8%aa\">Delete rules based on specifications<\/h2>\n<p>One way to remove iptables rules is to specify the rules. To do this, you can run the iptables command with the -D option followed by the rule specification. If you want to remove rules using this method, you can use the output of the rule list, iptables -S , for help.<\/p>\n<p>For example, if you want to remove a rule that drops invalid input packets (-A INPUT -m conntrack \u2013ctstate INVALID -j DROP), you can run this command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -D INPUT -m conntrack --ctstate INVALID -j DROP<\/code><\/pre>\n<\/div>\n<p>Note that the -A option, which is used to indicate the position of the rule at the time of creation, should be omitted here.<\/p>\n<h2 id=\"%d8%ad%d8%b0%d9%81-%d9%82%d9%88%d8%a7%d9%86%db%8c%d9%86-%d8%a8%d8%b1-%d8%a7%d8%b3%d8%a7%d8%b3-%d8%b2%d9%86%d8%ac%db%8c%d8%b1%d9%87-%d9%88-%d8%b4%d9%85%d8%a7%d8%b1%d9%87\">Delete rules based on chain and number<\/h2>\n<p>Another way to remove iptables rules is by chain and line number. To specify the line number of a rule, list the rules in table format and add the --line-numbers option:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -L --line-numbers<\/code><\/pre>\n<\/div>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>Output\r\nChain INPUT (policy DROP)\r\nnum target prot opt source destination\r\n1 ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED\r\n2 ACCEPT all -- anywhere anywhere\r\n3 DROP all -- anywhere anywhere ctstate INVALID\r\n4 UDP udp -- anywhere anywhere ctstate NEW\r\n5 TCP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,ACK\/SYN ctstate NEW\r\n6 ICMP icmp -- anywhere anywhere ctstate NEW\r\n7 REJECT udp -- anywhere anywhere reject-with icmp-port-unreachable\r\n8 REJECT tcp -- anywhere anywhere reject-with tcp-reset\r\n9 REJECT all -- anywhere anywhere reject-with icmp-proto-unreachable\r\n10 ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ctstate NEW,ESTABLISHED<\/code><\/pre>\n<\/div>\n<p>This adds a line number to each rule line that is associated with the header. <code>number<\/code> It is shown.<\/p>\n<p>Once you know which rule you want to remove, note down the chain number and rule line. Then run the command iptables -D followed by the chain number and rule.<\/p>\n<p>For example, if we want to remove the inbound rule that drops invalid packets, we see that rule 3 is in the INPUT chain. So we need to run this command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\">sudo iptables -D INPUT 3<\/pre>\n<\/div>\n<p>Now that you know how to delete firewall rules, let&#039;s look at how to clear rule chains.<\/p>\n<h2 id=\"%d9%81%d9%84%d8%a7%d8%b4-%da%a9%d8%b1%d8%af%d9%86-%d8%b2%d9%86%d8%ac%db%8c%d8%b1%d9%87-%d9%87%d8%a7\">Flashing the chains<\/h2>\n<p>Iptables provides a way to remove all rules in a chain, or flush a chain. In this section we will cover a variety of ways to do this.<\/p>\n<h5 id=\"%d9%81%d9%84%d8%a7%d8%b4%db%8c%d9%86%da%af-%db%8c%da%a9-%d8%b2%d9%86%d8%ac%db%8c%d8%b1%d9%87\">Flushing a chain<\/h5>\n<p>To flush a specific chain, which removes all rules in the chain, you can use the -F or equivalent -flush option and the chain name to flush.<\/p>\n<p>For example, to delete all rules in the chain <code>INPUT<\/code>, run this command:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -F INPUT<\/code><\/pre>\n<\/div>\n<p>Flashing all chains<\/p>\n<p>To flush all chains, which removes all firewall rules, you can use the -F option or its equivalent -flush alone:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -F<\/code><\/pre>\n<\/div>\n<h2 id=\"%d9%81%d9%84%d8%a7%d8%b4-%d9%87%d9%85%d9%87-%d9%82%d9%88%d8%a7%d9%86%db%8c%d9%86%d8%8c-%d8%ad%d8%b0%d9%81-%d9%87%d9%85%d9%87-%d8%b2%d9%86%d8%ac%db%8c%d8%b1%d9%87%d9%87%d8%a7-%d9%88-%d9%be\">Flush all rules, remove all chains, and accept all<\/h2>\n<p>This section shows you how to clear all your firewall rules, tables, and chains and allow all network traffic.<\/p>\n<p>First, set the default policies for each of the internal chains to ACCEPT. The main reason for doing this is to ensure that you don&#039;t get locked out of your server via SSH:<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -P INPUT ACCEPT\r\nsudo iptables -P FORWARD ACCEPT\r\nsudo iptables -P OUTPUT ACCEPT<\/code><\/pre>\n<\/div>\n<p>Then flush the nat and mangle tables, clear all chains (-F), and remove all non-default chains (-X):<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>sudo iptables -t nat -F\r\nsudo iptables -t mangle -F\r\nsudo iptables -F\r\nsudo iptables -X<\/code><\/pre>\n<\/div>\n<p>Your firewall will now allow all network traffic. If you now list your rules, you will see that there are none, leaving only the three default chains (INPUT, FORWARD, and OUTPUT).<\/p>\n<h2 id=\"%d9%86%d8%aa%db%8c%d8%ac%d9%87\">Result<\/h2>\n<p>After going through this tutorial, you have seen how to list and delete your iptables firewall rules. Remember that any iptables changes made via the iptables command are transient and must be saved to persist across server reboots. This is covered in the Saving Rules section of the Common Firewall Rules and Commands tutorial.<\/p>","protected":false},"excerpt":{"rendered":"Introduction Iptables is a firewall that plays a fundamental role in network security for most Linux systems.","protected":false},"author":1,"featured_media":14685,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"\u0641\u0647\u0631\u0633\u062a \u06a9\u0631\u062f\u0646 \u0648 \u062d\u0630\u0641 \u0642\u0648\u0627\u0646\u06cc\u0646 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 Iptables","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_canonical":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_opengraph-image":"","_yoast_wpseo_twitter-description":"","_yoast_wpseo_twitter-image":"","_yoast_wpseo_focuskeywords":"","_yoast_wpseo_primary_category":"193","footnotes":""},"categories":[193,323],"tags":[385],"class_list":{"0":"post-14684","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorials","8":"category-firewall","9":"tag-385"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u0646\u062d\u0648\u0647 \u0641\u0647\u0631\u0633\u062a \u06a9\u0631\u062f\u0646 \u0648 \u062d\u0630\u0641 \u0642\u0648\u0627\u0646\u06cc\u0646 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 Iptables - \u0628\u0644\u0627\u06af ITPiran<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0646\u062d\u0648\u0647 \u0641\u0647\u0631\u0633\u062a \u06a9\u0631\u062f\u0646 \u0648 \u062d\u0630\u0641 \u0642\u0648\u0627\u0646\u06cc\u0646 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 Iptables - \u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"og:description\" content=\"\u0645\u0642\u062f\u0645\u0647 Iptables \u06cc\u06a9 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 \u0627\u0633\u062a \u06a9\u0647 \u0646\u0642\u0634 \u0627\u0633\u0627\u0633\u06cc \u062f\u0631 \u0627\u0645\u0646\u06cc\u062a \u0634\u0628\u06a9\u0647 \u0628\u0631\u0627\u06cc \u0627\u06a9\u062b\u0631 \u0633\u06cc\u0633\u062a\u0645 \u0647\u0627\u06cc \u0644\u06cc\u0646\u0648\u06a9\u0633 \u0627\u06cc\u0641\u0627 \u0645\u06cc&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-04T10:40:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.itpiran.net\/2024\/02\/04140218\/IptablesBG.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1793\" \/>\n\t<meta property=\"og:image:height\" content=\"1110\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\"},\"headline\":\"\u0646\u062d\u0648\u0647 \u0641\u0647\u0631\u0633\u062a \u06a9\u0631\u062f\u0646 \u0648 \u062d\u0630\u0641 \u0642\u0648\u0627\u0646\u06cc\u0646 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 Iptables\",\"datePublished\":\"2024-02-04T10:40:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/\"},\"wordCount\":93,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/02\\\/04140218\\\/IptablesBG.jpg\",\"keywords\":[\"\u0641\u0627\u06cc\u0631\u0648\u0627\u0644\"],\"articleSection\":[\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"\u0641\u0627\u06cc\u0631\u0648\u0627\u0644\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/\",\"name\":\"\u0646\u062d\u0648\u0647 \u0641\u0647\u0631\u0633\u062a \u06a9\u0631\u062f\u0646 \u0648 \u062d\u0630\u0641 \u0642\u0648\u0627\u0646\u06cc\u0646 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 Iptables - \u0628\u0644\u0627\u06af ITPiran\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/02\\\/04140218\\\/IptablesBG.jpg\",\"datePublished\":\"2024-02-04T10:40:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/02\\\/04140218\\\/IptablesBG.jpg\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/02\\\/04140218\\\/IptablesBG.jpg\",\"width\":1793,\"height\":1110},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/how-to-list-and-delete-iptables-firewall-rules\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/category\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0646\u062d\u0648\u0647 \u0641\u0647\u0631\u0633\u062a \u06a9\u0631\u062f\u0646 \u0648 \u062d\u0630\u0641 \u0642\u0648\u0627\u0646\u06cc\u0646 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 Iptables\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"name\":\"\u0628\u0644\u0627\u06af ITPiran\",\"description\":\"\u0627\u062e\u0628\u0627\u0631 \u0648 \u0645\u0642\u0627\u0644\u0627\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\",\"name\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"alternateName\":\"ITPIran Blog\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"width\":512,\"height\":512,\"caption\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\",\"name\":\"admin\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/en\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to List and Delete Iptables Firewall Rules - ITPiran Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/","og_locale":"en_US","og_type":"article","og_title":"\u0646\u062d\u0648\u0647 \u0641\u0647\u0631\u0633\u062a \u06a9\u0631\u062f\u0646 \u0648 \u062d\u0630\u0641 \u0642\u0648\u0627\u0646\u06cc\u0646 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 Iptables - \u0628\u0644\u0627\u06af ITPiran","og_description":"\u0645\u0642\u062f\u0645\u0647 Iptables \u06cc\u06a9 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 \u0627\u0633\u062a \u06a9\u0647 \u0646\u0642\u0634 \u0627\u0633\u0627\u0633\u06cc \u062f\u0631 \u0627\u0645\u0646\u06cc\u062a \u0634\u0628\u06a9\u0647 \u0628\u0631\u0627\u06cc \u0627\u06a9\u062b\u0631 \u0633\u06cc\u0633\u062a\u0645 \u0647\u0627\u06cc \u0644\u06cc\u0646\u0648\u06a9\u0633 \u0627\u06cc\u0641\u0627 \u0645\u06cc&hellip;","og_url":"https:\/\/www.itpiran.net\/blog\/en\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/","og_site_name":"\u0628\u0644\u0627\u06af ITPiran","article_published_time":"2024-02-04T10:40:03+00:00","og_image":[{"width":1793,"height":1110,"url":"https:\/\/cdn.itpiran.net\/2024\/02\/04140218\/IptablesBG.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/#article","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/"},"author":{"name":"admin","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81"},"headline":"\u0646\u062d\u0648\u0647 \u0641\u0647\u0631\u0633\u062a \u06a9\u0631\u062f\u0646 \u0648 \u062d\u0630\u0641 \u0642\u0648\u0627\u0646\u06cc\u0646 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 Iptables","datePublished":"2024-02-04T10:40:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/"},"wordCount":93,"commentCount":0,"publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/02\/04140218\/IptablesBG.jpg","keywords":["\u0641\u0627\u06cc\u0631\u0648\u0627\u0644"],"articleSection":["\u0622\u0645\u0648\u0632\u0634\u06cc","\u0641\u0627\u06cc\u0631\u0648\u0627\u0644"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/","url":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/","name":"How to List and Delete Iptables Firewall Rules - ITPiran Blog","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/#primaryimage"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/02\/04140218\/IptablesBG.jpg","datePublished":"2024-02-04T10:40:03+00:00","breadcrumb":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/#primaryimage","url":"https:\/\/cdn.itpiran.net\/2024\/02\/04140218\/IptablesBG.jpg","contentUrl":"https:\/\/cdn.itpiran.net\/2024\/02\/04140218\/IptablesBG.jpg","width":1793,"height":1110},{"@type":"BreadcrumbList","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/how-to-list-and-delete-iptables-firewall-rules\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.itpiran.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0622\u0645\u0648\u0632\u0634\u06cc","item":"https:\/\/www.itpiran.net\/blog\/category\/tutorials\/"},{"@type":"ListItem","position":3,"name":"\u0646\u062d\u0648\u0647 \u0641\u0647\u0631\u0633\u062a \u06a9\u0631\u062f\u0646 \u0648 \u062d\u0630\u0641 \u0642\u0648\u0627\u0646\u06cc\u0646 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 Iptables"}]},{"@type":"WebSite","@id":"https:\/\/www.itpiran.net\/blog\/#website","url":"https:\/\/www.itpiran.net\/blog\/","name":"ITPiran Blog","description":"Iranian Sustainable Trade News and Articles","publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.itpiran.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.itpiran.net\/blog\/#organization","name":"Sustainable Iranian Business Blog","alternateName":"ITPIran Blog","url":"https:\/\/www.itpiran.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","contentUrl":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","width":512,"height":512,"caption":"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81","name":"admin","url":"https:\/\/www.itpiran.net\/blog\/en\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts\/14684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/comments?post=14684"}],"version-history":[{"count":1,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts\/14684\/revisions"}],"predecessor-version":[{"id":14687,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/posts\/14684\/revisions\/14687"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/media\/14685"}],"wp:attachment":[{"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/media?parent=14684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/categories?post=14684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/en\/wp-json\/wp\/v2\/tags?post=14684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}