{"id":191,"date":"2024-02-25T00:50:05","date_gmt":"2024-02-24T16:50:05","guid":{"rendered":"https:\/\/669082.xyz\/?p=191"},"modified":"2024-02-25T00:50:50","modified_gmt":"2024-02-24T16:50:50","slug":"centos7%e9%98%b2%e7%81%ab%e5%a2%99%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/669082.xyz\/index.php\/2024\/02\/25\/centos7%e9%98%b2%e7%81%ab%e5%a2%99%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c\/","title":{"rendered":"centos7\u9632\u706b\u5899\u57fa\u672c\u64cd\u4f5c"},"content":{"rendered":"<pre><code class=\"language-shell\">\u67e5\u770b\u9632\u706b\u5899\u72b6\u6001\uff1a firewall-cmd --state\n\u5173\u95ed\u9632\u706b\u5899\uff1a   systemctl stop firewalld\n\u5f00\u673a\u81ea\u5173\u95ed\uff1a   systemctl disable firewalld\n\u6253\u5f00\u9632\u706b\u5899\uff1a   systemctl start firewalld\n\u5f00\u673a\u81ea\u6253\u5f00\uff1a   systemctl enable firewalld\n\n\u67e5\u770b\u5df2\u7ecf\u751f\u6548\u7684\u89c4\u5219:           firewall-cmd --list-all\n\u67e5\u770b\u6240\u6709\u6253\u5f00\u7684\u7aef\u53e3(\u516c\u5f00\u7684)\uff1a firewall-cmd --zone=public --list-ports\n\u4f7f\u914d\u7f6e\u751f\u6548(\u91cd\u8f7d\u9632\u706b\u5899\u914d\u7f6e)\uff1a firewall-cmd --reload\n\n\u5f00\u653e1\u4e2a\u6216\u591a\u4e2a\u7aef\u53e3:           firewall-cmd --permanent --zone=public --add-port=8080-8090\/tcp\n\u5220\u96641\u4e2a\u6216\u591a\u4e2a\u7aef\u53e3:           firewall-cmd --permanent --zone=public --remove-port=8888\/tcp\n\n\u9488\u5bf9\u67d0\u4e2aIP\u5f00\u653e1\u4e2a\u7aef\u53e3:        firewall-cmd --permanent --add-rich-rule=&quot;rule family=&quot;ipv4&quot; source address=&quot;192.168.88.1&quot; port protocol=&quot;tcp&quot; port=&quot;88&quot; accept&quot;\n\u9488\u5bf9\u67d0\u4e2aIP\u5220\u96641\u4e2a\u7aef\u53e3:        firewall-cmd --permanent --remove-rich-rule=&quot;rule family=&quot;ipv4&quot; source address=&quot;192.168.88.1&quot; port protocol=&quot;tcp&quot; port=&quot;88&quot; accept&quot;  \n\n\u9488\u5bf9\u67d0\u4e2aIP\u5f00\u653e\u7aef\u53e3\u6bb5:         firewall-cmd --permanent --add-rich-rule=&quot;rule family=&quot;ipv4&quot; source address=&quot;192.168.88.1&quot; port protocol=&quot;tcp&quot; port=&quot;10-31000&quot; accept&quot; \n\u9488\u5bf9\u67d0\u4e2aIP\u5220\u9664\u7aef\u53e3\u6bb5:         firewall-cmd --permanent --remove-rich-rule=&quot;rule family=&quot;ipv4&quot; source address=&quot;192.168.88.1&quot; port protocol=&quot;udp&quot; port=&quot;10-31000&quot; accept&quot;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u770b\u9632\u706b\u5899\u72b6\u6001\uff1a firewall-cmd &#8211;state \u5173\u95ed\u9632\u706b\u5899\uff1a systemctl sto [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-191","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":2,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":193,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts\/191\/revisions\/193"}],"wp:attachment":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}