{"id":8069,"date":"2023-01-14T21:29:22","date_gmt":"2023-01-14T20:29:22","guid":{"rendered":"http:\/\/roglacup.com\/klaus62\/?p=8069"},"modified":"2023-02-24T12:13:36","modified_gmt":"2023-02-24T11:13:36","slug":"linux-firewall-firewalld-firewall-cmd-firewall-config","status":"publish","type":"post","link":"https:\/\/roglacup.com\/klaus62\/2023\/01\/14\/linux-firewall-firewalld-firewall-cmd-firewall-config\/","title":{"rendered":"Linux Firewall (firewalld, firewall-cmd, firewall-config)"},"content":{"rendered":"\n<p>Fedora 18 introduced&nbsp;<code>firewalld<\/code>&nbsp;as a replacement for the previous&nbsp;<code>iptables service<\/code>. Since RHEL7 and Oracle Linux 7 are based on Fedora 19, the switch from&nbsp;<code>iptables service<\/code>&nbsp;to&nbsp;<code>firewalld<\/code>&nbsp;is now part of the Enterprise Linux distributions. This article is a rework of the&nbsp;<a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall\">previous Linux Firewall article<\/a>, bringing it up to date.<\/p>\n\n\n\n<p>&nbsp;You need to distinguish between the&nbsp;<code>iptables service<\/code>&nbsp;and the&nbsp;<code>iptables<\/code>&nbsp;command. Although&nbsp;<code>firewalld<\/code>&nbsp;is a replacement for the firewall management provided by&nbsp;<code>iptables service<\/code>, it still uses the&nbsp;<code>iptables<\/code>&nbsp;command for dynamic communication with the kernel packet filter (netfilter). So it is only the&nbsp;<code>iptables service<\/code>&nbsp;that is replaced, not the&nbsp;<code>iptables<\/code>&nbsp;command. That can be a confusing distinction at first.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall-firewalld#reverting-to-iptables\">Reverting to the iptables Service<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall-firewalld#installation\">Installation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall-firewalld#firewall-config\">firewall-config<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall-firewalld#firewall-cmd\">firewall-cmd<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall-firewalld#backups-and-transfers\">Backups and Transfers of Firewall Configuration<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall-firewalld#quick-database-setup\">Quick Database Setup<\/a><\/li>\n<\/ul>\n\n\n\n<p>Related articles.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall\">Linux Firewall (iptables, system-config-firewall)<\/a><\/li>\n<\/ul>\n\n\n\n<p><a><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reverting to the iptables Service<\/h2>\n\n\n\n<p>If you are not ready to make the break to&nbsp;<code>firewalld<\/code>, you can still use the&nbsp;<code>iptables service<\/code>&nbsp;by issuing the following commands.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl stop firewalld\n# systemctl disable firewalld\n\n# iptables-service\n\n# touch \/etc\/sysconfig\/iptables\n# systemctl start iptables\n# systemctl enable iptables\n\n# touch \/etc\/sysconfig\/ip6tables\n# systemctl start ip6tables\n# systemctl enable ip6table<\/pre>\n\n\n\n<p>From this point forward, firewall administration will be similar to that described&nbsp;<a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall\">here<\/a>.<\/p>\n\n\n\n<p>The rest of this article assumes you are going to use&nbsp;<code>firewalld<\/code>.<a><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installation<\/h2>\n\n\n\n<p>Most installations will include the firewall functionality, but if you need to manually install it, do the following.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum install firewalld firewall-config<\/pre>\n\n\n\n<p>Make sure the service is started and will auto-start on reboot.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl start firewalld.service\n# systemctl enable firewalld.service<\/pre>\n\n\n\n<p>You can check the current status of the service using the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl status firewalld\nfirewalld.service - firewalld - dynamic firewall daemon\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/firewalld.service; enabled)\n   Active: active (running) since Sun 2014-04-20 14:06:46 BST; 30s ago\n Main PID: 13246 (firewalld)\n   CGroup: \/system.slice\/firewalld.service\n           \u2514\u250013246 \/usr\/bin\/python \/usr\/sbin\/firewalld --nofork --nopid\n\nApr 20 14:06:44 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...\nApr 20 14:06:46 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.\n#<\/pre>\n\n\n\n<p>To disable the firewall, run the following commands.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl stop firewalld.service\n# systemctl disable firewalld.service<\/pre>\n\n\n\n<p><a><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">firewall-config<\/h2>\n\n\n\n<p>The GUI screen to control the firewall is available from the menu.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Fedora : System &gt; Administration &gt; Firewall<\/li>\n\n\n\n<li>RHEL7\/OL7 : Applications &gt; Sundry &gt; Firewall<\/li>\n<\/ul>\n\n\n\n<p>Alternatively, if can be started from the command line using the&nbsp;<code>firewall-config<\/code>&nbsp;command. If it is not already present, it can be installed using the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum install firewall-config<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Posted from: <a href=\"https:\/\/oracle-base.com\/articles\/linux\/linux-firewall-firewalld\">https:\/\/oracle-base.com\/articles\/linux\/linux-firewall-firewalld<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>How to restart Network Interface \/ Network Adapter on Linux &amp; Windows Cloud Servers<\/strong>| <strong>Rocky Linux<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Use the following command to restart the server networking service.<code># nmcli networking off # nmcli networking on or # systemctl restart NetworkManager <\/code><img decoding=\"async\" src=\"https:\/\/www.layerstack.com\/img\/docs\/resources\/restartnetworkrockylinux1.png\" alt=\"restartnetworkrockylinux1\"><img decoding=\"async\" src=\"https:\/\/www.layerstack.com\/img\/docs\/resources\/restartnetworkrockylinux2.png\" alt=\"restartnetworkrockylinux2\"><\/li>\n\n\n\n<li>Either of the below commands can be executed to check the status of the networking service.<code># nmcli -o or # systemctl status NetworkManager <\/code><img decoding=\"async\" src=\"https:\/\/www.layerstack.com\/img\/docs\/resources\/restartnetworkrockylinux3.png\" alt=\"restartnetworkrockylinux3\"><img decoding=\"async\" src=\"https:\/\/www.layerstack.com\/img\/docs\/resources\/restartnetworkrockylinux4.png\" alt=\"restartnetworkrockylinux14\"><\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Use the following command to restart the server networking service.<code># nmcli networking off # nmcli networking on or # systemctl restart NetworkManager <\/code><img decoding=\"async\" src=\"https:\/\/www.layerstack.com\/img\/docs\/resources\/restartnetworkrockylinux1.png\" alt=\"restartnetworkrockylinux1\"><img decoding=\"async\" src=\"https:\/\/www.layerstack.com\/img\/docs\/resources\/restartnetworkrockylinux2.png\" alt=\"restartnetworkrockylinux2\"><\/li>\n\n\n\n<li>Either of the below commands can be executed to check the status of the networking service.<code># nmcli -o or # systemctl status NetworkManager <\/code><img decoding=\"async\" src=\"https:\/\/www.layerstack.com\/img\/docs\/resources\/restartnetworkrockylinux3.png\" alt=\"restartnetworkrockylinux3\"><img decoding=\"async\" src=\"https:\/\/www.layerstack.com\/img\/docs\/resources\/restartnetworkrockylinux4.png\" alt=\"restartnetworkrockylinux14\"><\/li>\n<\/ol>\n\n\n\n<p>Posted from: <a href=\"https:\/\/www.layerstack.com\/resources\/tutorials\/How-to-restart-Network-Interface-or-Network-Adapter-on-Linux-and-Windows-Cloud-Servers\">https:\/\/www.layerstack.com\/resources\/tutorials\/How-to-restart-Network-Interface-or-Network-Adapter-on-Linux-and-Windows-Cloud-Servers<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fedora 18 introduced&nbsp;firewalld&nbsp;as a replacement for the previous&nbsp;iptables service. Since RHEL7 and Oracle Linux 7 are based on Fedora 19, the switch from&nbsp;iptables service&nbsp;to&nbsp;firewalld&nbsp;is now part of the Enterprise Linux distributions. This article is a rework of the&nbsp;previous Linux Firewall article, bringing it up to date. &nbsp;You need to distinguish between the&nbsp;iptables service&nbsp;and the&nbsp;iptables&nbsp;command. Although&nbsp;firewalld&nbsp;is&hellip;&nbsp;<a href=\"https:\/\/roglacup.com\/klaus62\/2023\/01\/14\/linux-firewall-firewalld-firewall-cmd-firewall-config\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Linux Firewall (firewalld, firewall-cmd, firewall-config)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":8073,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[17],"tags":[],"class_list":["post-8069","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/8069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/comments?post=8069"}],"version-history":[{"count":3,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/8069\/revisions"}],"predecessor-version":[{"id":8442,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/8069\/revisions\/8442"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/media\/8073"}],"wp:attachment":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/media?parent=8069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/categories?post=8069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/tags?post=8069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}