{"id":19821,"date":"2017-12-19T12:33:20","date_gmt":"2017-12-19T12:33:20","guid":{"rendered":"https:\/\/blog.resellerclub.com\/?p=19821"},"modified":"2026-05-22T13:12:37","modified_gmt":"2026-05-22T13:12:37","slug":"a-step-by-step-guide-on-how-to-configure-firewall-in-linux","status":"publish","type":"post","link":"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/","title":{"rendered":"A Step-By-Step Guide on How to Configure a Firewall in Linux"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">So before we start with the steps involved to configure a firewall in Linux, first let\u2019s make sure we understand what a firewall is and how it works.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-19823 size-full\" src=\"\/blog\/wp-content\/uploads\/2017\/12\/firewall1.png\" alt=\"configure firewall in Linux\" width=\"691\" height=\"387\"><\/p>\n<h3><b>Understanding what a firewall is and how it works:<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">A firewall is a program that surrounds the interface between a private network and the rest of the big and (usually) bad internet. You can think of the firewall as a gateway. It follows pre-configured rules that allow certain traffic to pass through from the internet to the private network and blocks those that are unwanted and potentially harmful.<\/span><\/p>\n<h3><b>Why do I need to configure a firewall for my Linux machine? Isn\u2019t it the safer than most other server OSs?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">If you have a Linux machine, you <\/span><i><span style=\"font-weight: 400;\">are <\/span><\/i><span style=\"font-weight: 400;\">guaranteed a certain level of security by default, courtesy the amazing Linux developer community. Linux systems are generally immune to a majority of viruses and other threats that many other operating systems succumb to. But with the increase in the volume, variety and intensity of cyber threats today, configuring a Linux firewall is quite a necessity.<\/span><\/p>\n<\/p>\n<p><b>A step-by-step guide on how to configure firewall in Linux:<\/b><\/p>\n<p><b>Step 1 : Beef-up basic Linux security:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">While this blog is titled to address firewall configuration, the first step is to ensure that the firewall has all the support it needs with a 100% secure Linux machine. To do this, ensure you have all the latest security updates installed for your version of Linux.<\/span><\/p>\n<p><b>Step 2: Decide how you want to protect your server:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">While Iptables is generally where the linux community looks to configure a firewall, there are easier options available that are also free for use. Here are some that we would recommend:<\/span><\/p>\n<p><b>1.<\/b><a href=\"https:\/\/www.clearos.com\/\"><b>ClearOS<\/b><\/a><b>:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">-ClearOS is extremely easy-to-use. It is suitable those who prefer an easy-to-follow UI AND also for geeks who would like to talk to it through the command-line interface<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Post a 10-minute installation time, you are asked to reboot and are given all the information and support &nbsp;required to manage your firewall as easily as possible<\/span><\/p>\n<p><b>2.<\/b><a href=\"https:\/\/opnsense.org\/\"><b>OPNsense<\/b><\/a><b>:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">-OPNsense offers several advanced features not usually found in free firewalls like \u2018forward caching proxy\u2019 and \u2018intrusion detection\u2019. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">-It supports the use of OpenVPN. To know how useful OpenVPN is, read more <\/span><a href=\"https:\/\/openvpn.net\/index.php\/open-source\/333-what-is-openvpn.html\"><span style=\"font-weight: 400;\">here<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">-It uses an Inline Intrusion Prevention System which is a powerful form of Deep Packet Inspection. Here, instead of just blocking an IP address or port, the firewall inspects individual data packets or connections and stops them before they reach the sender if found malicious<\/span><\/p>\n<p><b>3.<a href=\"https:\/\/configserver.com\/cp\/csf.html\">ConfigServer Firewall (CSF)<\/a><\/b><b>:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">-CSF is an advanced firewall suite for Linux systems has the Login Failure Daemon (LFD) process that regularly scans for failed login attempts (or \u201cBrute-force attacks\u201d) on your Server and takes action against the offending IP Addresses very quickly<\/span><\/p>\n<p><span style=\"font-weight: 400;\">-CSF can be managed through the Command Line Interface and its front-end is accessible by the root account through cPanel, DirectAdmin and Webmin which makes configuring and managing the firewall very simple<\/span><\/p>\n<\/p>\n<p><b>IPTABLES:<\/b><\/p>\n<p><b>Understand Iptables and how it works:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The Linux kernel has the capacity to filter incoming and outgoing packages with a filtering tool known as \u2018Iptables\u2019. The Iptables tool is in charge of deciding which packages can come in and go out based on the rules it is configured to follow.<\/span><\/p>\n<p><b>First, how to configure the firewall manually:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Working with iptables manually can be complicated. We have a quick fix at the bottom of our section you can try. Read on for more.<\/span><\/p>\n<p><b>Step 1: Retrieve the Iptables firewall:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Iptables is pre-installed on almost every Linux distribution. You can use this command to retrieve the package:<\/span><\/p>\n<p style=\"text-align: center;\"><b>sudo apt-get install iptables<\/b><\/p>\n<p><b>Step 2: Discover what Iptables is already configured to do by default:<\/b><\/p>\n<p style=\"text-align: center;\"><strong>Run the iptable L command<\/strong><\/p>\n<p><b>Step 3: You can decide to modify the existing rules or instead start afresh:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">To start afresh, run this command <\/span><\/p>\n<p style=\"text-align: center;\"><b>iptables-F<\/b><\/p>\n<p><b>Step 4: Decide which firewall ports to close:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">First block all lines of attack by running the following commands:<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">&nbsp;Block XMAS Packets: <\/span><b>iptables -A INPUT -p tcp \u2013tcp-flags ALL ALL -j DROP<\/b><\/p>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">Block null packets: <\/span><b>iptables -A INPUT -p tcp \u2013tcp-flags ALL NONE -j DROP<\/b><\/p>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">Block syn-flood packets:<\/span><b> iptables -A INPUT -p tcp ! \u2013syn -m state \u2013state NEW -j DROP <\/b><\/p>\n<p><b>Step 5: Decide which firewall ports to leave open:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Here are some ports you could decide to leave open:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For outgoing connections:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">80\/tcp for HTTP<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">53\/udp for DNS<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">443\/tcp for HTTPS (secured HTTP)<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">21\/tcp for FTP (File Transfer Protocol)<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">465\/tcp for SMTP (send emails)<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">25\/tcp for Insecure SMTP<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">22\/tcp for SSH (secure connection from computer to computer)<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">993\/tcp&amp;udp for IMAP (receive emails)<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">143\/tcp&amp;udp for Insecure IMAP<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">9418\/tcp for GIT (version control system)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">For Incoming connections:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">993\/tcp&amp;udp for IMAP (receive emails)<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">143\/tcp&amp;udp for Insecure IMAP<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">110\/tcp for POP3 (old way to receive emails)<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">22\/tcp for SSH (secure connection from computer to computer)<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">9418\/tcp for GIT (version control system)<\/span><\/li>\n<\/ul>\n<p><b>Step 6: Save your firewall configuration<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Type the following command to save the settings you\u2019ve configured and restart your firewall:<\/span><\/p>\n<p style=\"text-align: center;\"><b>iptables -L -n<\/b><\/p>\n<p style=\"text-align: center;\"><b>iptables-save | sudo tee \/etc\/sysconfig\/iptables<\/b><\/p>\n<p style=\"text-align: center;\"><b>service iptables restart<\/b><\/p>\n<\/p>\n<p><b>Tools to assist you with the iptables configuration:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">If this is too complicated for you, you can use tools such as <\/span><a href=\"http:\/\/www.fwbuilder.org\/\"><span style=\"font-weight: 400;\">fwbuilder<\/span><\/a><span style=\"font-weight: 400;\"> or <\/span><a href=\"https:\/\/launchpad.net\/ufw\"><span style=\"font-weight: 400;\">UFW<\/span><\/a><span style=\"font-weight: 400;\">. Here, we will run you through the UFW Uncomplicated Firewall. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The UFW is a front-end for iptables that makes configuring the firewall easier while working with iptables. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Step 1: Type this command into the terminal to install UFW: <\/span><\/p>\n<p style=\"text-align: center;\"><b># apt-get install ufw<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Step 2: Next, enable the firewall:<\/span><\/p>\n<p style=\"text-align: center;\"><b># ufw enable<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Step 3: enable the default settings.<\/span><\/p>\n<p style=\"text-align: center;\"><b># ufw default deny incoming<\/b><b><br \/><\/b><b># ufw default allow outgoing<\/b><\/p>\n<p><span style=\"font-weight: 400;\">This will deny all incoming connections. To specify which ones to allow &#8211; do the following:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Step 4: To allow specific connections. For example, SSH-<\/span><\/p>\n<p style=\"text-align: center;\"><b># ufw allow ssh<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Step 5: ensure the firewall is saved:<\/span><\/p>\n<p style=\"text-align: center;\"><b># ufw status verbose<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Rules may be deleted with the following command:<\/span><\/li>\n<\/ul>\n<p style=\"text-align: center;\"><b># ufw delete allow ssh<\/b><\/p>\n<p><span style=\"font-weight: 400;\">There! Hope we\u2019ve made this process an easy-to-follow guide for you to configure firewall in Linux.<\/span><\/p>\n<p>Here is a quick step by step video guide in under 5 minutes,<\/p>\n<p><\/p>\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\">\n<div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" width=\"770\" height=\"433\" src=\"https:\/\/www.youtube.com\/embed\/XEKV_LcIZrc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div>\n<\/figure>\n<p><\/p>\n<h2>Reseller Club Hosting Services<\/h2>\n<p><a href=\"https:\/\/www.resellerclub.com\/reseller-hosting\">Reseller Hosting<\/a> | <a href=\"https:\/\/www.resellerclub.com\/windows-reseller-hosting\">Windows Reseller Hosting<\/a> | <a href=\"https:\/\/www.resellerclub.com\/cloud-hosting\">Cloud Hosting<\/a> | <a href=\"https:\/\/www.resellerclub.com\/vps-hosting\">VPS Hosting<\/a> | <a href=\"https:\/\/www.resellerclub.com\/managed-vps-hosting\">Managed VPS Hosting<\/a> | <a href=\"https:\/\/www.resellerclub.com\/dedicated-server-hosting\">Dedicated Server Hosting<\/a> | <a href=\"https:\/\/www.resellerclub.com\/windows-dedicated-server-hosting\">Windows Dedicated Server<\/a> | <a href=\"https:\/\/www.resellerclub.com\/managed-dedicated-server-hosting\">Managed Dedicated Server<\/a> | <a href=\"https:\/\/www.resellerclub.com\/shared-hosting\">Linux Shared Hosting<\/a> | <a href=\"https:\/\/www.resellerclub.com\/windows-shared-hosting\">Windows Shared Hosting<\/a><\/p>\n<div class=\"fb-background-color\">\n\t\t\t  <div \n\t\t\t  \tclass = \"fb-comments\" \n\t\t\t  \tdata-href = \"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/\"\n\t\t\t  \tdata-numposts = \"10\"\n\t\t\t  \tdata-lazy = \"true\"\n\t\t\t\tdata-colorscheme = \"light\"\n\t\t\t\tdata-order-by = \"social\"\n\t\t\t\tdata-mobile=true>\n\t\t\t  <\/div><\/div>\n\t\t  <style>\n\t\t    .fb-background-color {\n\t\t\t\tbackground:  !important;\n\t\t\t}\n\t\t\t.fb_iframe_widget_fluid_desktop iframe {\n\t\t\t    width: 100% !important;\n\t\t\t}\n\t\t  <\/style>\n\t\t  ","protected":false},"excerpt":{"rendered":"<p>So before we start with the steps involved to configure a firewall in Linux, first let\u2019s make sure we understand what a firewall is and how it works. Understanding what a firewall is and how it works: A firewall is a program that surrounds the interface between a private network and the rest of the<\/p>\n","protected":false},"author":53,"featured_media":29831,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_rc_manual_related_posts":[],"footnotes":""},"categories":[1531,6681,1533,1523,995],"tags":[712,281],"hashtags":[],"class_list":{"0":"post-19821","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-smb","8":"category-popular","9":"category-tech","10":"category-development","11":"category-hosting","12":"tag-firewall","13":"tag-linux"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A Guide On How to Configure a Firewall in Linux<\/title>\n<meta name=\"description\" content=\"Configure firewall in Linux with our step-by-step guide. Learn iptables, UFW, and security best practices to protect your server from unauthorized access.\" \/>\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.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Guide On How to Configure a Firewall in Linux\" \/>\n<meta property=\"og:description\" content=\"Configure firewall in Linux with our step-by-step guide. Learn iptables, UFW, and security best practices to protect your server from unauthorized access.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"ResellerClub Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/profile.php?id=100005889763273\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-19T12:33:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-22T13:12:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.resellerclub.com\/blog\/wp-content\/uploads\/2017\/12\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tanya Noronha\" \/>\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\":\"WebSite\",\"@id\":\"https:\/\/www.resellerclub.com\/blog\/#website\",\"url\":\"https:\/\/www.resellerclub.com\/blog\/\",\"name\":\"ResellerClub Blog\",\"description\":\"Web Hosting &amp; Domains\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.resellerclub.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.resellerclub.com\/blog\/wp-content\/uploads\/2017\/12\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux-2.jpg\",\"contentUrl\":\"https:\/\/www.resellerclub.com\/blog\/wp-content\/uploads\/2017\/12\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux-2.jpg\",\"width\":1200,\"height\":800},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#webpage\",\"url\":\"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/\",\"name\":\"A Guide On How to Configure a Firewall in Linux\",\"isPartOf\":{\"@id\":\"https:\/\/www.resellerclub.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#primaryimage\"},\"datePublished\":\"2017-12-19T12:33:20+00:00\",\"dateModified\":\"2026-05-22T13:12:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.resellerclub.com\/blog\/#\/schema\/person\/16ed77e00d0b86df4fe5ea9dbc5eacaf\"},\"description\":\"Configure firewall in Linux with our step-by-step guide. Learn iptables, UFW, and security best practices to protect your server from unauthorized access.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.resellerclub.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Step-By-Step Guide on How to Configure a Firewall in Linux\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.resellerclub.com\/blog\/#\/schema\/person\/16ed77e00d0b86df4fe5ea9dbc5eacaf\",\"name\":\"Tanya Noronha\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.resellerclub.com\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4c41998ad50d748935c7a5bca721e54bc7cae620f2d4e846c473bccea46770c5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4c41998ad50d748935c7a5bca721e54bc7cae620f2d4e846c473bccea46770c5?s=96&d=mm&r=g\",\"caption\":\"Tanya Noronha\"},\"url\":\"https:\/\/www.resellerclub.com\/blog\/author\/tanya-n\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Guide On How to Configure a Firewall in Linux","description":"Configure firewall in Linux with our step-by-step guide. Learn iptables, UFW, and security best practices to protect your server from unauthorized access.","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.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"A Guide On How to Configure a Firewall in Linux","og_description":"Configure firewall in Linux with our step-by-step guide. Learn iptables, UFW, and security best practices to protect your server from unauthorized access.","og_url":"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/","og_site_name":"ResellerClub Blog","article_publisher":"https:\/\/www.facebook.com\/profile.php?id=100005889763273","article_published_time":"2017-12-19T12:33:20+00:00","article_modified_time":"2026-05-22T13:12:37+00:00","og_image":[{"width":1200,"height":800,"url":"https:\/\/www.resellerclub.com\/blog\/wp-content\/uploads\/2017\/12\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux-2.jpg","path":"\/var\/www\/html\/blog\/wp-content\/uploads\/2017\/12\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux-2.jpg","size":"full","id":29831,"alt":"","pixels":960000,"type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tanya Noronha","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.resellerclub.com\/blog\/#website","url":"https:\/\/www.resellerclub.com\/blog\/","name":"ResellerClub Blog","description":"Web Hosting &amp; Domains","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.resellerclub.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#primaryimage","inLanguage":"en-US","url":"https:\/\/www.resellerclub.com\/blog\/wp-content\/uploads\/2017\/12\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux-2.jpg","contentUrl":"https:\/\/www.resellerclub.com\/blog\/wp-content\/uploads\/2017\/12\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux-2.jpg","width":1200,"height":800},{"@type":"WebPage","@id":"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#webpage","url":"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/","name":"A Guide On How to Configure a Firewall in Linux","isPartOf":{"@id":"https:\/\/www.resellerclub.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#primaryimage"},"datePublished":"2017-12-19T12:33:20+00:00","dateModified":"2026-05-22T13:12:37+00:00","author":{"@id":"https:\/\/www.resellerclub.com\/blog\/#\/schema\/person\/16ed77e00d0b86df4fe5ea9dbc5eacaf"},"description":"Configure firewall in Linux with our step-by-step guide. Learn iptables, UFW, and security best practices to protect your server from unauthorized access.","breadcrumb":{"@id":"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.resellerclub.com\/blog\/a-step-by-step-guide-on-how-to-configure-firewall-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.resellerclub.com\/blog\/"},{"@type":"ListItem","position":2,"name":"A Step-By-Step Guide on How to Configure a Firewall in Linux"}]},{"@type":"Person","@id":"https:\/\/www.resellerclub.com\/blog\/#\/schema\/person\/16ed77e00d0b86df4fe5ea9dbc5eacaf","name":"Tanya Noronha","image":{"@type":"ImageObject","@id":"https:\/\/www.resellerclub.com\/blog\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/4c41998ad50d748935c7a5bca721e54bc7cae620f2d4e846c473bccea46770c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4c41998ad50d748935c7a5bca721e54bc7cae620f2d4e846c473bccea46770c5?s=96&d=mm&r=g","caption":"Tanya Noronha"},"url":"https:\/\/www.resellerclub.com\/blog\/author\/tanya-n\/"}]}},"_links":{"self":[{"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/posts\/19821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/comments?post=19821"}],"version-history":[{"count":16,"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/posts\/19821\/revisions"}],"predecessor-version":[{"id":38370,"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/posts\/19821\/revisions\/38370"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/media\/29831"}],"wp:attachment":[{"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/media?parent=19821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/categories?post=19821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/tags?post=19821"},{"taxonomy":"hashtags","embeddable":true,"href":"https:\/\/www.resellerclub.com\/blog\/wp-json\/wp\/v2\/hashtags?post=19821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}