{"id":640,"date":"2020-03-10T10:17:54","date_gmt":"2020-03-10T02:17:54","guid":{"rendered":"https:\/\/www.linuxdevops.cn\/?p=640"},"modified":"2020-03-10T10:17:56","modified_gmt":"2020-03-10T02:17:56","slug":"centos7-firewall-firewalld-port-forwarding","status":"publish","type":"post","link":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/","title":{"rendered":"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1"},"content":{"rendered":"\n
 https:\/\/www.cnblogs.com\/suyj\/p\/11774837.html<\/a> \n\n\u67e5\u770b\u4e00\u4e2amasquerade\u72b6\u6001\uff0c\u67e5\u8be2\u547d\u4ee4\u5982\u4e0b:\nfirewall-cmd --query-masquerade\n\u5047\u5982\u67e5\u5230\u7ed3\u679c\u4e3ano\u90a3\u4e48\u5c31\u542f\u52a8\u5b83\uff08\u52a0--permanent\u662f\u6c38\u4e45\uff09\nfirewall-cmd --add-masquerade --permanent\n\n\u73b0\u5728\u51c6\u5907\u5de5\u4f5c\u597d\u4e86\uff0c\u5047\u5982\u6211\u4eec\u8981\u628a\u5f53\u524dDMZ\u533a\u7684a\u7aef\u53e3\u6620\u5c04\u4e3a\u5185\u7f51xxx.xxx.xxx.xxx:b\u8fd9\u4e2a\u5730\u5740\u4e0a\uff0c\u9996\u5148\u9632\u706b\u5899\u6253\u5f00a\u7aef\u53e3\nfirewall-cmd --zone=public --add-port=\u5bf9\u5916\u7aef\u53e3\/tcp --permanent (\u5927\u5bb6\u770b\u6e05\u695a\uff0c\u91cc\u9762\u7684a\u66ff\u6362\u4e3a\u6240\u9700\u8981\u5bf9\u5916\u7684\u7aef\u53e3)\n\u63a5\u4e0b\u6765\u5c31\u662f\u6620\u5c04\nfirewall-cmd --permanent --zone=public --add-forward-port=port=\u5bf9\u5916\u7aef\u53e3:proto=tcp:toaddr=\u6570\u636e\u5c42\u5185\u7f51ip:toport=\u6570\u636e\u5c42\u57fa\u7840\u670d\u52a1\u7aef\u53e3\u53f7\n\u91cd\u65b0\u52a0\u8f7d\nfirewall-cmd --reload\n\u67e5\u770b\u4e00\u4e0b\u7ed3\u679c\nfirewall-cmd --zone=public --list-all\n\u5982\u65e0\u610f\u5916\u6620\u5c04\u6210\u529f\u9700\u8981\u5220\u9664\u7684\u8bdd\u5982\u4e0b\uff1a\nfirewall-cmd --permanent --zone=public --remove-forward-port=port=\u5bf9\u5916\u7aef\u53e3:proto=tcp:toaddr=\u6570\u636e\u5c42\u5185\u7f51ip:toport=\u6570\u636e\u5c42\u57fa\u7840\u670d\u52a1\u7aef\u53e3\u53f7 <\/pre>\n","protected":false},"excerpt":{"rendered":"

https:\/\/www.cnblogs.com\/suyj\/p\/11774837.html \u67e5\u770b\u4e00\u4e2amasque<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"yoast_head":"\ncentos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\" \/>\n<meta property=\"og:description\" content=\"https:\/\/www.cnblogs.com\/suyj\/p\/11774837.html \u67e5\u770b\u4e00\u4e2amasque\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-10T02:17:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-10T02:17:56+00:00\" \/>\n<meta name=\"author\" content=\"\u7ba1\u7406\u5458\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/\"},\"author\":{\"name\":\"\u7ba1\u7406\u5458\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"headline\":\"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1\",\"datePublished\":\"2020-03-10T02:17:54+00:00\",\"dateModified\":\"2020-03-10T02:17:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/\"},\"wordCount\":2,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"articleSection\":[\"Linux\"],\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/\",\"name\":\"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\"},\"datePublished\":\"2020-03-10T02:17:54+00:00\",\"dateModified\":\"2020-03-10T02:17:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.linuxdevops.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\",\"item\":\"https:\/\/www.linuxdevops.cn\/linux\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\",\"url\":\"https:\/\/www.linuxdevops.cn\/\",\"name\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\",\"description\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0\",\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"alternateName\":\"linuxdevops\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.linuxdevops.cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-CN\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\",\"name\":\"\u7ba1\u7406\u5458\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"contentUrl\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"width\":512,\"height\":512,\"caption\":\"\u7ba1\u7406\u5458\"},\"logo\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\"},\"description\":\"\u7ba1\u7406\u5458\",\"url\":\"https:\/\/www.linuxdevops.cn\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/","og_locale":"zh_CN","og_type":"article","og_title":"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","og_description":"https:\/\/www.cnblogs.com\/suyj\/p\/11774837.html \u67e5\u770b\u4e00\u4e2amasque","og_url":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/","og_site_name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","article_published_time":"2020-03-10T02:17:54+00:00","article_modified_time":"2020-03-10T02:17:56+00:00","author":"\u7ba1\u7406\u5458","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/#article","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/"},"author":{"name":"\u7ba1\u7406\u5458","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"headline":"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1","datePublished":"2020-03-10T02:17:54+00:00","dateModified":"2020-03-10T02:17:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/"},"wordCount":2,"commentCount":0,"publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"articleSection":["Linux"],"inLanguage":"zh-CN","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/","url":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/","name":"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/#website"},"datePublished":"2020-03-10T02:17:54+00:00","dateModified":"2020-03-10T02:17:56+00:00","breadcrumb":{"@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxdevops.cn\/2020\/03\/centos7-firewall-firewalld-port-forwarding\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.linuxdevops.cn\/"},{"@type":"ListItem","position":2,"name":"Linux","item":"https:\/\/www.linuxdevops.cn\/linux\/"},{"@type":"ListItem","position":3,"name":"centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxdevops.cn\/#website","url":"https:\/\/www.linuxdevops.cn\/","name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","description":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0","publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"alternateName":"linuxdevops","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxdevops.cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":["Person","Organization"],"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1","name":"\u7ba1\u7406\u5458","image":{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/","url":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","contentUrl":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","width":512,"height":512,"caption":"\u7ba1\u7406\u5458"},"logo":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/"},"description":"\u7ba1\u7406\u5458","url":"https:\/\/www.linuxdevops.cn\/author\/root\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/640"}],"collection":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/comments?post=640"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/640\/revisions"}],"predecessor-version":[{"id":641,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/640\/revisions\/641"}],"wp:attachment":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/media?parent=640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/categories?post=640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/tags?post=640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}