{"id":27118,"date":"2018-06-11T06:01:34","date_gmt":"2018-06-11T11:01:34","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=27118"},"modified":"2022-06-03T03:34:56","modified_gmt":"2022-06-03T08:34:56","slug":"common-firewall-rules-and-commands-in-iptables","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/","title":{"rendered":"Common Firewall Rules and Commands in iptables"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p><img decoding=\"async\" class=\"alignnone size-full wp-image-27129\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables.jpg\" alt=\"Common Firewall Rules and Commands in iptables\" width=\"742\" height=\"371\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables-150x75.jpg 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables-300x150.jpg 300w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/p>\n<p>Today we are going to show you some common firewall rules and commands in iptables. Iptables is a useful command line utility for configuring Linux kernel firewall. Iptables contains five tables: raw, filter, nat, mangle and security. Each table consist of chains. A chain is a list of firewall rules which are followed in order. Let&#8217;s get started with some common firewall rules and commands in iptables.<br \/>\n<!--more--><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69ce709e09ef6\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69ce709e09ef6\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#Install-iptables\" >Install iptables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#Common-firewall-rules-in-iptables\" >Common firewall rules in iptables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#Common-iptables-commands\" >Common iptables commands<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Install-iptables\"><\/span>Install iptables<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Log in to your VPS via SSH as user root:<\/p>\n<pre>ssh root@IP_Address -p Port_number<\/pre>\n<p>Installing iptables is very easy. If you have an <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting.html\" target=\"_blank\" rel=\"noopener noreferrer\">Ubuntu VPS<\/a> or a <a href=\"https:\/\/www.rosehosting.com\/debian-hosting.html\" target=\"_blank\" rel=\"noopener noreferrer\">Debian VPS<\/a>, run the following commands:<\/p>\n<pre>apt-get update \r\napt-get upgrade\r\napt-get install iptables iptables-persistent<\/pre>\n<p>If there is CentOS or Fedora installed on your VPS, run the following commands:<\/p>\n<pre>yum clean all\r\nyum update\r\nyum install iptables<\/pre>\n<p>That&#8217;s it, now you should have successfully installed iptables on your server.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Common-firewall-rules-in-iptables\"><\/span>Common firewall rules in iptables<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Listed below are examples about common firewall rules.<br \/>\nAccept all ESTABLISHED and RELATED packets:<\/p>\n<pre>iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<\/pre>\n<p>Allow HTTP and HTTPS connections from anywhere:<\/p>\n<pre>iptables -A INPUT -p tcp --dport 80 -j ACCEPT\r\niptables -A INPUT -p tcp --dport 443 -j ACCEPT<\/pre>\n<p>Allow access on port 21 from a specific IP address only (e.g. 192.168.1.111) and block access from all other IPs to the server (e.g. server IP 192.168.1.100) :<\/p>\n<pre>iptables -A INPUT -s 192.168.1.111 -d 192.168.1.100 -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT\r\niptables -A INPUT -d 192.168.1.100 -p tcp -m tcp --dport 21 -j DROP\r\niptables-save<\/pre>\n<p>Block an IP address (e.g. 192.168.1.19):<\/p>\n<pre>iptables -A INPUT -s 192.168.1.19 -j DROP<\/pre>\n<p>Block an IP range and reject all packets (e.g. 192.168.1.0\/24):<\/p>\n<pre>iptables -A INPUT -s 192.168.1.0\/24 -j REJECT<\/pre>\n<p>To block outgoing traffic to a port, (e.g. port 123), use:<\/p>\n<pre>iptables -A OUTPUT -p tcp --dport 123 -j DROP<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Common-iptables-commands\"><\/span>Common iptables commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>List all rules in all chains in verbose mode and display the IP addresses and port numbers instead host names and services, including the interface name, the rule options (if any), and the TOS masks:<\/p>\n<pre>iptables -nvL | less<\/pre>\n<pre>Chain INPUT (policy ACCEPT 17M packets, 3161M bytes)\r\n pkts bytes target     prot opt in     out     source               destination\r\n  90M   18G cP-Firewall-1-INPUT  all  --  *      *       0.0.0.0\/0            0.0.0.0\/0\r\n\r\nChain FORWARD (policy ACCEPT 0 packets, 0 bytes)\r\n pkts bytes target     prot opt in     out     source               destination\r\n    0     0 cP-Firewall-1-INPUT  all  --  *      *       0.0.0.0\/0            0.0.0.0\/0\r\n\r\nChain OUTPUT (policy ACCEPT 16M packets, 5107M bytes)\r\n pkts bytes target     prot opt in     out     source               destination\r\n    0     0 ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           multiport dports 25,465,587 owner GID match 32006\r\n18618 9100K ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           multiport dports 25,465,587 owner GID match 12\r\n    0     0 ACCEPT     tcp  --  *      *       0.0.0.0\/0            127.0.0.1           multiport dports 25,465,587 owner UID match 32001\r\n10686  946K ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           multiport dports 25,465,587 owner UID match 0\r\n\r\nChain cP-Firewall-1-INPUT (2 references)\r\n pkts bytes target     prot opt in     out     source               destination\r\n   39  2264 ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:993\r\n   54  2872 ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:53\r\n 7509  450K ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:21\r\n 557K   34M ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:443\r\n19655 1142K ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:80\r\n 1057 43388 ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:8080\r\n 7533  452K ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:143\r\n  382 16664 ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:22\r\n2871K  173M ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:995\r\n23539 1284K ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:110\r\n 8353  500K ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:25\r\n   71  3680 ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:465\r\n 519K   31M ACCEPT     tcp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:3306\r\n  132  9948 ACCEPT     udp  --  *      *       0.0.0.0\/0            0.0.0.0\/0           state NEW udp dpt:53\r\n<\/pre>\n<p>To display rules in chains with rule numbers, use:<\/p>\n<pre>iptables -nvL --line-numbers<\/pre>\n<p>This is useful if you want to delete a rule (e.g. delete rule number 9 from the INPUT chain):<\/p>\n<pre>iptables -D INPUT 9<\/pre>\n<p>Or, add a rule between two existing rules (e.g. add a firewall rule between rules number 2 and 3):<\/p>\n<pre>iptables -I OUTPUT 3 -d 127.0.0.1\/32 -p tcp -m multiport --dports 25,465,587 -m owner --uid-owner 201 -j ACCEPT<\/pre>\n<p>In order to list all commands that were used to create the currently used iptables rules, use the following command:<\/p>\n<pre>iptables -S<\/pre>\n<p>This command is useful if you need to edit or delete some firewall rules.<\/p>\n<pre>-P INPUT ACCEPT\r\n-P FORWARD ACCEPT\r\n-P OUTPUT ACCEPT\r\n-N cP-Firewall-1-INPUT\r\n-A INPUT -j cP-Firewall-1-INPUT\r\n-A FORWARD -j cP-Firewall-1-INPUT\r\n-A OUTPUT -p tcp -m multiport --dports 25,465,587 -m owner --gid-owner mailman -j ACCEPT\r\n-A OUTPUT -p tcp -m multiport --dports 25,465,587 -m owner --gid-owner mail -j ACCEPT\r\n-A OUTPUT -d 127.0.0.1\/32 -p tcp -m multiport --dports 25,465,587 -m owner --uid-owner cpanel -j ACCEPT\r\n-A OUTPUT -p tcp -m multiport --dports 25,465,587 -m owner --uid-owner root -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 993 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 143 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 995 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 110 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 465 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT\r\n-A cP-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT\r\n<\/pre>\n<p>Clear all firewall rules:<\/p>\n<pre>iptables -F<\/pre>\n<p>Use &#8216;iptables -h | less&#8217; for more information on all iptables command options.<\/p>\n<hr \/>\n<p><img decoding=\"async\" class=\"alignleft size-full wp-image-27130\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Firewall-Rules-and-Commands-in-iptables.jpg\" alt=\"Common Firewall Rules and Commands in iptables\" width=\"180\" height=\"180\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Firewall-Rules-and-Commands-in-iptables.jpg 180w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Firewall-Rules-and-Commands-in-iptables-150x150.jpg 150w\" sizes=\"(max-width: 180px) 100vw, 180px\" \/>Of course, you don\u2019t have to install iptables and create firewall rules on your VPS, if you use one of our <a href=\"https:\/\/www.rosehosting.com\/vps-hosting.html\">VPS Hosting<\/a> solutions, in which case you can simply ask our expert Linux admins to install iptables and configure firewall rules on your VPS. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n<p><span style=\"color: #ff0000;\"><strong>PS<\/strong><\/span>. If you liked this post about common firewall rules and commands in iptables, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we are going to show you some common firewall rules and commands in iptables. Iptables is a useful command &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Common Firewall Rules and Commands in iptables\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#more-27118\" aria-label=\"Read more about Common Firewall Rules and Commands in iptables\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":27129,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1703],"tags":[147,281],"class_list":["post-27118","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","tag-firewall","tag-iptables","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Common Firewall Rules and Commands in iptables | RoseHosting<\/title>\n<meta name=\"description\" content=\"Common Firewall Rules and Commands in iptables | RoseHosting\" \/>\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.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Common Firewall Rules and Commands in iptables\" \/>\n<meta property=\"og:description\" content=\"Common Firewall Rules and Commands in iptables | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-11T11:01:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-03T08:34:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"371\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"Common Firewall Rules and Commands in iptables\",\"datePublished\":\"2018-06-11T11:01:34+00:00\",\"dateModified\":\"2022-06-03T08:34:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/\"},\"wordCount\":440,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/Common-Firewall-Rules-and-Commands-in-iptables.jpg\",\"keywords\":[\"firewall\",\"iptables\"],\"articleSection\":[\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/\",\"name\":\"Common Firewall Rules and Commands in iptables | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/Common-Firewall-Rules-and-Commands-in-iptables.jpg\",\"datePublished\":\"2018-06-11T11:01:34+00:00\",\"dateModified\":\"2022-06-03T08:34:56+00:00\",\"description\":\"Common Firewall Rules and Commands in iptables | RoseHosting\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/Common-Firewall-Rules-and-Commands-in-iptables.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/06\\\/Common-Firewall-Rules-and-Commands-in-iptables.jpg\",\"width\":742,\"height\":371,\"caption\":\"Common Firewall Rules and Commands in iptables\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/common-firewall-rules-and-commands-in-iptables\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Common Firewall Rules and Commands in iptables\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Common Firewall Rules and Commands in iptables | RoseHosting","description":"Common Firewall Rules and Commands in iptables | RoseHosting","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.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/","og_locale":"en_US","og_type":"article","og_title":"Common Firewall Rules and Commands in iptables","og_description":"Common Firewall Rules and Commands in iptables | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2018-06-11T11:01:34+00:00","article_modified_time":"2022-06-03T08:34:56+00:00","og_image":[{"width":742,"height":371,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables.jpg","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"Common Firewall Rules and Commands in iptables","datePublished":"2018-06-11T11:01:34+00:00","dateModified":"2022-06-03T08:34:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/"},"wordCount":440,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables.jpg","keywords":["firewall","iptables"],"articleSection":["Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/","url":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/","name":"Common Firewall Rules and Commands in iptables | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables.jpg","datePublished":"2018-06-11T11:01:34+00:00","dateModified":"2022-06-03T08:34:56+00:00","description":"Common Firewall Rules and Commands in iptables | RoseHosting","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/06\/Common-Firewall-Rules-and-Commands-in-iptables.jpg","width":742,"height":371,"caption":"Common Firewall Rules and Commands in iptables"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/common-firewall-rules-and-commands-in-iptables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Common Firewall Rules and Commands in iptables"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/27118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=27118"}],"version-history":[{"count":1,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/27118\/revisions"}],"predecessor-version":[{"id":41796,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/27118\/revisions\/41796"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/27129"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=27118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=27118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=27118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}