{"id":216,"date":"2024-02-29T09:29:07","date_gmt":"2024-02-29T01:29:07","guid":{"rendered":"https:\/\/669082.xyz\/?p=216"},"modified":"2024-02-29T10:24:56","modified_gmt":"2024-02-29T02:24:56","slug":"centos7%e9%98%b2%e7%81%ab%e5%a2%99%e6%8b%92%e7%bb%9d%e5%87%ba%e7%ab%99%e6%b5%81%e9%87%8f","status":"publish","type":"post","link":"https:\/\/669082.xyz\/index.php\/2024\/02\/29\/centos7%e9%98%b2%e7%81%ab%e5%a2%99%e6%8b%92%e7%bb%9d%e5%87%ba%e7%ab%99%e6%b5%81%e9%87%8f\/","title":{"rendered":"centos7\u9632\u706b\u5899\u62d2\u7edd\u51fa\u7ad9\u6d41\u91cf"},"content":{"rendered":"<pre><code class=\"language-shell\">firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -m state --state ESTABLISHED,RELATED -j ACCEPT \n\nfirewall-cmd --direct --add-rule ipv4 filter OUTPUT 2 -j DROP\n\nfirewall-cmd --reload\n\n#\u67e5\u770b\u89c4\u5219\nfirewall-cmd --direct --get-all-rules<\/code><\/pre>\n<p>\u53c2\u8003\u8d44\u6599<br \/>\n<a href=\"https:\/\/serverfault.com\/questions\/618164\/block-outgoing-connections-on-rhel7-centos7-with-firewalld\">https:\/\/serverfault.com\/questions\/618164\/block-outgoing-connections-on-rhel7-centos7-with-firewalld<\/a><\/p>\n<p><a href=\"https:\/\/unix.stackexchange.com\/questions\/755756\/using-zones-in-firewalld-to-block-outbound-access\">https:\/\/unix.stackexchange.com\/questions\/755756\/using-zones-in-firewalld-to-block-outbound-access<\/a><\/p>\n<p><a href=\"https:\/\/superuser.com\/questions\/1391650\/how-can-i-configure-firewalld-to-block-all-outgoing-traffic-except-for-specific\">https:\/\/superuser.com\/questions\/1391650\/how-can-i-configure-firewalld-to-block-all-outgoing-traffic-except-for-specific<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>firewall-cmd &#8211;direct &#8211;add-rule ipv4 filter OUTPU [&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-216","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts\/216","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=216"}],"version-history":[{"count":2,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":218,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/posts\/216\/revisions\/218"}],"wp:attachment":[{"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/669082.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}