{"id":760,"date":"2023-08-29T12:14:51","date_gmt":"2023-08-29T12:14:51","guid":{"rendered":"https:\/\/ictbank.ir\/blog\/?p=760"},"modified":"2023-11-01T06:17:52","modified_gmt":"2023-11-01T06:17:52","slug":"block-an-ip-address-in-firewall-cmd","status":"publish","type":"post","link":"https:\/\/ictbank.ir\/blog\/block-an-ip-address-in-firewall-cmd\/","title":{"rendered":"Block an IP address in firewall-cmd"},"content":{"rendered":"\n<p>Sometimes you need to block an IP address (or a range of IP addresses) from accessing your machine. In this case firewall-cmd can help you through these commands:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfirewall-cmd --permanent --add-rich-rule=&quot;rule family=&#039;ipv4&#039; source address=&#039;xxx.xxx.xxx.xxx\/xx&#039; drop&quot;\nfirewall-cmd --reload\nfirewall-cmd --list-all\n<\/pre><\/div>\n\n\n<p>And finally, if you decide to remove this rule, you can use these commands:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfirewall-cmd --permanent --remove-rich-rule=&quot;rule family=&#039;ipv4&#039; source address=&#039;xxx.xxx.xxx.xxx\/xx&#039; drop&quot;\nfirewall-cmd --reload\nfirewall-cmd --list-all\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Sometimes you need to block an IP address (or a range of IP addresses) from accessing your machine. In this case firewall-cmd can help you through these commands: And finally, if you decide to remove this rule, you can use these commands:<\/p>\n","protected":false},"author":2,"featured_media":768,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-760","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-installation"],"_links":{"self":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/comments?post=760"}],"version-history":[{"count":1,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/760\/revisions"}],"predecessor-version":[{"id":761,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/760\/revisions\/761"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/media\/768"}],"wp:attachment":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/media?parent=760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/categories?post=760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/tags?post=760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}