{"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":"\n
centos7\u9632\u706b\u5899firewalld \u7aef\u53e3\u8f6c\u53d1 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n