{"id":2674,"date":"2019-02-10T13:26:14","date_gmt":"2019-02-10T04:26:14","guid":{"rendered":"https:\/\/east19-mikas.com\/?page_id=2674"},"modified":"2019-02-10T13:26:14","modified_gmt":"2019-02-10T04:26:14","slug":"setting-firewall","status":"publish","type":"page","link":"https:\/\/east19-mikas.com\/mpat\/?page_id=2674","title":{"rendered":"Firewall\u306e\u8a2d\u5b9a"},"content":{"rendered":"<div class=\"main2\">\u300cfirewalld\u300d\u306e\u8a2d\u5b9a\u3067\u3059\u3002<\/div>\n<h2><span id=\"firewalld\">firewalld\u306b\u3064\u3044\u3066<\/span><\/h2>\n<p>CentOS7\u3067\u306f\u300cfirewalld\u300d\u304c\u521d\u671f\u72b6\u614b\u3067\u306f\u6709\u52b9\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u300cfirewalld\u300d\u3092\u5236\u5fa1\u3059\u308b\u305f\u3081\u306b\u300cfirewall-cmd\u300d\u3068\u3044\u3046\u30b3\u30de\u30f3\u30c9\u3067\u5236\u5fa1\u3057\u307e\u3059\u3002<\/p>\n<h3><span id=\"firewalld-2\">firewalld\u7a3c\u50cd\u72b6\u6cc1\u3092\u78ba\u8a8d\u3057\u307e\u3059<\/span><\/h3>\n<p>\u300cfirewalld\u300d\u306e\u7a3c\u50cd\u72b6\u6cc1\u306f\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<pre class=\"d2\"># <span class=\"cylo\">firewall-cmd --state<\/span>\n<\/pre>\n<h4>\u5b9f\u884c\u4f8b<\/h4>\n<p>\u300cfirewalld\u300d\u304c\u52d5\u4f5c\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u300crunning\u300d\u3001\u505c\u6b62\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u300cnot running\u300d\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<h5>\u52d5\u4f5c\u4e2d<\/h5>\n<pre class=\"d2\"># <span class=\"cylo\">firewall-cmd --state<\/span>\nrunning\n<\/pre>\n<h5>\u505c\u6b62\u4e2d<\/h5>\n<pre class=\"d2\"># <span class=\"cylo\">firewall-cmd --state<\/span>\nnot running\n<\/pre>\n<h2>firewalld\u306e\u8a2d\u5b9a\u3067\u3059<\/h2>\n<h3>Apache\u306e\u8a2d\u5b9a\u3067\u3059<\/h3>\n<p>Apache\u306e\u901a\u4fe1\u306f\u3001http\u3068https\u306e\u901a\u4fe1\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"d2\">\n# <span class=\"cylo\">firewall-cmd --permanent --zone=public --add-service=http<\/span>\n# <span class=\"cylo\">firewall-cmd --permanent --zone=public --add-port=80\/tcp<\/span>\n# <span class=\"cylo\">firewall-cmd --permanent --zone=public --add-service=https<\/span>\n# <span class=\"cylo\">firewall-cmd --permanent --zone=public --add-port=443\/tcp<\/span>\n# <span class=\"cylo\">firewall-cmd --reload<\/span>\nsuccess\n<\/pre>\n<p>\u5ff5\u306e\u70ba\u3001\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"d2\">\n# <span class=\"cylo\">firewall-cmd --list-all<\/span>\npublic (active)\n  target: default\n  icmp-block-inversion: no\n  interfaces: enp2s0\n  sources: \n  services: dhcpv6-client ssh http https\n  ports: 21\/tcp 22\/tcp 443\/tcp 80\/tcp\n  protocols: \n  masquerade: no\n  forward-ports: \n  source-ports: \n  icmp-blocks: \n  rich rules: \n<\/pre>\n<h3>Postfix\u306e\u8a2d\u5b9a\u3067\u3059<\/h3>\n<pre class=\"d2\">\n# <span class=\"cylo\">firewall-cmd --permanent --zone=public --add-service=smtp<\/span>\n# <span class=\"cylo\">firewall-cmd --permanent --zone=public --add-port=25\/tcp<\/span>\n# <span class=\"cylo\">firewall-cmd --reload<\/span>\nsuccess\n<\/pre>\n<p>\u8a2d\u5b9a\u306e\u78ba\u8a8d\u3092\u3057\u307e\u3059<\/p>\n<pre class=\"d2\">\n# <span class=\"cylo\">firewall-cmd --list-all<\/span>\npublic (active)\n  target: default\n  icmp-block-inversion: no\n  interfaces: enp2s0\n  sources: \n  services: dhcpv6-client ssh http https smtp\n  ports: 21\/tcp 22\/tcp 443\/tcp 80\/tcp 25\/tcp\n  protocols: \n  masquerade: no\n  forward-ports: \n  source-ports: \n  icmp-blocks: \n  rich rules:\n<\/pre>\n<p>\u306a\u304a\u3001\u9593\u9055\u3048\u3066\u767b\u9332\u3057\u305f\u5834\u5408\u306e\u524a\u9664\u306f<\/p>\n<h3>\u30b5\u30fc\u30d3\u30b9\u3092\u524a\u9664\u3059\u308b\u5834\u5408<\/h3>\n<p>\u30be\u30fc\u30f3\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u30b5\u30fc\u30d3\u30b9\u3092\u524a\u9664\u3059\u308b\u306b\u306f\u300c&#8211;remove-service\u300d\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"d2\">firewall-cmd [--permanent] --zone=\u30be\u30fc\u30f3\u540d --remove-service=\u30b5\u30fc\u30d3\u30b9\u540d\n<\/pre>\n<p>\u5148\u307b\u3069\u8a2d\u5b9a\u3057\u305f\u300chttp\u300d\u30b5\u30fc\u30d3\u30b9\u3092\u300cpublic\u300d\u30be\u30fc\u30f3\u304b\u3089\u524a\u9664\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"d2\"># <span class=\"cylo\">firewall-cmd --permanent --zone=public --remove-service=http<\/span>\nsuccess\n# firewall-cmd --reload\nsuccess\n<\/pre>\n<h3>\u30dd\u30fc\u30c8\u306e\u524a\u9664\u306e\u5834\u5408<\/h3>\n<p>\u30be\u30fc\u30f3\u304b\u3089\u30dd\u30fc\u30c8\u3092\u524a\u9664\u3059\u308b\u306b\u306f\u300c&#8211;remove-port\u300d\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"d2\">firewall-cmd [--permanent]--zone=\u30be\u30fc\u30f3 --remove-port=\u30dd\u30fc\u30c8\u756a\u53f7\/\u30d7\u30ed\u30c8\u30b3\u30eb\n<\/pre>\n<h2>\u8d77\u52d5\u30fb\u505c\u6b62\u65b9\u6cd5<\/h2>\n<p>\u300cfirewalld\u300d\u306f\u300csystemd\u300d\u3067\u5236\u5fa1\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u8d77\u52d5\u3068\u505c\u6b62\u306b\u306f\u300csystemctl\u300d\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<h3><span id=\"firewalld-3\">firewalld\u306e\u8d77\u52d5<\/span><\/h3>\n<pre class=\"d2\"># <span style=\"color:#ff0;\">systemctl start firewalld<\/span>\n<\/pre>\n<h3><span id=\"firewalld-4\">firewalld\u306e\u505c\u6b62<\/span><\/h3>\n<pre class=\"d2\"># <span style=\"color:#ff0;\">systemctl stop firewalld<\/span>\n<\/pre>\n<h3><span id=\"i-11\">\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a<\/span><\/h3>\n<pre class=\"d2\">\n# <span style=\"color:#ff0;\">systemctl enable firewalld<\/span>\nsuccess\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u300cfirewalld\u300d\u306e\u8a2d\u5b9a\u3067\u3059\u3002 firewalld\u306b\u3064\u3044\u3066 CentOS7\u3067\u306f\u300cfirewalld\u300d\u304c\u521d\u671f\u72b6\u614b\u3067\u306f\u6709\u52b9\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u300cfirewalld\u300d\u3092\u5236\u5fa1\u3059\u308b\u305f\u3081\u306b\u300cfirewall-cmd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1824,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-2674","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/pages\/2674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2674"}],"version-history":[{"count":0,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/pages\/2674\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=\/wp\/v2\/pages\/1824"}],"wp:attachment":[{"href":"https:\/\/east19-mikas.com\/mpat\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}