{"id":709,"date":"2024-12-16T14:45:02","date_gmt":"2024-12-16T11:45:02","guid":{"rendered":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/"},"modified":"2024-12-16T14:45:02","modified_gmt":"2024-12-16T11:45:02","slug":"mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall","status":"publish","type":"post","link":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/","title":{"rendered":"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall"},"content":{"rendered":"<p><br \/>\n<\/p>\n<p>In the world of Linux, firewalls play a crucial role in protecting systems from potential threats. While the traditional <code>iptables<\/code> has served well over the years, <code>nftables<\/code> is the new standard for packet filtering and firewall management in Linux. It&#8217;s designed to simplify the process of creating and managing firewall rules, offering enhanced performance and usability. In this guide, we&#8217;ll walk you through the process of mastering <code>nftables<\/code> and setting up a robust firewall for your Linux server.<\/p>\n<p><\/p>\n<h2>What is Nftables?<\/h2>\n<p><\/p>\n<p><code>nftables<\/code> is the successor to <code>iptables<\/code>, providing a single framework to handle both IPv4 and IPv6 packets as well as ARP. It introduces a new command-line interface and uses a more efficient data structure that results in better performance and easier management. Additionally, it allows you to create complex rule sets in a more straightforward way compared to its predecessors.<\/p>\n<p><\/p>\n<h2>Why Use Nftables?<\/h2>\n<p><\/p>\n<ol><\/p>\n<li><strong>Simplicity<\/strong>: <code>nftables<\/code> reduces the complexity of managing rules.<\/li>\n<p><\/p>\n<li><strong>Efficiency<\/strong>: It leverages an optimized data structure for performance.<\/li>\n<p><\/p>\n<li><strong>Unified Syntax<\/strong>: Offers a unified syntax for IPv4, IPv6, and ARP.<\/li>\n<p><\/p>\n<li><strong>Stateful Filtering<\/strong>: Supports stateful packet inspection with ease.<\/li>\n<p>\n<\/ol>\n<p><\/p>\n<h2>Prerequisites<\/h2>\n<p><\/p>\n<p>Before we proceed with the setup, ensure you have:<\/p>\n<p><\/p>\n<ul><\/p>\n<li>A Linux server running a supported distribution (e.g., Ubuntu, Fedora, CentOS).<\/li>\n<p><\/p>\n<li>Root or sudo privileges on the server.<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<h2>Step 1: Installing Nftables<\/h2>\n<p><\/p>\n<p>On most modern Linux distributions, <code>nftables<\/code> comes pre-installed. However, if it&#8217;s not installed, you can easily set it up using your package manager.<\/p>\n<p><\/p>\n<p>For <strong>Debian\/Ubuntu<\/strong>:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo apt update<br \/>\nsudo apt install nftables<\/code><\/pre>\n<p><\/p>\n<p>For <strong>Fedora<\/strong>:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo dnf install nftables<\/code><\/pre>\n<p><\/p>\n<p>For <strong>CentOS\/RHEL<\/strong>:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo yum install nftables<\/code><\/pre>\n<p><\/p>\n<p>Once installed, enable and start the <code>nftables<\/code> service:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo systemctl enable nftables<br \/>\nsudo systemctl start nftables<\/code><\/pre>\n<p><\/p>\n<h2>Step 2: Understanding Nftables Configuration<\/h2>\n<p><\/p>\n<p>Nftables rules are organized into tables, chains, and rules. Here&#8217;s a brief overview:<\/p>\n<p><\/p>\n<ul><\/p>\n<li><strong>Table<\/strong>: A container for chains; can contain multiple chains.<\/li>\n<p><\/p>\n<li><strong>Chain<\/strong>: A list of rules; processes packets when they match certain conditions.<\/li>\n<p><\/p>\n<li><strong>Rule<\/strong>: Defines conditions and actions to take (like accept, drop, etc.).<\/li>\n<p>\n<\/ul>\n<p><\/p>\n<p>The commands to manage <code>nftables<\/code> follow this structure. <\/p>\n<p><\/p>\n<h2>Step 3: Creating Your First Nftables Ruleset<\/h2>\n<p><\/p>\n<p>Let&#8217;s create a basic ruleset to control incoming and outgoing traffic.<\/p>\n<p><\/p>\n<ol><\/p>\n<li>\n<p><strong>Create a New Ruleset File:<\/strong><\/p>\n<p><\/p>\n<p>Start by creating a new file, e.g., <code>\/etc\/nftables.conf<\/code>.<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo nano \/etc\/nftables.conf<\/code><\/pre>\n<p>\n<\/li>\n<p><\/p>\n<li>\n<p><strong>Define the Ruleset:<\/strong><\/p>\n<p><\/p>\n<p>Here&#8217;s a simple configuration to allow established connections and block everything else:<\/p>\n<p><\/p>\n<pre><code class=\"language-nft\">#!\/usr\/sbin\/nft -f<br \/>\n<br \/>\ntable inet filter {<br \/>\n   chain input {<br \/>\n       type filter hook input priority 0; policy drop;<br \/>\n       iif \"lo\" accept           # Allow loopback traffic<br \/>\n       ct state established,related accept  # Allow established traffic<br \/>\n       ip saddr 192.168.1.0\/24 accept  # Allow local network<br \/>\n       tcp dport ssh accept    # Allow SSH<br \/>\n       tcp dport http accept    # Allow HTTP<br \/>\n       tcp dport https accept    # Allow HTTPS<br \/>\n   }<br \/>\n<br \/>\n   chain output {<br \/>\n       type filter hook output priority 0; policy accept; # Allow all outgoing traffic<br \/>\n   }<br \/>\n}<\/code><\/pre>\n<p>\n<\/li>\n<p><\/p>\n<li>\n<p><strong>Load the Ruleset:<\/strong><\/p>\n<p><\/p>\n<p>To make these rules active, load the ruleset using:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo nft -f \/etc\/nftables.conf<\/code><\/pre>\n<p>\n<\/li>\n<p><\/p>\n<li>\n<p><strong>Verify Your Rules:<\/strong><\/p>\n<p><\/p>\n<p>Check that your rules have been applied successfully:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo nft list ruleset<\/code><\/pre>\n<p>\n<\/li>\n<p>\n<\/ol>\n<p><\/p>\n<h2>Step 4: Saving Nftables Rules<\/h2>\n<p><\/p>\n<p>To ensure your rules persist after a reboot, make sure <code>nftables<\/code> loads your ruleset on startup. Edit the default config file:<\/p>\n<p><\/p>\n<p>For most distributions:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo nano \/etc\/nftables.conf<\/code><\/pre>\n<p><\/p>\n<p>Ensure it contains the rules you\u2019ve defined.<\/p>\n<p><\/p>\n<p>Also, enable the <code>nftables<\/code> service to start on boot:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo systemctl enable nftables<\/code><\/pre>\n<p><\/p>\n<h2>Step 5: Managing Nftables Rules<\/h2>\n<p><\/p>\n<h3>Adding New Rules<\/h3>\n<p><\/p>\n<p>To append an additional rule, you can use the command directly:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo nft add rule inet filter input tcp dport 22 accept<\/code><\/pre>\n<p><\/p>\n<h3>Deleting Rules<\/h3>\n<p><\/p>\n<p>To remove a rule, identify it with its <strong>handle<\/strong>, then delete it:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo nft delete rule inet filter input handle &lt;handle_number&gt;<\/code><\/pre>\n<p><\/p>\n<h3>Flushing Rules<\/h3>\n<p><\/p>\n<p>To clear all rules, you can flush a chain or an entire table:<\/p>\n<p><\/p>\n<pre><code class=\"language-bash\">sudo nft flush chain inet filter input<\/code><\/pre>\n<p><\/p>\n<h2>Step 6: Logging and Monitoring<\/h2>\n<p><\/p>\n<p>Monitoring your firewall activity is essential. You can set up logging of dropped packets with a rule like:<\/p>\n<p><\/p>\n<pre><code class=\"language-nft\">log prefix \"Dropped: \" flags all level info<\/code><\/pre>\n<p><\/p>\n<p>This will log events to <code>syslog<\/code>, allowing you to monitor traffic efficiently.<\/p>\n<p><\/p>\n<h2>Conclusion<\/h2>\n<p><\/p>\n<p>Congratulations! You&#8217;ve now set up a basic firewall using <code>nftables<\/code>. This powerful tool not only enhances your security posture but also provides a streamlined approach to network traffic management. As you become more familiar with <code>nftables<\/code>, you can explore advanced features like NAT, rate limiting, and more complex rule sets to further tailor your firewall configuration to your specific requirements.<\/p>\n<p><\/p>\n<p>For continuous learning, refer to the <a href=\"https:\/\/netfilter.org\/projects\/nftables\/index.html\">official nftables documentation<\/a> and experiment with different configurations. Secure your Linux server, and embrace the power of <code>nftables<\/code>! Happy filtering!<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>In the world of Linux, firewalls play a crucial role in protecting systems from potential threats. While the traditional iptables has served well over the years, nftables is the new standard for packet filtering and firewall management in Linux. It&#8217;s designed to simplify the process of creating and managing firewall rules, offering enhanced performance and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":710,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[22],"tags":[408,233,265,200,412,266,371,279],"class_list":["post-709","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-security","tag-firewall","tag-guide","tag-linux","tag-mastering","tag-nftables","tag-server","tag-setting","tag-stepbystep","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.5 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall - WafaTech Blogs<\/title>\n<meta name=\"description\" content=\"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall %\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall\" \/>\n<meta property=\"og:description\" content=\"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall %\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/\" \/>\n<meta property=\"og:site_name\" content=\"WafaTech Blogs\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/people\/WafaTech\/61560546351289\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-16T11:45:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wafatech.sa\/blog\/wp-content\/uploads\/2024\/06\/logo_big.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"2221\" \/>\n\t<meta property=\"og:image:height\" content=\"482\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"WafaTech SA\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wafatech_sa\" \/>\n<meta name=\"twitter:site\" content=\"@wafatech_sa\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"WafaTech SA\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/\"},\"author\":{\"name\":\"WafaTech SA\",\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/#\\\/schema\\\/person\\\/1a5761fc0feb63ab59d295d7c2648f06\"},\"headline\":\"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall\",\"datePublished\":\"2024-12-16T11:45:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/\"},\"wordCount\":595,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Mastering-Nftables-A-Step-by-Step-Guide-to-Setting-Up-Your-Linux.png\",\"keywords\":[\"Firewall\",\"Guide\",\"Linux\",\"Mastering\",\"Nftables\",\"Server\",\"Setting\",\"StepbyStep\"],\"articleSection\":[\"Linux Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/\",\"url\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/\",\"name\":\"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall - WafaTech Blogs\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Mastering-Nftables-A-Step-by-Step-Guide-to-Setting-Up-Your-Linux.png\",\"datePublished\":\"2024-12-16T11:45:02+00:00\",\"description\":\"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall %\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Mastering-Nftables-A-Step-by-Step-Guide-to-Setting-Up-Your-Linux.png\",\"contentUrl\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Mastering-Nftables-A-Step-by-Step-Guide-to-Setting-Up-Your-Linux.png\",\"width\":1024,\"height\":1024,\"caption\":\"linux server setting up nftables\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/linux\\\/linux-security\\\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/\",\"name\":\"WafaTech Blogs\",\"description\":\"Smart Technologies\",\"publisher\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/#organization\"},\"alternateName\":\"WafaTech\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/#organization\",\"name\":\"WafaTech Blogs\",\"alternateName\":\"WafaTech\",\"url\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/logo_big.webp\",\"contentUrl\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/logo_big.webp\",\"width\":2221,\"height\":482,\"caption\":\"WafaTech Blogs\"},\"image\":{\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/people\\\/WafaTech\\\/61560546351289\\\/\",\"https:\\\/\\\/x.com\\\/wafatech_sa\",\"https:\\\/\\\/www.youtube.com\\\/@wafatech-sa\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wafatech\\\/\"],\"description\":\"WafaTech, a leading Saudi IT services provider, specializes in cloud solutions, connectivity, and ICT services. Offering secure cloud infrastructure, high-speed internet, and ICT solutions like hosting, backup, and disaster recovery, WafaTech operates a Tier 3 data center at KAUST with ISO certifications. Regulated by CST, the company is committed to innovation, security, and customer satisfaction, empowering businesses in the digital age.\",\"email\":\"sales@wafatech.sa\",\"legalName\":\"Al-Wafa Al-Dhakia For Information Technology LLC\",\"foundingDate\":\"2013-01-08\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/#\\\/schema\\\/person\\\/1a5761fc0feb63ab59d295d7c2648f06\",\"name\":\"WafaTech SA\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fde877f001a2e0497276edc0684d3ba2a416c0de8caeb8e785076a1b1b932b3a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fde877f001a2e0497276edc0684d3ba2a416c0de8caeb8e785076a1b1b932b3a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fde877f001a2e0497276edc0684d3ba2a416c0de8caeb8e785076a1b1b932b3a?s=96&d=mm&r=g\",\"caption\":\"WafaTech SA\"},\"url\":\"https:\\\/\\\/wafatech.sa\\\/blog\\\/author\\\/omer-yaseen\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall - WafaTech Blogs","description":"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall %","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:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/","og_locale":"en_US","og_type":"article","og_title":"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall","og_description":"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall %","og_url":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/","og_site_name":"WafaTech Blogs","article_publisher":"https:\/\/www.facebook.com\/people\/WafaTech\/61560546351289\/","article_published_time":"2024-12-16T11:45:02+00:00","og_image":[{"width":2221,"height":482,"url":"https:\/\/wafatech.sa\/blog\/wp-content\/uploads\/2024\/06\/logo_big.webp","type":"image\/webp"}],"author":"WafaTech SA","twitter_card":"summary_large_image","twitter_creator":"@wafatech_sa","twitter_site":"@wafatech_sa","twitter_misc":{"Written by":"WafaTech SA","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/#article","isPartOf":{"@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/"},"author":{"name":"WafaTech SA","@id":"https:\/\/wafatech.sa\/blog\/#\/schema\/person\/1a5761fc0feb63ab59d295d7c2648f06"},"headline":"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall","datePublished":"2024-12-16T11:45:02+00:00","mainEntityOfPage":{"@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/"},"wordCount":595,"commentCount":0,"publisher":{"@id":"https:\/\/wafatech.sa\/blog\/#organization"},"image":{"@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/#primaryimage"},"thumbnailUrl":"https:\/\/wafatech.sa\/blog\/wp-content\/uploads\/2024\/12\/Mastering-Nftables-A-Step-by-Step-Guide-to-Setting-Up-Your-Linux.png","keywords":["Firewall","Guide","Linux","Mastering","Nftables","Server","Setting","StepbyStep"],"articleSection":["Linux Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/","url":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/","name":"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall - WafaTech Blogs","isPartOf":{"@id":"https:\/\/wafatech.sa\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/#primaryimage"},"image":{"@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/#primaryimage"},"thumbnailUrl":"https:\/\/wafatech.sa\/blog\/wp-content\/uploads\/2024\/12\/Mastering-Nftables-A-Step-by-Step-Guide-to-Setting-Up-Your-Linux.png","datePublished":"2024-12-16T11:45:02+00:00","description":"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall %","breadcrumb":{"@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/#primaryimage","url":"https:\/\/wafatech.sa\/blog\/wp-content\/uploads\/2024\/12\/Mastering-Nftables-A-Step-by-Step-Guide-to-Setting-Up-Your-Linux.png","contentUrl":"https:\/\/wafatech.sa\/blog\/wp-content\/uploads\/2024\/12\/Mastering-Nftables-A-Step-by-Step-Guide-to-Setting-Up-Your-Linux.png","width":1024,"height":1024,"caption":"linux server setting up nftables"},{"@type":"BreadcrumbList","@id":"https:\/\/wafatech.sa\/blog\/linux\/linux-security\/mastering-nftables-a-step-by-step-guide-to-setting-up-your-linux-server-firewall\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wafatech.sa\/blog\/"},{"@type":"ListItem","position":2,"name":"Mastering Nftables: A Step-by-Step Guide to Setting Up Your Linux Server Firewall"}]},{"@type":"WebSite","@id":"https:\/\/wafatech.sa\/blog\/#website","url":"https:\/\/wafatech.sa\/blog\/","name":"WafaTech Blogs","description":"Smart Technologies","publisher":{"@id":"https:\/\/wafatech.sa\/blog\/#organization"},"alternateName":"WafaTech","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wafatech.sa\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wafatech.sa\/blog\/#organization","name":"WafaTech Blogs","alternateName":"WafaTech","url":"https:\/\/wafatech.sa\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wafatech.sa\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/wafatech.sa\/blog\/wp-content\/uploads\/2024\/06\/logo_big.webp","contentUrl":"https:\/\/wafatech.sa\/blog\/wp-content\/uploads\/2024\/06\/logo_big.webp","width":2221,"height":482,"caption":"WafaTech Blogs"},"image":{"@id":"https:\/\/wafatech.sa\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/people\/WafaTech\/61560546351289\/","https:\/\/x.com\/wafatech_sa","https:\/\/www.youtube.com\/@wafatech-sa","https:\/\/www.linkedin.com\/company\/wafatech\/"],"description":"WafaTech, a leading Saudi IT services provider, specializes in cloud solutions, connectivity, and ICT services. Offering secure cloud infrastructure, high-speed internet, and ICT solutions like hosting, backup, and disaster recovery, WafaTech operates a Tier 3 data center at KAUST with ISO certifications. Regulated by CST, the company is committed to innovation, security, and customer satisfaction, empowering businesses in the digital age.","email":"sales@wafatech.sa","legalName":"Al-Wafa Al-Dhakia For Information Technology LLC","foundingDate":"2013-01-08","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/wafatech.sa\/blog\/#\/schema\/person\/1a5761fc0feb63ab59d295d7c2648f06","name":"WafaTech SA","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/fde877f001a2e0497276edc0684d3ba2a416c0de8caeb8e785076a1b1b932b3a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/fde877f001a2e0497276edc0684d3ba2a416c0de8caeb8e785076a1b1b932b3a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fde877f001a2e0497276edc0684d3ba2a416c0de8caeb8e785076a1b1b932b3a?s=96&d=mm&r=g","caption":"WafaTech SA"},"url":"https:\/\/wafatech.sa\/blog\/author\/omer-yaseen\/"}]}},"jetpack_featured_media_url":"https:\/\/wafatech.sa\/blog\/wp-content\/uploads\/2024\/12\/Mastering-Nftables-A-Step-by-Step-Guide-to-Setting-Up-Your-Linux.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/posts\/709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/comments?post=709"}],"version-history":[{"count":0,"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/posts\/709\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/media\/710"}],"wp:attachment":[{"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/media?parent=709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/categories?post=709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wafatech.sa\/blog\/wp-json\/wp\/v2\/tags?post=709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}