{"id":267,"date":"2023-02-04T12:41:49","date_gmt":"2023-02-04T04:41:49","guid":{"rendered":"http:\/\/39.104.58.144\/?p=267"},"modified":"2023-02-07T19:37:32","modified_gmt":"2023-02-07T11:37:32","slug":"firewall","status":"publish","type":"post","link":"http:\/\/www.algmain.com\/index.php\/2023\/02\/04\/firewall\/","title":{"rendered":"\u914d\u7f6e\u9632\u706b\u5899"},"content":{"rendered":"\n<p>firewalld\uff08Dynamic Firewall Manager of Linux Systems\uff0cLinux\u7cfb\u7edf\u7684\u52a8\u6001\u9632\u706b\u5899\u7ba1\u7406\u5668\uff09\u670d\u52a1\u662f\u9ed8\u8ba4\u7684\u9632\u706b\u5899\u914d\u7f6e\u7ba1\u7406\u5de5\u5177\u3002<\/p>\n\n\n\n<p>\u914d\u7f6e\u9632\u706b\u5899\u5f00\u673a\u542f\u52a8\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#systemctl enable firewalld\n......\n<\/pre><\/div>\n\n\n<p>\u5f00\u542f\u9632\u706b\u5899\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#systemctl start firewalld\n......\n<\/pre><\/div>\n\n\n<p>\u67e5\u8be2\u5df2\u5f00\u542f\u7684\u670d\u52a1\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# firewall-cmd --list-service\ndhcpv6-client http ssh\n<\/pre><\/div>\n\n\n<p>\u76ee\u524d\u670d\u52a1\u5668\u5df2\u7ecf\u5f00\u542fHTTP\uff08\u7aef\u53e380\uff09\u548cSSH\uff08\u7aef\u53e322\uff09\u670d\u52a1\u3002<\/p>\n\n\n\n<p>\u67e5\u8be2\u5df2\u5f00\u542f\u7684\u7aef\u53e3\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# firewall-cmd --list-ports\n\n<\/pre><\/div>\n\n\n<p>\u76ee\u524d\u9664\u5df2\u5f00\u542f\u7684\u670d\u52a1\u7aef\u53e3\u5916\uff0c\u65e0\u5176\u4ed6\u53e6\u884c\u914d\u7f6e\u7684\u7aef\u53e3\u3002<\/p>\n\n\n\n<p>\u589e\u52a0\u989d\u5916\u7684TCP\u7aef\u53e38080\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#firewall-cmd --permanent --zone=public --add-port=8080\/tcp\nsuccess\n<\/pre><\/div>\n\n\n<p>\u5237\u65b0\u9632\u706b\u5899\u914d\u7f6e\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#firewall-cmd --reload\n......\n<\/pre><\/div>\n\n\n<p><em>\u6ce8\u610f\uff1a\u963f\u91cc\u4e91\u670d\u52a1\u5668\u6709\u4e24\u5c42\u9632\u706b\u5899\u914d\u7f6e\u3002\u670d\u52a1\u5668\u4e0a\u4f7f\u7528firewall-cmd\u53ef\u4ee5\u8fdb\u884c\u8bbe\u7f6e\u3002\u8fd8\u6709\u4e00\u5c42\u9632\u706b\u5899\u9700\u8981\u901a\u8fc7\u963f\u91cc\u4e91\u540e\u53f0\u8fdb\u884c\u8bbe\u7f6e\u3002\u5426\u5219\uff0c\u5373\u4f7f\u672c\u673a\u5f00\u653e\u67d0\u4e2a\u7aef\u53e3\uff0c\u5916\u7f51\u4f9d\u7136\u65e0\u6cd5\u8bbf\u95ee\u3002<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"475\" src=\"http:\/\/39.104.58.144\/wp-content\/uploads\/2023\/02\/aliyunfirewall-1024x475.png\" alt=\"\" class=\"wp-image-268\" srcset=\"http:\/\/www.algmain.com\/wp-content\/uploads\/2023\/02\/aliyunfirewall-1024x475.png 1024w, http:\/\/www.algmain.com\/wp-content\/uploads\/2023\/02\/aliyunfirewall-300x139.png 300w, http:\/\/www.algmain.com\/wp-content\/uploads\/2023\/02\/aliyunfirewall-768x356.png 768w, http:\/\/www.algmain.com\/wp-content\/uploads\/2023\/02\/aliyunfirewall.png 1537w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">\u963f\u91cc\u4e91\u9632\u706b\u5899\u914d\u7f6e<\/figcaption><\/figure>\n\n\n\n<p>\u5220\u9664\u989d\u5916\u7684TCP\u7aef\u53e38080\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#firewall-cmd --permanent --zone=public --remove-port=8080\/tcp\n......\n<\/pre><\/div>\n\n\n<p>\u5237\u65b0\u9632\u706b\u5899\u914d\u7f6e\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#firewall-cmd --reload\n......\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u5e38\u7528\u547d\u4ee4<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#\u67e5\u770b\u9632\u706b\u5899\u72b6\u6001\nfirewall-cmd --state\n#\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u3002\n#\u6bcf\u6b21\u6dfb\u52a0\u548c\u4fee\u6539\u89c4\u5219\u540e\uff0c\u5747\u9700\u8981\u91cd\u65b0\u52a0\u8f7d\u624d\u80fd\u751f\u6548\u3002\nfirewall-cmd --reload\n#\u5217\u51fa\u652f\u6301\u7684zone\u3002\nfirewall-cmd --get-zones\n#\u5217\u51fa\u652f\u6301\u7684\u670d\u52a1\u3002\nfirewall-cmd --get-services\n#\u4e34\u65f6\u5f00\u653eFTP\u670d\u52a1\nfirewall-cmd --add-service=ftp\n#\u6c38\u4e45\u5f00\u653eFTP\u670d\u52a1\nfirewall-cmd --add-service=ftp --permanent\n#\u6c38\u4e45\u79fb\u9664FTP\u670d\u52a1\nfirewall-cmd --remove-service=ftp --permanent\n#\u67e5\u770b\u5df2\u5f00\u653e\u7684\u7aef\u53e3\nfirewall-cmd --list-ports\n#\u6c38\u4e45\u6dfb\u52a08080\u7aef\u53e3\nfirewall-cmd --add-port=8080\/tcp --permanent\n#\u6c38\u4e45\u5220\u96648080\u7aef\u53e3\nfirewall-cmd --remove-port=8080\/tcp --permanent\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>firewalld\uff08Dynamic Firewall Manager of Linux Systems\uff0cLin [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[11,25,10],"class_list":["post-267","post","type-post","status-publish","format-standard","hentry","category-technology","tag-centos","tag-firewall","tag-linux"],"_links":{"self":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts\/267"}],"collection":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/comments?post=267"}],"version-history":[{"count":4,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts\/267\/revisions"}],"predecessor-version":[{"id":737,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/posts\/267\/revisions\/737"}],"wp:attachment":[{"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/media?parent=267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/categories?post=267"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.algmain.com\/index.php\/wp-json\/wp\/v2\/tags?post=267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}