{"id":7,"date":"2025-01-01T07:46:41","date_gmt":"2025-01-01T07:46:41","guid":{"rendered":"https:\/\/docs.marisabel.nl\/?p=7"},"modified":"2025-01-02T08:22:22","modified_gmt":"2025-01-02T08:22:22","slug":"firewall-management","status":"publish","type":"post","link":"https:\/\/docs.marisabel.nl\/?p=7","title":{"rendered":"Firewall Management"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Here\u2019s a concise list of commands for managing <strong>firewalld<\/strong> on AlmaLinux:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Basic Commands<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start firewalld\nsudo systemctl stop firewalld\nsudo systemctl restart firewalld\nsudo systemctl enable firewalld\nsudo systemctl disable firewalld\nsudo firewall-cmd --state\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Managing Rules<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --permanent --add-service=&lt;service>\nsudo firewall-cmd --permanent --remove-service=&lt;service>\nsudo firewall-cmd --permanent --add-port=&lt;port>\/tcp\nsudo firewall-cmd --permanent --remove-port=&lt;port>\/tcp\nsudo firewall-cmd --permanent --add-port=&lt;xxx-yyy>\/tcp\nsudo firewall-cmd --permanent --add-port=&lt;xxx-yyy>\/udp\nsudo firewall-cmd --reload\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Viewing Configuration<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --list-all\nsudo firewall-cmd --list-ports\nsudo firewall-cmd --list-services\nsudo firewall-cmd --get-active-zones\nsudo firewall-cmd --query-service=&lt;service&gt;\nsudo firewall-cmd --query-port=&lt;port&gt;\/tcp\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Zone Management<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --get-zones\nsudo firewall-cmd --permanent --zone=&lt;zone&gt; --add-service=&lt;service&gt;\nsudo firewall-cmd --permanent --zone=&lt;zone&gt; --remove-service=&lt;service&gt;\nsudo firewall-cmd --permanent --zone=&lt;zone&gt; --add-port=&lt;port&gt;\/tcp\nsudo firewall-cmd --permanent --zone=&lt;zone&gt; --remove-port=&lt;port&gt;\/tcp\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Direct Rules (Advanced)<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --direct --add-rule ipv4 filter INPUT &lt;priority&gt; -p tcp --dport &lt;port&gt; -j ACCEPT\nsudo firewall-cmd --direct --remove-rule ipv4 filter INPUT &lt;priority&gt; -p tcp --dport &lt;port&gt; -j ACCEPT\nsudo firewall-cmd --direct --list-all\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here\u2019s a concise list of commands for managing firewalld on AlmaLinux: Basic Commands Managing Rules Viewing Configuration Zone Management Direct Rules (Advanced)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[6,5,7],"class_list":["post-7","post","type-post","status-publish","format-standard","hentry","category-commands","category-linux","tag-commands","tag-firewall","tag-firewalld","entry"],"_links":{"self":[{"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/posts\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7"}],"version-history":[{"count":2,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":16,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=\/wp\/v2\/posts\/7\/revisions\/16"}],"wp:attachment":[{"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.marisabel.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}