{"id":1064,"date":"2014-03-31T10:08:59","date_gmt":"2014-03-31T14:08:59","guid":{"rendered":"http:\/\/www.gtcomm.net\/blog\/?p=1064"},"modified":"2018-01-12T14:13:13","modified_gmt":"2018-01-12T19:13:13","slug":"linux-firewall-introduction","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/","title":{"rendered":"Linux Firewall Introduction"},"content":{"rendered":"<h1>Linux Firewall Introduction<\/h1>\n<p><a href=\"http:\/\/business-technology.co.uk\/2014\/02\/90-of-businesses-expect-cyber-attack-increase\/\" target=\"_blank\">As cyber-crimes and cyber-attacks continue to increase<\/a>, the need for cyber-security has never been more important. That\u2019s why it has become extremely important to protect our servers as well as our web assets. How should we proceed to establish a secure environment? What are some of the options open to us? There are many ways to ensure the security of your dedicated server, and in this blog entry, we will discuss firewalls, their usage and configuration and which may be best for different applications.<\/p>\n<p style=\"text-align: center;\">\n<p><!--more--><\/p>\n<h2>What&#8217;s a firewall ?<\/h2>\n<p>A firewall is a security component that allows and restricts access to specific networks and ports. It is generally accompanied by routing capabilities, increasing its functionality and making it a very popular security solution. There are two types of firewalls: software and hardware. Software firewalls tend to be cheap (or free) and easily available while hardware firewalls are more expensive, full-featured and their capabilities (Throughput, packets per second, etc.) have been measured and are guaranteed to the user. While their additional features are different, their primary functions remain the same: restricting access to your network or dedicated server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1068\" alt=\"Server Firewall\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/Picture_Firewall.png\" width=\"246\" height=\"138\" \/><\/p>\n<p>A software firewall is an application that is installed on a server which controls and restricts network access to the machine. It\u2019s generally setup on a specific server where other applications are located. Because of that, a software firewall will sometimes take up resources on a server, increasing the load of that machine. Both Linux and Windows generally come with their own software firewall, while several other third-party options exist as well. One feature that strongly distinguishes a hardware firewall from a software firewall is that a hardware firewall runs on its own proprietary hardware. It does not take up resources from your server when it\u2019s running. It is its own entity. This means that most people will plug their hardware firewall upstream from their server. Additionally, since it often has more than one port, more than one server may be plugged to it. This way, it can protect several servers, or even several networks on bigger setup. By that point though, it behaves more like a router than a simple firewall.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/Server-Firewall-Schema.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1070\" alt=\"Server Firewall Schema\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/Server-Firewall-Schema.gif\" width=\"434\" height=\"289\" \/><\/a><\/p>\n<address>(Click on the image to enlarge the firewall protected server&#8217;s schema)<\/address>\n<p>It is possible to recreate such a setup using a software firewall. However, it requires adding another computer in front of your server, installing several network interface cards on this computer and then setting up a routing configuration so that the software firewall may route packets correctly. In that sense, the hardware firewall is more beginner-friendly, as it\u2019s generally setup out of the box and only requires a firewall configuration.<\/p>\n<p>I\u2019ve been saying since the beginning of this article that firewalls restrict access to the server, but how do they do this? We first need to understand that an un-configured firewall is useless. It will not block anything by default. This also means that it\u2019s impossible to open a port on an un-configured firewall since nothing is blocked by default. When you want to block something, you need to specify a source (can be a wildcard), a destination (can also be a wildcard), a protocol or port, depending on if you want to block access to a specific service or application on the server and \u201caccept\u201d or \u201cdeny\u201d access, depending on if you want to authorize the traffic or deny it access to the server. Once that rule is set, the firewall will analyze every packet of data which goes through the server and reject everything that it is set to reject.<\/p>\n<h2>How to add a rule on a Linux firewall ?<\/h2>\n<p>To illustrate what a firewall rule might look like, let us simulate a firewall rule on port 22(SSH default port on most Linux distribution). Here is an example of an iptables rule:<\/p>\n<p>iptables -I INPUT -i eth0 -p tcp &#8211;dport 22 -j ACCEPT<\/p>\n<p>The \u2013I flag add the rule at the top of the list, so it\u2019s the first rule taken into account when iptables is running. INPUT designate the series of rules which affect incoming connections to the server. \u201c\u2013i eth0\u201d specifies the interface this rule applies to. \u201c-p tcp\u201d is the type of network protocol. \u201c\u2014dport 22\u201d is the destination port where the service we want to control listen to. \u201c-j ACCEPT\u201d specifies whether packets should be accepted or rejected. So, what this example does is that it allows traffic through the firewall for port 22, the SSH service port. Of course, firewall rules are not exactly easy to generate from scratch, and we highly recommend to have a system administrator write them into your firewall.<\/p>\n<p>Other options also exist to increase the amount of security features a software firewall like iptables can provide. For example, there is the CSF plugin, which increases iptables functionalities greatly. CSF adds country blocking and better IP block management capabilities to iptables, among other things. It can also be fully integrated into cPanel, so that you can manage your software firewall from the GUI. <a href=\"http:\/\/configserver.com\/free\/csf\/install.txt\" target=\"_blank\">Here&#8217;s how to install it on most linux distributions<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1075\" alt=\"Cisco ASA series firewall solution\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/Cisco-ASA-series-firewall-solution.jpg\" width=\"172\" height=\"86\" \/>That being said, while the core base features might be similar, a hardware firewall such a Cisco ASA series will provide you more feature such as IPsec VPN, Native High-Availability firewall setup, VLAN setup, etc. while guaranteeing its throughput capabilities.<\/p>\n<p>That is all for this introduction to firewalls. In the next article, we will look at Cisco ASA firewall. That article will be followed by another piece that goes into more details about iptables.<br \/>\n<!-- end HubSpot Call-to-Action Code --><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Linux Firewall Introduction As cyber-crimes and cyber-attacks continue to increase, the need for cyber-security has never been more important. That\u2019s why it has become extremely important to protect our servers as well as our web assets. How should we proceed to establish a secure environment? What are some of the options open to us? There<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":4,"featured_media":1073,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,65],"tags":[10,11,5,13,8],"class_list":["post-1064","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-software","tag-dedicated-server","tag-high-availability-hosting","tag-infrastructure","tag-security","tag-web-hosting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux Firewall Introduction - GloboTech Communications Blog<\/title>\n<meta name=\"description\" content=\"A firewall is a security component that allows and restricts access to specific networks and ports. There are two types of firewalls: software and hardware.\" \/>\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.globo.tech\/learning-center\/linux-firewall-introduction\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux Firewall Introduction - GloboTech Communications Blog\" \/>\n<meta property=\"og:description\" content=\"A firewall is a security component that allows and restricts access to specific networks and ports. There are two types of firewalls: software and hardware.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2014-03-31T14:08:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-12T19:13:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/introduction_to_server_firewall.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"340\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Eric Simard\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eric Simard\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/\",\"name\":\"Linux Firewall Introduction - GloboTech Communications Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/introduction_to_server_firewall.png\",\"datePublished\":\"2014-03-31T14:08:59+00:00\",\"dateModified\":\"2018-01-12T19:13:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/2202ee355cd2897b4751d2f3ffcd56f1\"},\"description\":\"A firewall is a security component that allows and restricts access to specific networks and ports. There are two types of firewalls: software and hardware.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#primaryimage\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/introduction_to_server_firewall.png\",\"contentUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/introduction_to_server_firewall.png\",\"width\":500,\"height\":340,\"caption\":\"introduction to server firewall\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux Firewall Introduction\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/2202ee355cd2897b4751d2f3ffcd56f1\",\"name\":\"Eric Simard\",\"description\":\"I am Eric Simard, best father in the world and account manager at GloboTech Communications located in the beautiful city of Montreal. Passionate about the hosting world and technologies, I take great pleasure in offering the best solutions for my clients. Follow me through my journey in the exciting hosting world on my different blogs!\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux Firewall Introduction - GloboTech Communications Blog","description":"A firewall is a security component that allows and restricts access to specific networks and ports. There are two types of firewalls: software and hardware.","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.globo.tech\/learning-center\/linux-firewall-introduction\/","og_locale":"en_US","og_type":"article","og_title":"Linux Firewall Introduction - GloboTech Communications Blog","og_description":"A firewall is a security component that allows and restricts access to specific networks and ports. There are two types of firewalls: software and hardware.","og_url":"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/","og_site_name":"Globo.Tech","article_published_time":"2014-03-31T14:08:59+00:00","article_modified_time":"2018-01-12T19:13:13+00:00","og_image":[{"width":500,"height":340,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/introduction_to_server_firewall.png","type":"image\/png"}],"author":"Eric Simard","twitter_misc":{"Written by":"Eric Simard","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/","url":"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/","name":"Linux Firewall Introduction - GloboTech Communications Blog","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/introduction_to_server_firewall.png","datePublished":"2014-03-31T14:08:59+00:00","dateModified":"2018-01-12T19:13:13+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/2202ee355cd2897b4751d2f3ffcd56f1"},"description":"A firewall is a security component that allows and restricts access to specific networks and ports. There are two types of firewalls: software and hardware.","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/introduction_to_server_firewall.png","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2014\/03\/introduction_to_server_firewall.png","width":500,"height":340,"caption":"introduction to server firewall"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/linux-firewall-introduction\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"Linux Firewall Introduction"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/2202ee355cd2897b4751d2f3ffcd56f1","name":"Eric Simard","description":"I am Eric Simard, best father in the world and account manager at GloboTech Communications located in the beautiful city of Montreal. Passionate about the hosting world and technologies, I take great pleasure in offering the best solutions for my clients. Follow me through my journey in the exciting hosting world on my different blogs!","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=1064"}],"version-history":[{"count":17,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1064\/revisions"}],"predecessor-version":[{"id":4090,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/1064\/revisions\/4090"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media\/1073"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=1064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=1064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=1064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}