{"id":1740,"date":"2022-07-30T12:30:00","date_gmt":"2022-07-30T17:30:00","guid":{"rendered":"https:\/\/www.linuxcloudvps.com\/blog\/?p=1740"},"modified":"2023-08-29T10:35:27","modified_gmt":"2023-08-29T15:35:27","slug":"10-useful-firewall-cmd-commands-in-linux","status":"publish","type":"post","link":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/","title":{"rendered":"10 Useful firewall-cmd Commands in Linux"},"content":{"rendered":"\n<p>In this blog post, we are going to explain 10 useful firewall-cmd commands in Linux with real examples.<\/p>\n\n\n\n<p>The firewall-cmd is the command-line client used to manage the runtime configurations. It is a firewall solution as an alternative to the iptables service. We know that a properly configured firewall is the only weapon that can defend the server from attacks caused by internal influences. The firewall-cmd is part of the firewalld application that can be used for managing the firewall.<\/p>\n\n\n\n<p>In this blog post, we are going to use <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting\/\">Ubuntu 22.04 as Linux OS<\/a>. You can use any Linux distribution. Let&#8217;s get started!<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Fresh install of Ubuntu 22.04 OS<\/li>\n\n\n\n<li>User privileges: root or non-root user with sudo privileges<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Update the System<\/h2>\n\n\n\n<p>Before we start with the firewall-cmd command we are going to update the system packages to the latest versions available.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt update -y &amp;&amp; sudo apt upgrade -y<\/pre>\n\n\n\n<p>Once the system is updated we are ready to show you the basic firewall-cmd commands in Linux.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Install Firewalld<\/h2>\n\n\n\n<p>Let&#8217;s check what we will get if we execute the <strong>firewall-cmd<\/strong> command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# firewall-cmd\nCommand 'firewall-cmd' not found, but can be installed with:\napt install firewalld\n<\/pre>\n\n\n\n<p>We can see that the <strong>firewall-cmd<\/strong> is not installed by default, so we will have to install it with the command provided in the output above.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install firewalld<\/pre>\n\n\n\n<p>Since the firewalld is a service, it will be automatically started after the installation, but if we want to be sure, we can start and enable it manually with the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl start firewalld &amp;&amp; sudo systemctl enable firewalld<\/pre>\n\n\n\n<p>To check the status of the firewalld service, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl status firewalld<\/pre>\n\n\n\n<p>You will receive the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sudo systemctl status firewalld\n\u25cf firewalld.service - firewalld - dynamic firewall daemon\n     Loaded: loaded (\/lib\/systemd\/system\/firewalld.service; enabled; vendor preset: enabled)\n     Active: active (running) since Wed 2022-07-06 18:34:51 UTC; 6min ago\n       Docs: man:firewalld(1)\n   Main PID: 1761 (firewalld)\n      Tasks: 2 (limit: 4548)\n     Memory: 24.8M\n        CPU: 1.689s\n     CGroup: \/system.slice\/firewalld.service\n             \u2514\u25001761 \/usr\/bin\/python3 \/usr\/sbin\/firewalld --nofork --nopid\n\nJul 06 18:34:50 host.test.vps systemd[1]: Starting firewalld - dynamic firewall daemon...\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. Firewall-cmd Help Command<\/h2>\n\n\n\n<p>The firewall-cmd help command will show us the syntax of the firewall-cmd, options, and usage.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# firewall-cmd --help\n\nUsage: firewall-cmd [OPTIONS...]\n\nGeneral Options\n  -h, --help           Prints a short help text and exists\n  -V, --version        Print the version string of firewalld\n  -q, --quiet          Do not print status messages\n\nStatus Options\n  --state              Return and print firewalld state\n  --reload             Reload firewall and keep state information\n  --complete-reload    Reload firewall and lose state information\n  --runtime-to-permanent\n                       Create permanent from runtime configuration\n  --check-config       Check permanent configuration for errors\n\nLog Denied Options\n  --get-log-denied     Print the log denied value\n  --set-log-denied=\n                       Set log denied value<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. Firewall-cmd List Services<\/h2>\n\n\n\n<p>This command <strong>firewall-cmd &#8211;list-services<\/strong> will show us the enabled service on our system.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# firewall-cmd --list-services\ndhcpv6-client ssh\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. Open Port with Firewall-cmd<\/h2>\n\n\n\n<p>With this command, we can easily open a port on our server for incoming or outgoing connections.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --add-port=80\/tcp\n\nsudo firewall-cmd --add-port=443\/tcp\n\nsudo firewall-cmd --zone=public --add-port=3306\/tcp\n<\/pre>\n\n\n\n<p>With these commands, we opened ports 80, and 443 for HTTP and HTTPS requests and port 3306 for MySQL service.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. List Open Ports with Firewall-cmd<\/h2>\n\n\n\n<p>With this command, we can list the previously opened ports.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# &lt;strong&gt;firewall-cmd --list-ports&lt;\/strong&gt;\n80\/tcp 443\/tcp 3306\/tcp<\/pre>\n\n\n\n<p>To make the new settings persistent, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --runtime-to-permanent<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">5. Closing Port with Firewall-cmd<\/h2>\n\n\n\n<p>To close the port, for example, <strong>3306<\/strong> in Firewall-cmd execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --remove-port=3306\/tcp<\/pre>\n\n\n\n<p>To make the new settings persistent, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --runtime-to-permanent<\/pre>\n\n\n\n<p>Now, list the opened ports again:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# firewall-cmd --list-ports\n80\/tcp 443\/tcp\n<\/pre>\n\n\n\n<p>As you can see, port 3306 is not on the list anymore.\/p&gt;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. List all zones with Firewall-cmd<\/h2>\n\n\n\n<p>With this command, we can list all zones and information about them.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --list-all-zones\n\nblock\n  target: %%REJECT%%\n  icmp-block-inversion: no\n  interfaces:\n  sources:\n  services:\n  ports:\n....\n\ndmz\n  target: default\n  icmp-block-inversion: no\n  interfaces:\n  sources:\n  services: ssh\n ....\n\nhome\n  target: default\n  icmp-block-inversion: no\n  interfaces:\n  sources:\n  services: dhcpv6-client mdns samba-client ssh\n  ports:\n  protocols:\n  forward: yes\n  ....\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">7. Firewall-cmd port forwarding<\/h2>\n\n\n\n<p>To forward, for example, port 80 to port 443 on your server, you can use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --zone=public --add-forward-port=port=80:proto=tcp:toport=443 --permanent\n\nsudo firewall-cmd --reload<\/pre>\n\n\n\n<p>As you can see on all successfull commands, you will receive the <strong>success<\/strong> message.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sudo firewall-cmd --zone=public --add-forward-port=port=80:proto=tcp:toport=443 --permanent\nsuccess\nroot@host:~# sudo firewall-cmd --reload\nsuccess\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">8. Access to Port from a specific IP address<\/h2>\n\n\n\n<p>In this example, we are going to allow access to port 3306 only from IP 192.168.0.15<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family=\"ipv4\" source address=\"192.168.0.100\" port port=3306 protocol=tcp accept'\n\nsudo firewall-cmd --reload\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">9. List all rules<\/h2>\n\n\n\n<p>To list all rules, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo firewall-cmd --list-all<\/pre>\n\n\n\n<p>If you follow all commands from the previous steps, you will receive the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sudo firewall-cmd --list-all\npublic\n  target: default\n  icmp-block-inversion: no\n  interfaces:\n  sources:\n  services: dhcpv6-client ssh\n  ports: 80\/tcp 443\/tcp\n  protocols:\n  forward: yes\n  masquerade: no\n  forward-ports:\n        port=80:proto=tcp:toport=443:toaddr=\n  source-ports:\n  icmp-blocks:\n  rich rules:\n        rule family=\"ipv4\" source address=\"192.168.0.100\" port port=\"3306\" protocol=\"tcp\" accept<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">10. Firewalld Man Command<\/h2>\n\n\n\n<p>Finally, the last command will be the <strong>man<\/strong> for firewalld-cmd, which is very useful if you want to know everything about the firewalld. Execute the command <strong>sudo man firewall-cmd<\/strong>, and you will receive the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sudo man firewall-cmd\nFIREWALL-CMD(1)                                                             firewall-cmd                                                            FIREWALL-CMD(1)\n\nNAME\n       firewall-cmd - firewalld command line client\n\nSYNOPSIS\n       firewall-cmd [OPTIONS...]\n\nDESCRIPTION\n       firewall-cmd is the command line client of the firewalld daemon. It provides an interface to manage the runtime and permanent configurations.\n\n       The runtime configuration in firewalld is separated from the permanent configuration. This means that things can get changed in the runtime or permanent\n       configuration.\n<\/pre>\n\n\n\n<p>That&#8217;s all. In this tutorial, we explained some basic firewalld-cmd commands that are very often used in the world of system administrators and other curious users. If you find it difficult to understand the basic firewalld-cmd commands, you can always contact our technical support, and they will do the rest for you. We are available 24\/7.<\/p>\n\n\n\n<p>If you liked this post about ten useful firewall-cmd commands in <a href=\"https:\/\/www.linuxcloudvps.com\/\">Linux<\/a>, please share it with your friends on social networks using the buttons on the left or simply leave a reply below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post, we are going to explain 10 useful firewall-cmd commands in Linux with real examples. The firewall-cmd is the command-line client used to manage the runtime configurations. It is a firewall solution as an alternative to the iptables service. We know that a properly configured firewall is the only weapon that can &#8230; <a title=\"10 Useful firewall-cmd Commands in Linux\" class=\"read-more\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/\" aria-label=\"More on 10 Useful firewall-cmd Commands in Linux\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":1741,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[191,253,24,27],"class_list":["post-1740","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-cmd","tag-commands","tag-firewall","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>10 Useful firewall-cmd Commands in Linux | LinuxCloudVPS Blog<\/title>\n<meta name=\"description\" content=\"In this blog post, we are going to explain 10 useful firewall-cmd commands in Linux with real examples. The firewall-cmd is the command-line client used\" \/>\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.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"10 Useful firewall-cmd Commands in Linux | LinuxCloudVPS Blog\" \/>\n<meta property=\"og:description\" content=\"In this blog post, we are going to explain 10 useful firewall-cmd commands in Linux with real examples. The firewall-cmd is the command-line client used\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxCloudVPS Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/LinuxCloudVPS\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-30T17:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-29T15:35:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:site\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a\"},\"headline\":\"10 Useful firewall-cmd Commands in Linux\",\"datePublished\":\"2022-07-30T17:30:00+00:00\",\"dateModified\":\"2023-08-29T15:35:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/\"},\"wordCount\":621,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp\",\"keywords\":[\"cmd\",\"commands\",\"firewall\",\"linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/\",\"url\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/\",\"name\":\"10 Useful firewall-cmd Commands in Linux | LinuxCloudVPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp\",\"datePublished\":\"2022-07-30T17:30:00+00:00\",\"dateModified\":\"2023-08-29T15:35:27+00:00\",\"description\":\"In this blog post, we are going to explain 10 useful firewall-cmd commands in Linux with real examples. The firewall-cmd is the command-line client used\",\"breadcrumb\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#primaryimage\",\"url\":\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp\",\"contentUrl\":\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp\",\"width\":742,\"height\":372,\"caption\":\"10 useful firewall cmd commands in linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.linuxcloudvps.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"10 Useful firewall-cmd Commands in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/#website\",\"url\":\"https:\/\/www.linuxcloudvps.com\/blog\/\",\"name\":\"LinuxCloudVPS\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.linuxcloudvps.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/#organization\",\"name\":\"LinuxCloudVPS\",\"url\":\"https:\/\/www.linuxcloudvps.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png\",\"contentUrl\":\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png\",\"width\":217,\"height\":25,\"caption\":\"LinuxCloudVPS\"},\"image\":{\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"http:\/\/www.facebook.com\/LinuxCloudVPS\",\"https:\/\/x.com\/LinuxCloudVPS\",\"http:\/\/www.linkedin.com\/company\/linuxcloudvps-com\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/www.linuxcloudvps.com\/\"],\"url\":\"https:\/\/www.linuxcloudvps.com\/blog\/author\/r0s3admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"10 Useful firewall-cmd Commands in Linux | LinuxCloudVPS Blog","description":"In this blog post, we are going to explain 10 useful firewall-cmd commands in Linux with real examples. The firewall-cmd is the command-line client used","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.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"10 Useful firewall-cmd Commands in Linux | LinuxCloudVPS Blog","og_description":"In this blog post, we are going to explain 10 useful firewall-cmd commands in Linux with real examples. The firewall-cmd is the command-line client used","og_url":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/","og_site_name":"LinuxCloudVPS Blog","article_publisher":"http:\/\/www.facebook.com\/LinuxCloudVPS","article_published_time":"2022-07-30T17:30:00+00:00","article_modified_time":"2023-08-29T15:35:27+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@LinuxCloudVPS","twitter_site":"@LinuxCloudVPS","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#article","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/"},"author":{"name":"admin","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a"},"headline":"10 Useful firewall-cmd Commands in Linux","datePublished":"2022-07-30T17:30:00+00:00","dateModified":"2023-08-29T15:35:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/"},"wordCount":621,"commentCount":5,"publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp","keywords":["cmd","commands","firewall","linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/","name":"10 Useful firewall-cmd Commands in Linux | LinuxCloudVPS Blog","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp","datePublished":"2022-07-30T17:30:00+00:00","dateModified":"2023-08-29T15:35:27+00:00","description":"In this blog post, we are going to explain 10 useful firewall-cmd commands in Linux with real examples. The firewall-cmd is the command-line client used","breadcrumb":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#primaryimage","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2022\/07\/10-useful-firewall-cmd-commands-in-linux.webp","width":742,"height":372,"caption":"10 useful firewall cmd commands in linux"},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxcloudvps.com\/blog\/10-useful-firewall-cmd-commands-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.linuxcloudvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"10 Useful firewall-cmd Commands in Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website","url":"https:\/\/www.linuxcloudvps.com\/blog\/","name":"LinuxCloudVPS","description":"","publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxcloudvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization","name":"LinuxCloudVPS","url":"https:\/\/www.linuxcloudvps.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","width":217,"height":25,"caption":"LinuxCloudVPS"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/www.facebook.com\/LinuxCloudVPS","https:\/\/x.com\/LinuxCloudVPS","http:\/\/www.linkedin.com\/company\/linuxcloudvps-com"]},{"@type":"Person","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/www.linuxcloudvps.com\/"],"url":"https:\/\/www.linuxcloudvps.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/comments?post=1740"}],"version-history":[{"count":2,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1740\/revisions"}],"predecessor-version":[{"id":1959,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1740\/revisions\/1959"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media\/1741"}],"wp:attachment":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}