{"id":54,"date":"2019-02-07T19:02:22","date_gmt":"2019-02-07T11:02:22","guid":{"rendered":""},"modified":"2020-10-08T13:37:58","modified_gmt":"2020-10-08T05:37:58","slug":"%e5%88%86%e4%ba%ab%ef%bc%9a%e3%80%8alinux%e5%b0%b1%e8%af%a5%e8%bf%99%e4%b9%88%e5%ad%a6-%e3%80%8b%e7%ac%ac8%e7%ab%a0-iptables%e4%b8%8efirewalld%e9%98%b2%e7%81%ab%e5%a2%99","status":"publish","type":"post","link":"https:\/\/www.fatesky.com\/?p=54","title":{"rendered":"\u5206\u4eab\uff1a\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66 \u300b\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899"},"content":{"rendered":"<h2 style=\"white-space: normal; margin: 8px 0px; padding: 2px 0px; font-size: 1.3em; border-left-width: 4px; border-left-style: solid; border-left-color: #fc2e2e; text-indent: 16px; color: #4a4a4a; font-family: 'Microsoft YaHei'; line-height: 25px; background-color: #ffffff;\">\u63a8\u8350\u7b80\u8ff0\uff1a<\/h2>\n<p style=\"margin-top: 0px; margin-bottom: 10px; white-space: normal; box-sizing: border-box; line-height: 23px; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; text-indent: 2em; background-color: #ffffff;\"><span style=\"text-indent: 1em;\">\u8bf4\u5230Linux\u7cfb\u7edf\u4ece01\u5e74\u5f00\u59cb\u6211\u5c31\u4e00\u76f4\u5728\u63a5\u89e6\uff0c\u76f4\u523003\u5e74\u8fd8\u662f04\u5e74\u7684\u65f6\u5019\u5728\u60e0\u5dde\u65b0\u534e\u4e66\u5e97\u4e70\u4e86\u4e00\u672c\u300a<\/span><span style=\"font-size: 13.3333px; text-indent: 13.3333px;\">\u9e1f\u54e5\u7684\u79c1\u623f\u83dc<\/span><span style=\"text-indent: 1em;\">\u300b\uff0c\u81ea\u6b64\u6211\u7684LINUX\u8d77\u6b65\u624d\u7b97\u662f\u771f\u6b63\u7684\u5f00\u59cb\uff0c\u4eca\u5929\u5ffd\u7136\u5728\u7f51\u4e0a\u53d1\u73b0\u4e86\u4e00\u672c\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b<\/span><span style=\"font-size: 13.3333px; text-indent: 13.3333px;\">\u5fcd\u4e0d\u4f4f\u770b\u4e86\u4e8c\u7ae0\uff0c<\/span><span style=\"text-indent: 1em;\">\u89c9\u5f97\u8fd9\u672c\u4e66\u5728\u73b0\u65f6\u7684Linux\u73af\u5883\u4e0b\u66f4\u9002\u5408\u65b0\u624b\u5165\u95e8\uff0c\u4e0d\u7531\u5f3a\u70c8\u63a8\u8350\u4e00\u4e0b\uff0c\u5e76\u4e14\u81ea\u5df1\u4e5f\u51b3\u5b9a\u4e09\u6708\u4efd\u91cc\u6bcf\u5929\u5fc5\u770b\u4e00\u7ae0\u8282\uff0c\u5728\u770b\u7684\u540c\u65f6\u4e5f\u8f6c\u8f7d\u5728\u535a\u5ba2\u91cc\u3002<\/span><span style=\"text-indent: 1em; color: #ff0000;\">\u6e29\u6545\u77e5\u65b0\uff0c\u5b66\u4e60\u8fd9\u4e2a\u4e8b\u60c5\u6c38\u8fdc\u5e94\u8be5\u5728\u8def\u4e0a\uff01<\/span><\/p>\n<p style=\"margin-top: 0px; margin-bottom: 10px; white-space: normal; box-sizing: border-box; line-height: 23px; text-indent: 1em; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; background-color: #ffffff;\">\n<h2 style=\"white-space: normal; margin: 8px 0px; padding: 2px 0px; font-size: 1.3em; border-left-width: 4px; border-left-style: solid; border-left-color: #fc2e2e; text-indent: 16px; color: #4a4a4a; font-family: 'Microsoft YaHei'; line-height: 25px; background-color: #ffffff;\">\u672c\u4e66\u76f8\u6bd4\u300a\u9e1f\u54e5\u7684linux\u79c1\u623f\u83dc\u300b\u6709\u4ec0\u4e48\u4f18\u52bf\uff1f<\/h2>\n<p style=\"margin-top: 0px; margin-bottom: 0px; white-space: normal; padding: 5px 0px 14px; text-indent: 2em; color: #4a4a4a; font-family: 'Microsoft YaHei'; font-size: 15px; line-height: 25px; background-color: #ffffff;\">\u5766\u767d\u6765\u8bb2\uff0c\u9e1f\u54e5\u7684linux\u79c1\u623f\u83dc\u4e5f\u662f\u6211\u7684linux\u5165\u95e8\u4e66\u7c4d\uff0c\u6211\u7edd\u5bf9\u7684\u8ba4\u53ef\u9e1f\u54e5\u4e3a\u8fd9\u672c\u4e66\u7684\u4ed8\u51fa\uff0c\u5176\u4e66\u53d1\u884c\u91cf\u5de8\u5927\uff0c\u966a\u4f34\u4e86\u4e00\u4ee3\u7684\u8fd0\u7ef4\u4eba\u5458\uff0c\u751a\u81f3\u88ab\u5c01\u4e3a\u201clinux\u5165\u95e8\u795e\u4e66\u201d\uff0c\u6e10\u6e10\u7684\u4ece\u4e00\u672clinux\u6280\u672f\u4e66\u7c4d\uff0c\u4e0a\u5347\u81f3\u7cbe\u795e\u7684\u9ad8\u5ea6\uff0c\u4e0d\u5141\u8bb8\u518d\u6709\u4e00\u70b9\u53cd\u9a73\u4e4b\u58f0\uff0c\u4f46\u601d\u7d22\u518d\u4e09\uff0c\u8fd8\u662f\u51b3\u5b9a\u9610\u660e\u6211\u7684\u89c2\u70b9\uff0c\u4e0e\u521d\u5b66\u8005\u5206\u4eab\u4e0b\u8fd9\u4e0d\u540c\u7684\u770b\u6cd5\uff1a<br style=\"margin: 0px; padding: 0px;\" \/>\u9996\u5148\u9e1f\u54e5\u5728\u5f00\u7bc7\u5373\u63d0\u5230\u4e86\u5199\u4e66\u7684\u7f18\u7531\u662f\u56e0\u4e3a\u8bb0\u6027\u4e0d\u597d\uff0c\u6240\u4ee5\u60f3\u5199\u51fa\u4e00\u672c\u80fd\u591f\u653e\u5728\u6848\u5934\u7684\u5907\u5fd8\u5f55\uff0c\u5bf9\u4e66\u7c4d\u7684\u5185\u5bb9\u81ea\u7136\u5c31\u6ca1\u6709\u4e86\u592a\u591a\u7684\u7b5b\u9009\uff0c\u53cd\u800c\u4e00\u518d\u7684\u6269\u5927\u77e5\u8bc6\u8303\u56f4\uff0c\u6700\u7ec8\u5199\u51fa\u7684\u4e24\u672c\u4e66\u539a\u5ea6\u8db3\u8db3\u8d85\u8fc7\u5341\u5398\u7c73\uff0c\u6562\u95ee\u8fd9\u79cd\u201c\u5907\u5fd8\u5f55\u5f0f\u7684\u5165\u95e8\u4e66\u7c4d\u201d\u771f\u7684\u9002\u5408\u65b0\u624b\u6765\u8bfb\uff1f\u6211\u8ba4\u4e3a\u4e66\u7c4d\u65e2\u7136\u53d1\u884c\u4e86\uff0c\u5c31\u4e0d\u80fd\u518d\u662f\u4e2a\u5907\u5fd8\u5f55\uff0c\u800c\u5e94\u8be5\u662f\u901a\u8fc7\u4f5c\u8005\u7684\u7ecf\u9a8c\u5c06\u77e5\u8bc6\u4e0d\u65ad\u63d0\u70bc\uff0c\u771f\u6b63\u8ba9\u6367\u8d77\u4e66\u7684\u8bfb\u8005\u770b\u5b8c\u6709\u6536\u83b7\u624d\u53ef\u4ee5\u3002<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 0px; white-space: normal; padding: 5px 0px 14px; text-indent: 2em; color: #4a4a4a; font-family: 'Microsoft YaHei'; font-size: 15px; line-height: 25px; background-color: #ffffff;\">\u5176\u6b21\u662f\u9e1f\u54e5\u7684linux\u79c1\u623f\u83dc\u7684\u4e66\u7c4d\u66f4\u65b0\u5468\u671f\u8fc7\u957f\uff0c2014\u5e74\u672b\u65f6RHEL7\u4e0eCentos7\u5c31\u5df2\u7ecf\u516c\u5e03\uff0c\u7ecf\u8fc7\u4e86\u4e00\u5e74\u591a\u7684\u8fed\u4ee3\uff0c\u5df2\u7ecf\u5f88\u7a33\u5b9a\u5e76\u88ab\u5e7f\u6cdb\u4f7f\u7528\u4e86\uff0c\u5982\u679c\u5185\u5bb9\u6ca1\u6709\u5b9a\u671f\u66f4\u65b0\uff0c\u4f7f\u5f97\u6280\u672f\u8131\u79bb\u4e86\u751f\u4ea7\u73af\u5883\uff0c\u8fd8\u600e\u4e48\u79f0\u4f5c\u662f\u771f\u6b63\u5b9e\u7528\u7684linux\u6280\u672f\uff1f\u800c\u4e14\u9e1f\u54e5\u7684linux\u79c1\u623f\u83dc\u7f3a\u5c11\u4e86\u5bf9\u65b0\u624b\u975e\u5e38\u91cd\u8981\u7684\u7b54\u7591\u4e0e\u5e2e\u52a9\uff0c\u5982\u679c\u9047\u5230\u4e86\u5b9e\u9a8c\u51fa\u9519\uff0c\u6216\u8005\u6709\u77e5\u8bc6\u70b9\u609f\u4e0d\u900f\uff0c\u8fd9\u4e9b\u90fd\u53ef\u80fd\u8ba9\u521d\u5b66\u8005\u4e27\u5931\u6389\u5bf9linux\u6280\u672f\u7684\u5174\u8da3\u3002<\/p>\n<h2 style=\"white-space: normal; margin: 8px 0px; padding: 2px 0px; font-size: 1.3em; border-left-width: 4px; border-left-style: solid; border-left-color: #fc2e2e; text-indent: 16px; color: #4a4a4a; font-family: 'Microsoft YaHei'; line-height: 25px; background-color: #ffffff;\">RHEL\u4e0eCentos\u7cfb\u7edf\u533a\u522b\uff1a<\/h2>\n<p style=\"margin-top: 0px; margin-bottom: 0px; white-space: normal; padding: 5px 0px 14px; text-indent: 2em; color: #4a4a4a; font-family: 'Microsoft YaHei'; font-size: 15px; line-height: 25px; background-color: #ffffff;\">\u73b0\u5728\u56fd\u5185\u7684\u5f88\u591a\u4e66\u7c4d\u662f\u4ee5Centos\u7cfb\u7edf\u4e3a\u5e73\u53f0\u7f16\u5199\u7684\uff0c\u5f53\u7136\u4f5c\u8005\u5927\u591a\u4f1a\u5217\u51fa\u6765\u8bf8\u591a\u7684\u7406\u7531\uff0c\u4f46\u5f88\u591a\u90fd\u662f\u4ee5\u8bb9\u4f20\u8bb9\u7684\u6b6a\u66f2\u9053\u7406\uff0c\u6839\u672c\u6ca1\u6709\u5256\u6790\u5230RedHat\u516c\u53f8\u7684\u8fd0\u4f5c\u65b9\u6cd5\u548cCentos\u7cfb\u7edf\u7684\u672c\u8d28\uff0cCentos\u7cfb\u7edf\u662f\u901a\u8fc7\u5c06RHEL\u7cfb\u7edf\u91ca\u653e\u51fa\u7684\u6e90\u4ee3\u7801\u4e8c\u6b21\u7f16\u8bd1\u7684Linux\u7cfb\u7edf\u4e4b\u4e00\uff0c\u547d\u4ee4\u64cd\u4f5c\u548c\u670d\u52a1\u914d\u7f6e\u65b9\u6cd5\u81ea\u7136\u90fd\u662f\u5b8c\u5168\u76f8\u540c\uff0c\u53bb\u6389\u4e86\u5f88\u591a\u7ea2\u5e3d\u6536\u8d39\u7684\u670d\u52a1\u5957\u4ef6\u529f\u80fd\uff0c\u5e76\u4e14\u4e0d\u63d0\u4f9b\u4efb\u4f55\u5f62\u5f0f\u7684\u6280\u672f\u652f\u6301\uff0c\u90a3\u4e48\u9009\u62e9\u7684\u7406\u7531\u53ea\u6709\u4e00\u4e2a\u2014\u2014\u514d\u8d39\uff01\uff0c\u5f53\u201c\u9ad8\u624b\u4eec\u201d\u5927\u4e3e\u514d\u8d39\u3001\u5f00\u6e90\u3001\u6b63\u4e49\u7684\u65d7\u5e1c\u6765\u5ba3\u626cCentos\u7cfb\u7edf\u7684\u65f6\u5019\uff0c\u8bf8\u4e0d\u77e5Centos\u7cfb\u7edf\u5176\u5b9e\u65e9\u57282014\u5e74\u521d\u5c31\u5df2\u7ecf\u88ab\u7ea2\u5e3d\u516c\u53f8\u6536\u8d2d\uff0c\u53ea\u662f\u6218\u7565\u6027\u7684\u514d\u8d39\u800c\u5df2\uff0c\u800c\u6839\u636eGnu GPL\u8bb8\u53ef\u534f\u8bae\uff0c\u6211\u4eec\u540c\u6837\u4e5f\u53ef\u4ee5\u514d\u8d39\u4f7f\u7528RHEL\u7cfb\u7edf\uff0c\u751a\u81f3\u662f\u4fee\u6539\u4ee3\u7801\u540e\u521b\u5efa\u51fa\u884d\u751f\u4ea7\u54c1\uff0c\u81ea\u7531\u7a0b\u5ea6\u662f\u6ca1\u6709\u4efb\u4f55\u7684\u5dee\u5f02\uff0c\u66f4\u65e0\u5173\u9053\u5fb7\u95ee\u9898\u3002<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 0px; white-space: normal; padding: 5px 0px 14px; text-indent: 2em; color: #4a4a4a; font-family: 'Microsoft YaHei'; font-size: 15px; line-height: 25px; background-color: #ffffff;\">\u60a8\u6b63\u5728\u9605\u8bfb\u7684\u8fd9\u672c\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u4fbf\u662f\u57fa\u4e8e\u6700\u65b0\u7684RHEL7\u7cfb\u7edf\u7f16\u5199\u7684\uff0c\u77e5\u8bc6\u53ca\u5b9e\u9a8c\u5b8c\u5168\u7684\u76f8\u901a\u4e8eCentos,fedora\u7b49\u7cfb\u7edf\uff0c\u56e0\u6b64\u5f53\u60a8\u5b66\u4e60\u5b8c\u672c\u5957\u8bfe\u7a0b\u540e\uff0c\u5373\u4fbf\u516c\u53f8\u5185\u7684\u751f\u4ea7\u73af\u5883\u662fCentos\u7cfb\u7edf\u4e5f\u4e00\u6837\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u5e76\u4e14\u672c\u4e66\u914d\u5957\u8d44\u6599\u4e2d\u7684iso\u955c\u50cf\u4e0e\u7ea2\u5e3dRHCSA\u53caRHCE\u8003\u8bd5\u7cfb\u7edf\u4e00\u81f4\uff0c\u5c24\u5176\u9002\u5408\u51c6\u5907\u8003\u53d6\u7ea2\u5e3d\u8ba4\u8bc1\u7684\u5b66\u5458\u3002<\/p>\n<p style=\"margin-top: 0px; margin-bottom: 10px; text-indent: 0em; white-space: normal; box-sizing: border-box; line-height: 23px; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; background-color: #ffffff;\">\n<h2 style=\"white-space: normal; margin: 8px 0px; padding: 2px 0px; font-size: 1.3em; border-left-width: 4px; border-left-style: solid; border-left-color: #fc2e2e; text-indent: 16px; color: #4a4a4a; font-family: 'Microsoft YaHei'; line-height: 25px; background-color: #ffffff;\"><strong style=\"color: #3d4450; font-family: \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei'; font-size: 18px; line-height: 23px;\">\u6b63\u6587\u5f00\u59cb\uff1a<\/strong><\/h2>\n<p><strong style=\"color: #3d4450; font-family: \u5fae\u8f6f\u96c5\u9ed1, 'Microsoft YaHei'; font-size: 18px; line-height: 23px;\"><br \/>\n<\/strong>\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899<\/p>\n<p><span style=\"color: #92d050;\">8.1 \u9632\u706b\u5899\u7ba1\u7406\u5de5\u5177<\/span><\/p>\n<p><span style=\"color: #92d050;\">8.2 Iptables<\/span><\/p>\n<p><span style=\"color: #92d050;\">8.2.1 \u7b56\u7565\u4e0e\u89c4\u5219\u94fe<\/span><\/p>\n<p><span style=\"color: #92d050;\">8.2.2 \u57fa\u672c\u7684\u547d\u4ee4\u53c2\u6570<\/span><\/p>\n<p><span style=\"color: #92d050;\">8.3 Firewalld<\/span><\/p>\n<p><span style=\"color: #92d050;\">8.3.1 \u7ec8\u7aef\u7ba1\u7406\u5de5\u5177<\/span><\/p>\n<p><span style=\"color: #92d050;\">8.3.2 \u56fe\u5f62\u7ba1\u7406\u5de5\u5177<\/span><\/p>\n<p><span style=\"color: #92d050;\">8.4 \u670d\u52a1\u7684\u8bbf\u95ee\u63a7\u5236\u5217\u8868<\/span><\/p>\n<h5 style=\"box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 100; line-height: 1.1; margin-top: 10px; margin-bottom: 10px; font-size: 14px; color: #3d4450; white-space: normal; background-color: #ffffff;\"><span id=\"81\" style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\"><strong style=\"box-sizing: border-box;\">8.1 \u9632\u706b\u5899\u7ba1\u7406\u5de5\u5177<\/strong><\/span><\/span><\/h5>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u4f17\u6240\u5468\u77e5\uff0c\u76f8\u8f83\u4e8e\u4f01\u4e1a\u5185\u7f51\uff0c\u5916\u90e8\u7684\u516c\u7f51\u73af\u5883\u66f4\u52a0\u6076\u52a3\uff0c\u7f6a\u6076\u4e1b\u751f\u3002\u5728\u516c\u7f51\u4e0e\u4f01\u4e1a\u5185\u7f51\u4e4b\u95f4\u5145\u5f53\u4fdd\u62a4\u5c4f\u969c\u7684\u9632\u706b\u5899\uff08\u89c1\u56fe8-1\uff09\u867d\u7136\u6709\u8f6f\u4ef6\u6216\u786c\u4ef6\u4e4b\u5206\uff0c\u4f46\u4e3b\u8981\u529f\u80fd\u90fd\u662f\u4f9d\u636e\u7b56\u7565\u5bf9\u7a7f\u8d8a\u9632\u706b\u5899\u81ea\u8eab\u7684\u6d41\u91cf\u8fdb\u884c\u8fc7\u6ee4\u3002\u9632\u706b\u5899\u7b56\u7565\u53ef\u4ee5\u57fa\u4e8e\u6d41\u91cf\u7684\u6e90\u76ee\u5730\u5740\u3001\u7aef\u53e3\u53f7\u3001\u534f\u8bae\u3001\u5e94\u7528\u7b49\u4fe1\u606f\u6765\u5b9a\u5236\uff0c\u7136\u540e\u9632\u706b\u5899\u4f7f\u7528\u9884\u5148\u5b9a\u5236\u7684\u7b56\u7565\u89c4\u5219\u76d1\u63a7\u51fa\u5165\u7684\u6d41\u91cf\uff0c\u82e5\u6d41\u91cf\u4e0e\u67d0\u4e00\u6761\u7b56\u7565\u89c4\u5219\u76f8\u5339\u914d\uff0c\u5219\u6267\u884c\u76f8\u5e94\u7684\u5904\u7406\uff0c\u53cd\u4e4b\u5219\u4e22\u5f03\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u5c31\u53ef\u4ee5\u4fdd\u8bc1\u4ec5\u6709\u5408\u6cd5\u7684\u6d41\u91cf\u5728\u4f01\u4e1a\u5185\u7f51\u548c\u5916\u90e8\u516c\u7f51\u4e4b\u95f4\u6d41\u52a8\u4e86\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E9%98%B2%E7%81%AB%E5%A2%99%E6%8B%93%E6%89%91.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-745 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E9%98%B2%E7%81%AB%E5%A2%99%E6%8B%93%E6%89%91.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 548px) 100vw, 548px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"548\" height=\"149\" \/><\/div><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u56fe8-1\u00a0 \u9632\u706b\u5899\u4f5c\u4e3a\u516c\u7f51\u4e0e\u5185\u7f51\u4e4b\u95f4\u7684\u4fdd\u62a4\u5c4f\u969c<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u5728RHEL 7\u7cfb\u7edf\u4e2d\uff0cfirewalld\u9632\u706b\u5899\u53d6\u4ee3\u4e86iptables\u9632\u706b\u5899\u3002\u5bf9\u4e8e\u63a5\u89e6<a style=\"box-sizing: border-box; color: #d2322d; text-decoration: none;\" href=\"https:\/\/www.linuxprobe.com\/\">Linux\u7cfb\u7edf<\/a>\u6bd4\u8f83\u65e9\u6216\u5b66\u4e60\u8fc7RHEL 6\u7cfb\u7edf\u7684\u8bfb\u8005\u6765\u8bf4\uff0c\u5f53\u4ed6\u4eec\u53d1\u73b0\u66fe\u7ecf\u638c\u63e1\u7684\u77e5\u8bc6\u5728RHEL 7\u4e2d\u4e0d\u518d\u9002\u7528\uff0c\u9700\u8981\u5168\u65b0\u5b66\u4e60firewalld\u65f6\uff0c\u96be\u514d\u4f1a\u6709\u62b5\u89e6\u5fc3\u7406\u3002\u5176\u5b9e\uff0ciptables\u4e0efirewalld\u90fd\u4e0d\u662f\u771f\u6b63\u7684\u9632\u706b\u5899\uff0c\u5b83\u4eec\u90fd\u53ea\u662f\u7528\u6765\u5b9a\u4e49\u9632\u706b\u5899\u7b56\u7565\u7684\u9632\u706b\u5899\u7ba1\u7406\u5de5\u5177\u800c\u5df2\uff0c\u6216\u8005\u8bf4\uff0c\u5b83\u4eec\u53ea\u662f\u4e00\u79cd\u670d\u52a1\u3002iptables\u670d\u52a1\u4f1a\u628a\u914d\u7f6e\u597d\u7684\u9632\u706b\u5899\u7b56\u7565\u4ea4\u7531\u5185\u6838\u5c42\u9762\u7684netfilter\u7f51\u7edc\u8fc7\u6ee4\u5668\u6765\u5904\u7406\uff0c\u800cfirewalld\u670d\u52a1\u5219\u662f\u628a\u914d\u7f6e\u597d\u7684\u9632\u706b\u5899\u7b56\u7565\u4ea4\u7531\u5185\u6838\u5c42\u9762\u7684nftables\u5305\u8fc7\u6ee4\u6846\u67b6\u6765\u5904\u7406\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5f53\u524d\u5728Linux\u7cfb\u7edf\u4e2d\u5176\u5b9e\u5b58\u5728\u591a\u4e2a\u9632\u706b\u5899\u7ba1\u7406\u5de5\u5177\uff0c\u65e8\u5728\u65b9\u4fbf\u8fd0\u7ef4\u4eba\u5458\u7ba1\u7406Linux\u7cfb\u7edf\u4e2d\u7684\u9632\u706b\u5899\u7b56\u7565\uff0c\u6211\u4eec\u53ea\u9700\u8981\u914d\u7f6e\u59a5\u5f53\u5176\u4e2d\u7684\u4e00\u4e2a\u5c31\u8db3\u591f\u4e86\u3002\u867d\u7136\u8fd9\u4e9b\u5de5\u5177\u5404\u6709\u4f18\u52a3\uff0c\u4f46\u5b83\u4eec\u5728\u9632\u706b\u5899\u7b56\u7565\u7684\u914d\u7f6e\u601d\u8def\u4e0a\u662f\u4fdd\u6301\u4e00\u81f4\u7684\u3002\u5927\u5bb6\u751a\u81f3\u53ef\u4ee5\u4e0d\u7528\u5b8c\u5168\u638c\u63e1\u672c\u7ae0\u4ecb\u7ecd\u7684\u5185\u5bb9\uff0c\u53ea\u8981\u5728\u8fd9\u591a\u4e2a\u9632\u706b\u5899\u7ba1\u7406\u5de5\u5177\u4e2d\u4efb\u9009\u4e00\u6b3e\u5e76\u5c06\u5176\u5b66\u900f\uff0c\u5c31\u8db3\u4ee5\u6ee1\u8db3\u65e5\u5e38\u7684\u5de5\u4f5c\u9700\u6c42\u4e86\u3002<\/p>\n<h5 style=\"box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 100; line-height: 1.1; margin-top: 10px; margin-bottom: 10px; font-size: 14px; color: #3d4450; white-space: normal; background-color: #ffffff;\"><span id=\"82_Iptables\" style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\"><strong style=\"box-sizing: border-box;\">8.2 Iptables<\/strong><\/span><\/span><\/h5>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u5728\u65e9\u671f\u7684Linux\u7cfb\u7edf\u4e2d\uff0c\u9ed8\u8ba4\u4f7f\u7528\u7684\u662fiptables\u9632\u706b\u5899\u7ba1\u7406\u670d\u52a1\u6765\u914d\u7f6e\u9632\u706b\u5899\u3002\u5c3d\u7ba1\u65b0\u578b\u7684firewalld\u9632\u706b\u5899\u7ba1\u7406\u670d\u52a1\u5df2\u7ecf\u88ab\u6295\u5165\u4f7f\u7528\u591a\u5e74\uff0c\u4f46\u662f\u5927\u91cf\u7684\u4f01\u4e1a\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u4f9d\u7136\u51fa\u4e8e\u5404\u79cd\u539f\u56e0\u800c\u7ee7\u7eed\u4f7f\u7528iptables\u3002\u8003\u8651\u5230iptables\u5728\u5f53\u524d\u751f\u4ea7\u73af\u5883\u4e2d\u8fd8\u5177\u6709\u987d\u5f3a\u7684\u751f\u547d\u529b\uff0c\u4ee5\u53ca\u4e3a\u4e86\u4f7f\u5927\u5bb6\u5728\u6c42\u804c\u9762\u8bd5\u8fc7\u7a0b\u4e2d\u88ab\u95ee\u5230iptables\u7684\u76f8\u5173\u77e5\u8bc6\u65f6\u80fd\u80f8\u6709\u6210\u7af9\uff0c<a style=\"box-sizing: border-box; color: #d2322d; text-decoration: none;\" title=\"\u5218\u9044\" href=\"https:\/\/www.linuxprobe.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u5218\u9044<\/a>\u8001\u5e08\u89c9\u5f97\u8fd8\u662f\u6709\u5fc5\u8981\u5728\u672c\u4e66\u4e2d\u597d\u597d\u5730\u8bb2\u89e3\u4e00\u4e0b\u8fd9\u9879\u6280\u672f\u3002\u66f4\u4f55\u51b5\u524d\u6587\u4e5f\u63d0\u5230\uff0c\u5404\u4e2a\u9632\u706b\u5899\u7ba1\u7406\u5de5\u5177\u7684\u914d\u7f6e\u601d\u8def\u662f\u4e00\u81f4\u7684\uff0c\u5728\u638c\u63e1\u4e86iptables\u540e\u518d\u5b66\u4e60\u5176\u4ed6\u9632\u706b\u5899\u7ba1\u7406\u5de5\u5177\u65f6\uff0c\u4e5f\u6709\u501f\u9274\u610f\u4e49\u3002<\/p>\n<h6 style=\"box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 500; line-height: 1.1; margin-top: 10px; margin-bottom: 10px; font-size: 12px; color: #3d4450; white-space: normal; background-color: #ffffff;\"><span id=\"821\" style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\"><strong style=\"box-sizing: border-box;\">8.2.1 \u7b56\u7565\u4e0e\u89c4\u5219\u94fe<\/strong><\/span><\/span><\/h6>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u9632\u706b\u5899\u4f1a\u4ece\u4e0a\u81f3\u4e0b\u7684\u987a\u5e8f\u6765\u8bfb\u53d6\u914d\u7f6e\u7684\u7b56\u7565\u89c4\u5219\uff0c\u5728\u627e\u5230\u5339\u914d\u9879\u540e\u5c31\u7acb\u5373\u7ed3\u675f\u5339\u914d\u5de5\u4f5c\u5e76\u53bb\u6267\u884c\u5339\u914d\u9879\u4e2d\u5b9a\u4e49\u7684\u884c\u4e3a\uff08\u5373\u653e\u884c\u6216\u963b\u6b62\uff09\u3002\u5982\u679c\u5728\u8bfb\u53d6\u5b8c\u6240\u6709\u7684\u7b56\u7565\u89c4\u5219\u4e4b\u540e\u6ca1\u6709\u5339\u914d\u9879\uff0c\u5c31\u53bb\u6267\u884c\u9ed8\u8ba4\u7684\u7b56\u7565\u3002\u4e00\u822c\u800c\u8a00\uff0c\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\u7684\u8bbe\u7f6e\u6709\u4e24\u79cd\uff1a\u4e00\u79cd\u662f\u201c\u901a\u201d\uff08\u5373\u653e\u884c\uff09\uff0c\u4e00\u79cd\u662f\u201c\u5835\u201d\uff08\u5373\u963b\u6b62\uff09\u3002\u5f53\u9632\u706b\u5899\u7684\u9ed8\u8ba4\u7b56\u7565\u4e3a\u62d2\u7edd\u65f6\uff08\u5835\uff09\uff0c\u5c31\u8981\u8bbe\u7f6e\u5141\u8bb8\u89c4\u5219\uff08\u901a\uff09\uff0c\u5426\u5219\u8c01\u90fd\u8fdb\u4e0d\u6765\uff1b\u5982\u679c\u9632\u706b\u5899\u7684\u9ed8\u8ba4\u7b56\u7565\u4e3a\u5141\u8bb8\u65f6\uff0c\u5c31\u8981\u8bbe\u7f6e\u62d2\u7edd\u89c4\u5219\uff0c\u5426\u5219\u8c01\u90fd\u80fd\u8fdb\u6765\uff0c\u9632\u706b\u5899\u4e5f\u5c31\u5931\u53bb\u4e86\u9632\u8303\u7684\u4f5c\u7528\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">iptables\u670d\u52a1\u628a\u7528\u4e8e\u5904\u7406\u6216\u8fc7\u6ee4\u6d41\u91cf\u7684\u7b56\u7565\u6761\u76ee\u79f0\u4e4b\u4e3a\u89c4\u5219\uff0c\u591a\u6761\u89c4\u5219\u53ef\u4ee5\u7ec4\u6210\u4e00\u4e2a\u89c4\u5219\u94fe\uff0c\u800c\u89c4\u5219\u94fe\u5219\u4f9d\u636e\u6570\u636e\u5305\u5904\u7406\u4f4d\u7f6e\u7684\u4e0d\u540c\u8fdb\u884c\u5206\u7c7b\uff0c\u5177\u4f53\u5982\u4e0b\uff1a<\/p>\n<blockquote style=\"box-sizing: border-box; padding: 10px 20px; margin: 0px 0px 20px; border-left-width: 5px; border-left-style: solid; border-color: rgba(0, 0, 0, 0.14902); color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17.1429px; white-space: normal; background-color: #ffffff;\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5728\u8fdb\u884c\u8def\u7531\u9009\u62e9\u524d\u5904\u7406\u6570\u636e\u5305\uff08PREROUTING\uff09\uff1b<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5904\u7406\u6d41\u5165\u7684\u6570\u636e\u5305\uff08INPUT\uff09\uff1b<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5904\u7406\u6d41\u51fa\u7684\u6570\u636e\u5305\uff08OUTPUT\uff09\uff1b<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5904\u7406\u8f6c\u53d1\u7684\u6570\u636e\u5305\uff08FORWARD\uff09\uff1b<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5728\u8fdb\u884c\u8def\u7531\u9009\u62e9\u540e\u5904\u7406\u6570\u636e\u5305\uff08POSTROUTING\uff09\u3002<\/p>\n<\/blockquote>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u4e00\u822c\u6765\u8bf4\uff0c\u4ece\u5185\u7f51\u5411\u5916\u7f51\u53d1\u9001\u7684\u6d41\u91cf\u4e00\u822c\u90fd\u662f\u53ef\u63a7\u4e14\u826f\u6027\u7684\uff0c\u56e0\u6b64\u6211\u4eec\u4f7f\u7528\u6700\u591a\u7684\u5c31\u662fINPUT\u89c4\u5219\u94fe\uff0c\u8be5\u89c4\u5219\u94fe\u53ef\u4ee5\u589e\u5927\u9ed1\u5ba2\u4eba\u5458\u4ece\u5916\u7f51\u5165\u4fb5\u5185\u7f51\u7684\u96be\u5ea6\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u6bd4\u5982\u5728\u60a8\u5c45\u4f4f\u7684\u793e\u533a\u5185\uff0c\u7269\u4e1a\u7ba1\u7406\u516c\u53f8\u6709\u4e24\u6761\u89c4\u5b9a\uff1a\u7981\u6b62\u5c0f\u5546\u5c0f\u8d29\u8fdb\u5165\u793e\u533a\uff1b\u5404\u79cd\u8f66\u8f86\u5728\u8fdb\u5165\u793e\u533a\u65f6\u90fd\u8981\u767b\u8bb0\u3002\u663e\u800c\u6613\u89c1\uff0c\u8fd9\u4e24\u6761\u89c4\u5b9a\u5e94\u8be5\u662f\u7528\u4e8e\u793e\u533a\u7684\u6b63\u95e8\u7684\uff08\u6d41\u91cf\u5fc5\u987b\u7ecf\u8fc7\u7684\u5730\u65b9\uff09\uff0c\u800c\u4e0d\u662f\u6bcf\u5bb6\u6bcf\u6237\u7684\u9632\u76d7\u95e8\u4e0a\u3002\u6839\u636e\u524d\u9762\u63d0\u5230\u7684\u9632\u706b\u5899\u7b56\u7565\u7684\u5339\u914d\u987a\u5e8f\uff0c\u53ef\u80fd\u4f1a\u5b58\u5728\u591a\u79cd\u60c5\u51b5\u3002\u6bd4\u5982\uff0c\u6765\u8bbf\u4eba\u5458\u662f\u5c0f\u5546\u5c0f\u8d29\uff0c\u5219\u76f4\u63a5\u4f1a\u88ab\u7269\u4e1a\u516c\u53f8\u7684\u4fdd\u5b89\u62d2\u4e4b\u95e8\u5916\uff0c\u4e5f\u5c31\u65e0\u9700\u518d\u5bf9\u8f66\u8f86\u8fdb\u884c\u767b\u8bb0\u3002\u5982\u679c\u6765\u8bbf\u4eba\u5458\u4e58\u5750\u4e00\u8f86\u6c7d\u8f66\u8fdb\u5165\u793e\u533a\u6b63\u95e8\uff0c\u5219\u201c\u7981\u6b62\u5c0f\u5546\u5c0f\u8d29\u8fdb\u5165\u793e\u533a\u201d\u7684\u7b2c\u4e00\u6761\u89c4\u5219\u5c31\u6ca1\u6709\u88ab\u5339\u914d\u5230\uff0c\u56e0\u6b64\u6309\u7167\u987a\u5e8f\u5339\u914d\u7b2c\u4e8c\u6761\u7b56\u7565\uff0c\u5373\u9700\u8981\u5bf9\u8f66\u8f86\u8fdb\u884c\u767b\u8bb0\u3002\u5982\u679c\u662f\u793e\u533a\u5c45\u6c11\u8981\u8fdb\u5165\u6b63\u95e8\uff0c\u5219\u8fd9\u4e24\u6761\u89c4\u5b9a\u90fd\u4e0d\u4f1a\u5339\u914d\u5230\uff0c\u56e0\u6b64\u4f1a\u6267\u884c\u9ed8\u8ba4\u7684\u653e\u884c\u7b56\u7565\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u4f46\u662f\uff0c\u4ec5\u6709\u7b56\u7565\u89c4\u5219\u8fd8\u4e0d\u80fd\u4fdd\u8bc1\u793e\u533a\u7684\u5b89\u5168\uff0c\u4fdd\u5b89\u8fd8\u5e94\u8be5\u77e5\u9053\u91c7\u7528\u4ec0\u4e48\u6837\u7684\u52a8\u4f5c\u6765\u5904\u7406\u8fd9\u4e9b\u5339\u914d\u7684\u6d41\u91cf\uff0c\u6bd4\u5982\u201c\u5141\u8bb8\u201d\u3001\u201c\u62d2\u7edd\u201d\u3001\u201c\u767b\u8bb0\u201d\u3001\u201c\u4e0d\u7406\u5b83\u201d\u3002\u8fd9\u4e9b\u52a8\u4f5c\u5bf9\u5e94\u5230iptables\u670d\u52a1\u7684\u672f\u8bed\u4e2d\u5206\u522b\u662fACCEPT\uff08\u5141\u8bb8\u6d41\u91cf\u901a\u8fc7\uff09\u3001REJECT\uff08\u62d2\u7edd\u6d41\u91cf\u901a\u8fc7\uff09\u3001LOG\uff08\u8bb0\u5f55\u65e5\u5fd7\u4fe1\u606f\uff09\u3001DROP\uff08\u62d2\u7edd\u6d41\u91cf\u901a\u8fc7\uff09\u3002\u201c\u5141\u8bb8\u6d41\u91cf\u901a\u8fc7\u201d\u548c\u201c\u8bb0\u5f55\u65e5\u5fd7\u4fe1\u606f\u201d\u90fd\u6bd4\u8f83\u597d\u7406\u89e3\uff0c\u8fd9\u91cc\u9700\u8981\u7740\u91cd\u8bb2\u89e3\u7684\u662fREJECT\u548cDROP\u7684\u4e0d\u540c\u70b9\u3002\u5c31DROP\u6765\u8bf4\uff0c\u5b83\u662f\u76f4\u63a5\u5c06\u6d41\u91cf\u4e22\u5f03\u800c\u4e14\u4e0d\u54cd\u5e94\uff1bREJECT\u5219\u4f1a\u5728\u62d2\u7edd\u6d41\u91cf\u540e\u518d\u56de\u590d\u4e00\u6761\u201c\u60a8\u7684\u4fe1\u606f\u5df2\u7ecf\u6536\u5230\uff0c\u4f46\u662f\u88ab\u6254\u6389\u4e86\u201d\u4fe1\u606f\uff0c\u4ece\u800c\u8ba9\u6d41\u91cf\u53d1\u9001\u65b9\u6e05\u6670\u5730\u770b\u5230\u6570\u636e\u88ab\u62d2\u7edd\u7684\u54cd\u5e94\u4fe1\u606f\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u6211\u4eec\u6765\u4e3e\u4e00\u4e2a\u4f8b\u5b50\uff0c\u8ba9\u5404\u4f4d\u8bfb\u8005\u66f4\u76f4\u89c2\u5730\u7406\u89e3\u8fd9\u4e24\u4e2a\u62d2\u7edd\u52a8\u4f5c\u7684\u4e0d\u540c\u4e4b\u5904\u3002\u6bd4\u5982\u6709\u4e00\u5929\u60a8\u6b63\u5728\u5bb6\u91cc\u770b\u7535\u89c6\uff0c\u7a81\u7136\u542c\u5230\u6709\u4eba\u6572\u95e8\uff0c\u60a8\u900f\u8fc7\u9632\u76d7\u95e8\u7684\u732b\u773c\u4e00\u770b\u662f\u63a8\u9500\u5546\u54c1\u7684\uff0c\u4fbf\u4f1a\u5728\u4e0d\u9700\u8981\u7684\u60c5\u51b5\u4e0b\u5f00\u95e8\u5e76\u62d2\u7edd\u4ed6\u4eec\uff08REJECT\uff09\u3002\u4f46\u5982\u679c\u60a8\u770b\u5230\u7684\u662f\u503a\u4e3b\u5e26\u4e86\u5341\u51e0\u4e2a\u5c0f\u5f1f\u6765\u8ba8\u503a\uff0c\u6b64\u65f6\u4e0d\u4ec5\u8981\u62d2\u7edd\u5f00\u95e8\uff0c\u8fd8\u8981\u9ed8\u4e0d\u4f5c\u58f0\uff0c\u4f2a\u88c5\u6210\u81ea\u5df1\u4e0d\u5728\u5bb6\u7684\u6837\u5b50\uff08DROP\uff09\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u5f53\u628aLinux\u7cfb\u7edf\u4e2d\u7684\u9632\u706b\u5899\u7b56\u7565\u8bbe\u7f6e\u4e3aREJECT\u62d2\u7edd\u52a8\u4f5c\u540e\uff0c\u6d41\u91cf\u53d1\u9001\u65b9\u4f1a\u770b\u5230\u7aef\u53e3\u4e0d\u53ef\u8fbe\u7684\u54cd\u5e94\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0ping\u00a0-c\u00a04\u00a0192.168.10.10\nPING\u00a0192.168.10.10\u00a0(192.168.10.10)\u00a056(84)\u00a0bytes\u00a0of\u00a0data.\nFrom\u00a0192.168.10.10\u00a0icmp_seq=1\u00a0Destination\u00a0Port\u00a0Unreachable\nFrom\u00a0192.168.10.10\u00a0icmp_seq=2\u00a0Destination\u00a0Port\u00a0Unreachable\nFrom\u00a0192.168.10.10\u00a0icmp_seq=3\u00a0Destination\u00a0Port\u00a0Unreachable\nFrom\u00a0192.168.10.10\u00a0icmp_seq=4\u00a0Destination\u00a0Port\u00a0Unreachable\n---\u00a0192.168.10.10\u00a0ping\u00a0statistics\u00a0---\n4\u00a0packets\u00a0transmitted,\u00a00\u00a0received,\u00a0+4\u00a0errors,\u00a0100%\u00a0packet\u00a0loss,\u00a0time\u00a03002ms<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u800c\u628aLinux\u7cfb\u7edf\u4e2d\u7684\u9632\u706b\u5899\u7b56\u7565\u4fee\u6539\u6210DROP\u62d2\u7edd\u52a8\u4f5c\u540e\uff0c\u6d41\u91cf\u53d1\u9001\u65b9\u4f1a\u770b\u5230\u54cd\u5e94\u8d85\u65f6\u7684\u63d0\u9192\u3002\u4f46\u662f\u6d41\u91cf\u53d1\u9001\u65b9\u65e0\u6cd5\u5224\u65ad\u6d41\u91cf\u662f\u88ab\u62d2\u7edd\uff0c\u8fd8\u662f\u63a5\u6536\u65b9\u4e3b\u673a\u5f53\u524d\u4e0d\u5728\u7ebf\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0ping\u00a0-c\u00a04\u00a0192.168.10.10\nPING\u00a0192.168.10.10\u00a0(192.168.10.10)\u00a056(84)\u00a0bytes\u00a0of\u00a0data.\n\n---\u00a0192.168.10.10\u00a0ping\u00a0statistics\u00a0---\n4\u00a0packets\u00a0transmitted,\u00a00\u00a0received,\u00a0100%\u00a0packet\u00a0loss,\u00a0time\u00a03000ms<\/pre>\n<h6 style=\"box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 500; line-height: 1.1; margin-top: 10px; margin-bottom: 10px; font-size: 12px; color: #3d4450; white-space: normal; background-color: #ffffff;\"><span id=\"822\" style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\"><strong style=\"box-sizing: border-box;\">8.2.2 \u57fa\u672c\u7684\u547d\u4ee4\u53c2\u6570<\/strong><\/span><\/span><\/h6>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">iptables\u662f\u4e00\u6b3e\u57fa\u4e8e\u547d\u4ee4\u884c\u7684\u9632\u706b\u5899\u7b56\u7565\u7ba1\u7406\u5de5\u5177\uff0c\u5177\u6709\u5927\u91cf\u53c2\u6570\uff0c\u5b66\u4e60\u96be\u5ea6\u8f83\u5927\u3002\u597d\u5728\u5bf9\u4e8e\u65e5\u5e38\u7684\u9632\u706b\u5899\u7b56\u7565\u914d\u7f6e\u6765\u8bb2\uff0c\u5927\u5bb6\u65e0\u9700\u6df1\u5165\u4e86\u89e3\u8bf8\u5982\u201c\u56db\u8868\u4e94\u94fe\u201d\u7684\u7406\u8bba\u6982\u5ff5\uff0c\u53ea\u9700\u8981\u638c\u63e1\u5e38\u7528\u7684\u53c2\u6570\u5e76\u505a\u5230\u7075\u6d3b\u642d\u914d\u5373\u53ef\uff0c\u8fd9\u5c31\u8db3\u4ee5\u5e94\u5bf9\u65e5\u5e38\u5de5\u4f5c\u4e86\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">iptables\u547d\u4ee4\u53ef\u4ee5\u6839\u636e\u6d41\u91cf\u7684\u6e90\u5730\u5740\u3001\u76ee\u7684\u5730\u5740\u3001\u4f20\u8f93\u534f\u8bae\u3001\u670d\u52a1\u7c7b\u578b\u7b49\u4fe1\u606f\u8fdb\u884c\u5339\u914d\uff0c\u4e00\u65e6\u5339\u914d\u6210\u529f\uff0ciptables\u5c31\u4f1a\u6839\u636e\u7b56\u7565\u89c4\u5219\u6240\u9884\u8bbe\u7684\u52a8\u4f5c\u6765\u5904\u7406\u8fd9\u4e9b\u6d41\u91cf\u3002\u53e6\u5916\uff0c\u518d\u6b21\u63d0\u9192\u4e00\u4e0b\uff0c\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\u7684\u5339\u914d\u987a\u5e8f\u662f\u4ece\u4e0a\u81f3\u4e0b\u7684\uff0c\u56e0\u6b64\u8981\u628a\u8f83\u4e3a\u4e25\u683c\u3001\u4f18\u5148\u7ea7\u8f83\u9ad8\u7684\u7b56\u7565\u89c4\u5219\u653e\u5230\u524d\u9762\uff0c\u4ee5\u514d\u53d1\u751f\u9519\u8bef\u3002\u88688-1\u603b\u7ed3\u5f52\u7eb3\u4e86\u5e38\u7528\u7684iptables\u547d\u4ee4\u53c2\u6570\u3002\u518d\u6b21\u5f3a\u8c03\uff0c\u6211\u4eec\u65e0\u9700\u6b7b\u8bb0\u786c\u80cc\u8fd9\u4e9b\u53c2\u6570\uff0c\u53ea\u9700\u501f\u52a9\u4e0b\u9762\u7684\u5b9e\u9a8c\u6765\u7406\u89e3\u638c\u63e1\u5373\u53ef\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u88688-1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 iptables\u4e2d\u5e38\u7528\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n<table id=\"tablepress-40\" class=\"tablepress tablepress-id-40\" width=\"712\">\n<tbody class=\"row-hover\" style=\"box-sizing: border-box;\">\n<tr class=\"row-1 odd firstRow\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-top-width: 0px; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u53c2\u6570<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-top-width: 0px; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u4f5c\u7528<\/td>\n<\/tr>\n<tr class=\"row-2 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">-P<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u8bbe\u7f6e\u9ed8\u8ba4\u7b56\u7565<\/td>\n<\/tr>\n<tr class=\"row-3 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">-F<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u6e05\u7a7a\u89c4\u5219\u94fe<\/td>\n<\/tr>\n<tr class=\"row-4 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">-L<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u67e5\u770b\u89c4\u5219\u94fe<\/td>\n<\/tr>\n<tr class=\"row-5 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">-A<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u5728\u89c4\u5219\u94fe\u7684\u672b\u5c3e\u52a0\u5165\u65b0\u89c4\u5219<\/td>\n<\/tr>\n<tr class=\"row-6 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">-I num<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u5728\u89c4\u5219\u94fe\u7684\u5934\u90e8\u52a0\u5165\u65b0\u89c4\u5219<\/td>\n<\/tr>\n<tr class=\"row-7 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">-D num<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u5220\u9664\u67d0\u4e00\u6761\u89c4\u5219<\/td>\n<\/tr>\n<tr class=\"row-8 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">-s<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u5339\u914d\u6765\u6e90\u5730\u5740IP\/MASK\uff0c\u52a0\u53f9\u53f7\u201c!\u201d\u8868\u793a\u9664\u8fd9\u4e2aIP\u5916<\/td>\n<\/tr>\n<tr class=\"row-9 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">-d<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u5339\u914d\u76ee\u6807\u5730\u5740<\/td>\n<\/tr>\n<tr class=\"row-10 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">-i \u7f51\u5361\u540d\u79f0<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u5339\u914d\u4ece\u8fd9\u5757\u7f51\u5361\u6d41\u5165\u7684\u6570\u636e<\/td>\n<\/tr>\n<tr class=\"row-11 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">-o \u7f51\u5361\u540d\u79f0<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u5339\u914d\u4ece\u8fd9\u5757\u7f51\u5361\u6d41\u51fa\u7684\u6570\u636e<\/td>\n<\/tr>\n<tr class=\"row-12 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">-p<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u5339\u914d\u534f\u8bae\uff0c\u5982TCP\u3001UDP\u3001ICMP<\/td>\n<\/tr>\n<tr class=\"row-13 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;dport num<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u5339\u914d\u76ee\u6807\u7aef\u53e3\u53f7<\/td>\n<\/tr>\n<tr class=\"row-14 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;sport num<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u5339\u914d\u6765\u6e90\u7aef\u53e3\u53f7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u5728iptables\u547d\u4ee4\u540e\u6dfb\u52a0-L\u53c2\u6570\u67e5\u770b\u5df2\u6709\u7684\u9632\u706b\u5899\u89c4\u5219\u94fe\uff1a<\/strong><\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-L\nChain\u00a0INPUT\u00a0(policy\u00a0ACCEPT)\ntarget\u00a0prot\u00a0opt\u00a0source\u00a0destination\u00a0\nACCEPT\u00a0all\u00a0--\u00a0anywhere\u00a0anywhere\u00a0ctstate\u00a0RELATED,ESTABLISHED\nACCEPT\u00a0all\u00a0--\u00a0anywhere\u00a0anywhere\u00a0\nINPUT_direct\u00a0all\u00a0--\u00a0anywhere\u00a0anywhere\u00a0\nINPUT_ZONES_SOURCE\u00a0all\u00a0--\u00a0anywhere\u00a0anywhere\u00a0\nINPUT_ZONES\u00a0all\u00a0--\u00a0anywhere\u00a0anywhere\u00a0\nACCEPT\u00a0icmp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0\nREJECT\u00a0all\u00a0--\u00a0anywhere\u00a0anywhere\u00a0reject-with\u00a0icmp-host-prohibited\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u5728iptables\u547d\u4ee4\u540e\u6dfb\u52a0-F\u53c2\u6570\u6e05\u7a7a\u5df2\u6709\u7684\u9632\u706b\u5899\u89c4\u5219\u94fe\uff1a<\/strong><\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-F\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-L\nChain\u00a0INPUT\u00a0(policy\u00a0ACCEPT)\ntarget\u00a0prot\u00a0opt\u00a0source\u00a0destination\u00a0\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u628aINPUT\u89c4\u5219\u94fe\u7684\u9ed8\u8ba4\u7b56\u7565\u8bbe\u7f6e\u4e3a\u62d2\u7edd\uff1a<\/strong><\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-P\u00a0INPUT\u00a0DROP\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-L\nChain\u00a0INPUT\u00a0(policy\u00a0DROP)\ntarget\u00a0prot\u00a0opt\u00a0source\u00a0destination\u00a0\n\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u5982\u524d\u9762\u6240\u63d0\u5230\u7684\u9632\u706b\u5899\u7b56\u7565\u8bbe\u7f6e\u65e0\u975e\u6709\u4e24\u79cd\u65b9\u5f0f\uff0c\u4e00\u79cd\u662f\u201c\u901a\u201d\uff0c\u4e00\u79cd\u662f\u201c\u5835\u201d\uff0c\u5f53\u628aINPUT\u94fe\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u62d2\u7edd\u540e\uff0c\u5c31\u8981\u5f80\u91cc\u9762\u5199\u5165\u5141\u8bb8\u7b56\u7565\u4e86\uff0c\u5426\u5219\u6240\u6709\u6d41\u5165\u7684\u6570\u636e\u5305\u90fd\u4f1a\u88ab\u9ed8\u8ba4\u62d2\u7edd\u6389\uff0c\u540c\u5b66\u4eec\u9700\u8981\u7559\u610f\u89c4\u5219\u94fe\u7684\u9ed8\u8ba4\u7b56\u7565\u62d2\u7edd\u52a8\u4f5c\u53ea\u80fd\u662fDROP\uff0c\u800c\u4e0d\u80fd\u662fREJECT\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u5411INPUT\u94fe\u4e2d\u6dfb\u52a0\u5141\u8bb8ICMP\u6d41\u91cf\u8fdb\u5165\u7684\u7b56\u7565\u89c4\u5219\uff1a<\/strong><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u5728\u65e5\u5e38\u8fd0\u7ef4\u5de5\u4f5c\u4e2d\uff0c\u7ecf\u5e38\u4f1a\u4f7f\u7528ping\u547d\u4ee4\u6765\u68c0\u67e5\u5bf9\u65b9\u4e3b\u673a\u662f\u5426\u5728\u7ebf\uff0c\u800c\u5411\u9632\u706b\u5899\u7684INPUT\u89c4\u5219\u94fe\u4e2d\u6dfb\u52a0\u4e00\u6761\u5141\u8bb8ICMP\u6d41\u91cf\u8fdb\u5165\u7684\u7b56\u7565\u89c4\u5219\u5c31\u9ed8\u8ba4\u5141\u8bb8\u4e86\u8fd9\u79cdping\u547d\u4ee4\u68c0\u6d4b\u884c\u4e3a\u3002<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-I\u00a0INPUT\u00a0-p\u00a0icmp\u00a0-j\u00a0ACCEPT\n[root@linuxprobe\u00a0~]#\u00a0ping\u00a0-c\u00a04\u00a0192.168.10.10\nPING\u00a0192.168.10.10\u00a0(192.168.10.10)\u00a056(84)\u00a0bytes\u00a0of\u00a0data.\n64\u00a0bytes\u00a0from\u00a0192.168.10.10:\u00a0icmp_seq=1\u00a0ttl=64\u00a0time=0.156\u00a0ms\n64\u00a0bytes\u00a0from\u00a0192.168.10.10:\u00a0icmp_seq=2\u00a0ttl=64\u00a0time=0.117\u00a0ms\n64\u00a0bytes\u00a0from\u00a0192.168.10.10:\u00a0icmp_seq=3\u00a0ttl=64\u00a0time=0.099\u00a0ms\n64\u00a0bytes\u00a0from\u00a0192.168.10.10:\u00a0icmp_seq=4\u00a0ttl=64\u00a0time=0.090\u00a0ms\n---\u00a0192.168.10.10\u00a0ping\u00a0statistics\u00a0---\n4\u00a0packets\u00a0transmitted,\u00a04\u00a0received,\u00a00%\u00a0packet\u00a0loss,\u00a0time\u00a02999ms\nrtt\u00a0min\/avg\/max\/mdev\u00a0=\u00a00.090\/0.115\/0.156\/0.027\u00a0ms<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u5220\u9664INPUT\u89c4\u5219\u94fe\u4e2d\u521a\u521a\u52a0\u5165\u7684\u90a3\u6761\u7b56\u7565\uff08\u5141\u8bb8ICMP\u6d41\u91cf\uff09\uff0c\u5e76\u628a\u9ed8\u8ba4\u7b56\u7565\u8bbe\u7f6e\u4e3a\u5141\u8bb8\uff1a<\/strong><\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-D\u00a0INPUT\u00a01\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-P\u00a0INPUT\u00a0ACCEPT\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-L\nChain\u00a0INPUT\u00a0(policy\u00a0ACCEPT)\ntarget\u00a0prot\u00a0opt\u00a0source\u00a0destination\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u5c06INPUT\u89c4\u5219\u94fe\u8bbe\u7f6e\u4e3a\u53ea\u5141\u8bb8\u6307\u5b9a\u7f51\u6bb5\u7684\u4e3b\u673a\u8bbf\u95ee\u672c\u673a\u768422\u7aef\u53e3\uff0c\u62d2\u7edd\u6765\u81ea\u5176\u4ed6\u6240\u6709\u4e3b\u673a\u7684\u6d41\u91cf<\/strong>\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-I\u00a0INPUT\u00a0-s\u00a0192.168.10.0\/24\u00a0-p\u00a0tcp\u00a0--dport\u00a022\u00a0-j\u00a0ACCEPT\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-A\u00a0INPUT\u00a0-p\u00a0tcp\u00a0--dport\u00a022\u00a0-j\u00a0REJECT\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-L\nChain\u00a0INPUT\u00a0(policy\u00a0ACCEPT)\ntarget\u00a0prot\u00a0opt\u00a0source\u00a0destination\u00a0\nACCEPT\u00a0tcp\u00a0--\u00a0192.168.10.0\/24\u00a0anywhere\u00a0tcp\u00a0dpt:ssh\nREJECT\u00a0tcp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0tcp\u00a0dpt:ssh\u00a0reject-with\u00a0icmp-port-unreachable\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u518d\u6b21\u91cd\u7533\uff0c\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\u662f\u6309\u7167\u4ece\u4e0a\u5230\u4e0b\u7684\u987a\u5e8f\u5339\u914d\u7684\uff0c\u56e0\u6b64\u4e00\u5b9a\u8981\u628a\u5141\u8bb8\u52a8\u4f5c\u653e\u5230\u62d2\u7edd\u52a8\u4f5c\u524d\u9762\uff0c\u5426\u5219\u6240\u6709\u7684\u6d41\u91cf\u5c31\u5c06\u88ab\u62d2\u7edd\u6389\uff0c\u4ece\u800c\u5bfc\u81f4\u4efb\u4f55\u4e3b\u673a\u90fd\u65e0\u6cd5\u8bbf\u95ee\u6211\u4eec\u7684\u670d\u52a1\u3002\u53e6\u5916\uff0c\u8fd9\u91cc\u63d0\u5230\u768422\u53f7\u7aef\u53e3\u662fssh\u670d\u52a1\u4f7f\u7528\u7684\uff08\u6709\u5173ssh\u670d\u52a1\uff0c\u8bf7\u89c1\u4e0b\u4e00\u7ae0\uff09\uff0c\u5218\u9044\u8001\u5e08\u5148\u5728\u8fd9\u91cc\u6316\u5751\uff0c\u7b49\u5927\u5bb6\u5b66\u5b8c\u7b2c9\u7ae0\u540e\u53ef\u518d\u9a8c\u8bc1\u8fd9\u4e2a\u5b9e\u9a8c\u7684\u6548\u679c\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u5728\u8bbe\u7f6e\u5b8c\u4e0a\u8ff0INPUT\u89c4\u5219\u94fe\u4e4b\u540e\uff0c\u6211\u4eec\u4f7f\u7528IP\u5730\u5740\u5728192.168.10.0\/24\u7f51\u6bb5\u5185\u7684\u4e3b\u673a\u8bbf\u95ee\u670d\u52a1\u5668\uff08\u5373\u524d\u9762\u63d0\u5230\u7684\u8bbe\u7f6e\u4e86INPUT\u89c4\u5219\u94fe\u7684\u4e3b\u673a\uff09\u768422\u7aef\u53e3\uff0c\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@Client\u00a0A\u00a0~]#\u00a0ssh\u00a0192.168.10.10\nThe\u00a0authenticity\u00a0of\u00a0host\u00a0'192.168.10.10\u00a0(192.168.10.10)'\u00a0can't\u00a0be\u00a0established.\nECDSA\u00a0key\u00a0fingerprint\u00a0is\u00a070:3b:5d:37:96:7b:2e:a5:28:0d:7e:dc:47:6a:fe:5c.\nAre\u00a0you\u00a0sure\u00a0you\u00a0want\u00a0to\u00a0continue\u00a0connecting\u00a0(yes\/no)?\u00a0yes\nWarning:\u00a0Permanently\u00a0added\u00a0'192.168.10.10'\u00a0(ECDSA)\u00a0to\u00a0the\u00a0list\u00a0of\u00a0known\u00a0hosts.\nroot@192.168.10.10's\u00a0password:\u00a0\nLast\u00a0login:\u00a0Sun\u00a0Feb\u00a012\u00a001:50:25\u00a02017\n[root@Client\u00a0A\u00a0~]#<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u7136\u540e\uff0c\u6211\u4eec\u518d\u4f7f\u7528IP\u5730\u5740\u5728192.168.20.0\/24\u7f51\u6bb5\u5185\u7684\u4e3b\u673a\u8bbf\u95ee\u670d\u52a1\u5668\u768422\u7aef\u53e3\uff08\u867d\u7f51\u6bb5\u4e0d\u540c\uff0c\u4f46\u5df2\u786e\u8ba4\u53ef\u4ee5\u76f8\u4e92\u901a\u4fe1\uff09\uff0c\u6548\u679c\u5982\u4e0b\uff0c\u5c31\u4f1a\u63d0\u793a\u8fde\u63a5\u8bf7\u6c42\u88ab\u62d2\u7edd\u4e86\uff08Connection\u00a0failed\uff09\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@Client\u00a0B\u00a0~]#\u00a0ssh\u00a0192.168.10.10\nConnecting\u00a0to\u00a0192.168.10.10:22...\nCould\u00a0not\u00a0connect\u00a0to\u00a0'192.168.10.10'\u00a0(port\u00a022):\u00a0Connection\u00a0failed.<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u5411INPUT\u89c4\u5219\u94fe\u4e2d\u6dfb\u52a0\u62d2\u7edd\u6240\u6709\u4eba\u8bbf\u95ee\u672c\u673a12345\u7aef\u53e3\u7684\u7b56\u7565\u89c4\u5219<\/strong>\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-I\u00a0INPUT\u00a0-p\u00a0tcp\u00a0--dport\u00a012345\u00a0-j\u00a0REJECT\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-I\u00a0INPUT\u00a0-p\u00a0udp\u00a0--dport\u00a012345\u00a0-j\u00a0REJECT\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-L\nChain\u00a0INPUT\u00a0(policy\u00a0ACCEPT)\ntarget\u00a0prot\u00a0opt\u00a0source\u00a0destination\u00a0\nREJECT\u00a0udp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0udp\u00a0dpt:italk\u00a0reject-with\u00a0icmp-port-unreachable\nREJECT\u00a0tcp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0tcp\u00a0dpt:italk\u00a0reject-with\u00a0icmp-port-unreachable\nACCEPT\u00a0tcp\u00a0--\u00a0192.168.10.0\/24\u00a0anywhere\u00a0tcp\u00a0dpt:ssh\nREJECT\u00a0tcp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0tcp\u00a0dpt:ssh\u00a0reject-with\u00a0icmp-port-unreachable\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u5411INPUT\u89c4\u5219\u94fe\u4e2d\u6dfb\u52a0\u62d2\u7edd192.168.10.5\u4e3b\u673a\u8bbf\u95ee\u672c\u673a80\u7aef\u53e3\uff08Web\u670d\u52a1\uff09\u7684\u7b56\u7565\u89c4\u5219<\/strong>\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-I\u00a0INPUT\u00a0-p\u00a0tcp\u00a0-s\u00a0192.168.10.5\u00a0--dport\u00a080\u00a0-j\u00a0REJECT\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-L\nChain\u00a0INPUT\u00a0(policy\u00a0ACCEPT)\ntarget\u00a0prot\u00a0opt\u00a0source\u00a0destination\u00a0\nREJECT\u00a0tcp\u00a0--\u00a0192.168.10.5\u00a0anywhere\u00a0tcp\u00a0dpt:http\u00a0reject-with\u00a0icmp-port-unreachable\nREJECT\u00a0udp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0udp\u00a0dpt:italk\u00a0reject-with\u00a0icmp-port-unreachable\nREJECT\u00a0tcp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0tcp\u00a0dpt:italk\u00a0reject-with\u00a0icmp-port-unreachable\nACCEPT\u00a0tcp\u00a0--\u00a0192.168.10.0\/24\u00a0anywhere\u00a0tcp\u00a0dpt:ssh\nREJECT\u00a0tcp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0tcp\u00a0dpt:ssh\u00a0reject-with\u00a0icmp-port-unreachable\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u5411INPUT\u89c4\u5219\u94fe\u4e2d\u6dfb\u52a0\u62d2\u7edd\u6240\u6709\u4e3b\u673a\u8bbf\u95ee\u672c\u673a1000<\/strong>\uff5e<strong style=\"box-sizing: border-box;\">1024<\/strong><strong style=\"box-sizing: border-box;\">\u7aef\u53e3\u7684\u7b56\u7565\u89c4\u5219<\/strong>\uff1a<\/p>\n<pre class=\"cnblogs_code\" style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-A\u00a0INPUT\u00a0-p\u00a0tcp\u00a0--dport\u00a01000:1024\u00a0-j\u00a0REJECT\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-A\u00a0INPUT\u00a0-p\u00a0udp\u00a0--dport\u00a01000:1024\u00a0-j\u00a0REJECT\n[root@linuxprobe\u00a0~]#\u00a0iptables\u00a0-L\nChain\u00a0INPUT\u00a0(policy\u00a0ACCEPT)\ntarget\u00a0prot\u00a0opt\u00a0source\u00a0destination\u00a0\nREJECT\u00a0tcp\u00a0--\u00a0192.168.10.5\u00a0anywhere\u00a0tcp\u00a0dpt:http\u00a0reject-with\u00a0icmp-port-unreachable\nREJECT\u00a0udp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0udp\u00a0dpt:italk\u00a0reject-with\u00a0icmp-port-unreachable\nREJECT\u00a0tcp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0tcp\u00a0dpt:italk\u00a0reject-with\u00a0icmp-port-unreachable\nACCEPT\u00a0tcp\u00a0--\u00a0192.168.10.0\/24\u00a0anywhere\u00a0tcp\u00a0dpt:ssh\nREJECT\u00a0tcp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0tcp\u00a0dpt:ssh\u00a0reject-with\u00a0icmp-port-unreachable\nREJECT\u00a0tcp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0tcp\u00a0dpts:cadlock2:1024\u00a0reject-with\u00a0icmp-port-unreachable\nREJECT\u00a0udp\u00a0--\u00a0anywhere\u00a0anywhere\u00a0udp\u00a0dpts:cadlock2:1024\u00a0reject-with\u00a0icmp-port-unreachable\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u6709\u5173iptables\u547d\u4ee4\u7684\u77e5\u8bc6\u8bb2\u89e3\u5230\u6b64\u5c31\u7ed3\u675f\u4e86\uff0c\u5927\u5bb6\u662f\u4e0d\u662f\u610f\u72b9\u672a\u5c3d\uff1f\u8003\u8651\u5230Linux\u9632\u706b\u5899\u7684\u53d1\u5c55\u8d8b\u52bf\uff0c\u5927\u5bb6\u53ea\u8981\u80fd\u628a\u4e0a\u9762\u7684\u5b9e\u4f8b\u5438\u6536\u6d88\u5316\uff0c\u5c31\u53ef\u4ee5\u5b8c\u5168\u641e\u5b9a\u65e5\u5e38\u7684iptables\u914d\u7f6e\u5de5\u4f5c\u4e86\u3002\u4f46\u662f\u8bf7\u7279\u522b\u6ce8\u610f\uff0c\u4f7f\u7528iptables\u547d\u4ee4\u914d\u7f6e\u7684\u9632\u706b\u5899\u89c4\u5219\u9ed8\u8ba4\u4f1a\u5728\u7cfb\u7edf\u4e0b\u4e00\u6b21\u91cd\u542f\u65f6\u5931\u6548\uff0c\u5982\u679c\u60f3\u8ba9\u914d\u7f6e\u7684\u9632\u706b\u5899\u7b56\u7565\u6c38\u4e45\u751f\u6548\uff0c\u8fd8\u8981\u6267\u884c\u4fdd\u5b58\u547d\u4ee4\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0service\u00a0iptables\u00a0save\niptables:\u00a0Saving\u00a0firewall\u00a0rules\u00a0to\u00a0\/etc\/sysconfig\/iptables:\u00a0[\u00a0OK\u00a0]<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><span style=\"box-sizing: border-box; color: #800080;\"><strong style=\"box-sizing: border-box;\">\u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n<blockquote style=\"box-sizing: border-box; padding: 10px 20px; margin: 0px 0px 20px; border-left-width: 5px; border-left-style: solid; border-color: rgba(0, 0, 0, 0.14902); color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17.1429px; white-space: normal; background-color: #ffffff;\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u56e0\u8bfb\u8005\u4eec\u786c\u4ef6\u4e0d\u540c\u6216\u64cd\u4f5c\u9519\u8bef\u90fd\u53ef\u80fd\u5bfc\u81f4\u5b9e\u9a8c\u914d\u7f6e\u51fa\u9519\uff0c\u8bf7\u8010\u5fc3\u518d\u4ed4\u7ec6\u770b\u770b\u64cd\u4f5c\u6b65\u9aa4\u5427\uff0c\u4e0d\u8981\u6c14\u9981~<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\">Linux\u6280\u672f\u4ea4\u6d41\u8bf7\u52a0A\u7fa4\uff1a560843(<strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\">\u6ee1<\/span><\/strong>)\uff0cB\u7fa4\uff1a340829(<span style=\"box-sizing: border-box; color: #008000;\">\u63a8\u8350<\/span>)\uff0cC\u7fa4\uff1a463590\uff08<strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\">\u63a8\u8350<\/span><\/strong>\uff09\uff0c<a style=\"box-sizing: border-box; color: #d2322d; text-decoration: none;\" href=\"https:\/\/www.linuxprobe.com\/club\">\u70b9\u6b64\u67e5\u770b\u5168\u56fd\u7fa4<\/a>\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\">*\u672c\u7fa4\u7279\u8272\uff1a\u901a\u8fc7\u53e3\u4ee4\u9a8c\u8bc1\u786e\u4fdd\u6bcf\u4e00\u4e2a\u7fa4\u5458\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\u514d\u8d39\u9886\u53d6\u5b9a\u5236\u793c\u54c1\u3002<\/p>\n<\/blockquote>\n<h5 style=\"box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 100; line-height: 1.1; margin-top: 10px; margin-bottom: 10px; font-size: 14px; color: #3d4450; white-space: normal; background-color: #ffffff;\"><span id=\"83_Firewalld\" style=\"box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\">8.3 Firewalld<\/span><\/strong><\/span><\/h5>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">RHEL 7\u7cfb\u7edf\u4e2d\u96c6\u6210\u4e86\u591a\u6b3e\u9632\u706b\u5899\u7ba1\u7406\u5de5\u5177\uff0c\u5176\u4e2dfirewalld\uff08Dynamic Firewall Manager of Linux systems\uff0cLinux\u7cfb\u7edf\u7684\u52a8\u6001\u9632\u706b\u5899\u7ba1\u7406\u5668\uff09\u670d\u52a1\u662f\u9ed8\u8ba4\u7684\u9632\u706b\u5899\u914d\u7f6e\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u62e5\u6709\u57fa\u4e8eCLI\uff08\u547d\u4ee4\u884c\u754c\u9762\uff09\u548c\u57fa\u4e8eGUI\uff08\u56fe\u5f62\u7528\u6237\u754c\u9762\uff09\u7684\u4e24\u79cd\u7ba1\u7406\u65b9\u5f0f\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u76f8\u8f83\u4e8e\u4f20\u7edf\u7684\u9632\u706b\u5899\u7ba1\u7406\u914d\u7f6e\u5de5\u5177\uff0cfirewalld\u652f\u6301\u52a8\u6001\u66f4\u65b0\u6280\u672f\u5e76\u52a0\u5165\u4e86\u533a\u57df\uff08zone\uff09\u7684\u6982\u5ff5\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u533a\u57df\u5c31\u662ffirewalld\u9884\u5148\u51c6\u5907\u4e86\u51e0\u5957\u9632\u706b\u5899\u7b56\u7565\u96c6\u5408\uff08\u7b56\u7565\u6a21\u677f\uff09\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u751f\u4ea7\u573a\u666f\u7684\u4e0d\u540c\u800c\u9009\u62e9\u5408\u9002\u7684\u7b56\u7565\u96c6\u5408\uff0c\u4ece\u800c\u5b9e\u73b0\u9632\u706b\u5899\u7b56\u7565\u4e4b\u95f4\u7684\u5feb\u901f\u5207\u6362\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u6709\u4e00\u53f0\u7b14\u8bb0\u672c\u7535\u8111\uff0c\u6bcf\u5929\u90fd\u8981\u5728\u529e\u516c\u5ba4\u3001\u5496\u5561\u5385\u548c\u5bb6\u91cc\u4f7f\u7528\u3002\u6309\u5e38\u7406\u6765\u8bb2\uff0c\u8fd9\u4e09\u8005\u7684\u5b89\u5168\u6027\u6309\u7167\u7531\u9ad8\u5230\u4f4e\u7684\u987a\u5e8f\u6765\u6392\u5217\uff0c\u5e94\u8be5\u662f\u5bb6\u5ead\u3001\u516c\u53f8\u529e\u516c\u5ba4\u3001\u5496\u5561\u5385\u3002\u5f53\u524d\uff0c\u6211\u4eec\u5e0c\u671b\u4e3a\u8fd9\u53f0\u7b14\u8bb0\u672c\u7535\u8111\u6307\u5b9a\u5982\u4e0b\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\uff1a\u5728\u5bb6\u4e2d\u5141\u8bb8\u8bbf\u95ee\u6240\u6709\u670d\u52a1\uff1b\u5728\u529e\u516c\u5ba4\u5185\u4ec5\u5141\u8bb8\u8bbf\u95ee\u6587\u4ef6\u5171\u4eab\u670d\u52a1\uff1b\u5728\u5496\u5561\u5385\u4ec5\u5141\u8bb8\u4e0a\u7f51\u6d4f\u89c8\u3002\u5728\u4ee5\u5f80\uff0c\u6211\u4eec\u9700\u8981\u9891\u7e41\u5730\u624b\u52a8\u8bbe\u7f6e\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\uff0c\u800c\u73b0\u5728\u53ea\u9700\u8981\u9884\u8bbe\u597d\u533a\u57df\u96c6\u5408\uff0c\u7136\u540e\u53ea\u9700\u8f7b\u70b9\u9f20\u6807\u5c31\u53ef\u4ee5\u81ea\u52a8\u5207\u6362\u4e86\uff0c\u4ece\u800c\u6781\u5927\u5730\u63d0\u5347\u4e86\u9632\u706b\u5899\u7b56\u7565\u7684\u5e94\u7528\u6548\u7387\u3002firewalld\u4e2d\u5e38\u89c1\u7684\u533a\u57df\u540d\u79f0\uff08\u9ed8\u8ba4\u4e3apublic\uff09\u4ee5\u53ca\u76f8\u5e94\u7684\u7b56\u7565\u89c4\u5219\u5982\u88688-2\u6240\u793a\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u88688-2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 firewalld\u4e2d\u5e38\u7528\u7684\u533a\u57df\u540d\u79f0\u53ca\u7b56\u7565\u89c4\u5219<\/p>\n<table id=\"tablepress-87\" class=\"tablepress tablepress-id-87\" width=\"712\">\n<tbody class=\"row-hover\" style=\"box-sizing: border-box;\">\n<tr class=\"row-1 odd firstRow\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-top-width: 0px; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u533a\u57df<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-top-width: 0px; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u9ed8\u8ba4\u89c4\u5219\u7b56\u7565<\/td>\n<\/tr>\n<tr class=\"row-2 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">trusted<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u5141\u8bb8\u6240\u6709\u7684\u6570\u636e\u5305<\/td>\n<\/tr>\n<tr class=\"row-3 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">home<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u62d2\u7edd\u6d41\u5165\u7684\u6d41\u91cf\uff0c\u9664\u975e\u4e0e\u6d41\u51fa\u7684\u6d41\u91cf\u76f8\u5173\uff1b\u800c\u5982\u679c\u6d41\u91cf\u4e0essh\u3001mdns\u3001ipp-client\u3001amba-client\u4e0edhcpv6-client\u670d\u52a1\u76f8\u5173\uff0c\u5219\u5141\u8bb8\u6d41\u91cf<\/td>\n<\/tr>\n<tr class=\"row-4 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">internal<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u7b49\u540c\u4e8ehome\u533a\u57df<\/td>\n<\/tr>\n<tr class=\"row-5 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">work<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u62d2\u7edd\u6d41\u5165\u7684\u6d41\u91cf\uff0c\u9664\u975e\u4e0e\u6d41\u51fa\u7684\u6d41\u91cf\u76f8\u5173\uff1b\u800c\u5982\u679c\u6d41\u91cf\u4e0essh\u3001ipp-client\u4e0edhcpv6-client\u670d\u52a1\u76f8\u5173\uff0c\u5219\u5141\u8bb8\u6d41\u91cf<\/td>\n<\/tr>\n<tr class=\"row-6 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">public<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u62d2\u7edd\u6d41\u5165\u7684\u6d41\u91cf\uff0c\u9664\u975e\u4e0e\u6d41\u51fa\u7684\u6d41\u91cf\u76f8\u5173\uff1b\u800c\u5982\u679c\u6d41\u91cf\u4e0essh\u3001dhcpv6-client\u670d\u52a1\u76f8\u5173\uff0c\u5219\u5141\u8bb8\u6d41\u91cf<\/td>\n<\/tr>\n<tr class=\"row-7 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">external<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u62d2\u7edd\u6d41\u5165\u7684\u6d41\u91cf\uff0c\u9664\u975e\u4e0e\u6d41\u51fa\u7684\u6d41\u91cf\u76f8\u5173\uff1b\u800c\u5982\u679c\u6d41\u91cf\u4e0essh\u670d\u52a1\u76f8\u5173\uff0c\u5219\u5141\u8bb8\u6d41\u91cf<\/td>\n<\/tr>\n<tr class=\"row-8 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">dmz<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u62d2\u7edd\u6d41\u5165\u7684\u6d41\u91cf\uff0c\u9664\u975e\u4e0e\u6d41\u51fa\u7684\u6d41\u91cf\u76f8\u5173\uff1b\u800c\u5982\u679c\u6d41\u91cf\u4e0essh\u670d\u52a1\u76f8\u5173\uff0c\u5219\u5141\u8bb8\u6d41\u91cf<\/td>\n<\/tr>\n<tr class=\"row-9 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">block<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u62d2\u7edd\u6d41\u5165\u7684\u6d41\u91cf\uff0c\u9664\u975e\u4e0e\u6d41\u51fa\u7684\u6d41\u91cf\u76f8\u5173<\/td>\n<\/tr>\n<tr class=\"row-10 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">drop<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u62d2\u7edd\u6d41\u5165\u7684\u6d41\u91cf\uff0c\u9664\u975e\u4e0e\u6d41\u51fa\u7684\u6d41\u91cf\u76f8\u5173<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\n<h6 style=\"box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 500; line-height: 1.1; margin-top: 10px; margin-bottom: 10px; font-size: 12px; color: #3d4450; white-space: normal; background-color: #ffffff;\"><span id=\"831\" style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\"><strong style=\"box-sizing: border-box;\">8.3.1 \u7ec8\u7aef\u7ba1\u7406\u5de5\u5177<\/strong><\/span><\/span><\/h6>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u7b2c2\u7ae0\u5728\u8bb2\u89e3<a style=\"box-sizing: border-box; color: #d2322d; text-decoration: none;\" href=\"https:\/\/www.linuxprobe.com\/\">Linux\u547d\u4ee4<\/a>\u65f6\u66fe\u7ecf\u542c\u5230\uff0c\u547d\u4ee4\u884c\u7ec8\u7aef\u662f\u4e00\u79cd\u6781\u5bcc\u6548\u7387\u7684\u5de5\u4f5c\u65b9\u5f0f\uff0cfirewall-cmd\u662ffirewalld\u9632\u706b\u5899\u914d\u7f6e\u7ba1\u7406\u5de5\u5177\u7684CLI\uff08\u547d\u4ee4\u884c\u754c\u9762\uff09\u7248\u672c\u3002\u5b83\u7684\u53c2\u6570\u4e00\u822c\u90fd\u662f\u4ee5\u201c\u957f\u683c\u5f0f\u201d\u6765\u63d0\u4f9b\u7684\uff0c\u5927\u5bb6\u4e0d\u8981\u4e00\u542c\u5230\u957f\u683c\u5f0f\u5c31\u5934\u5927\uff0c\u56e0\u4e3aRHEL 7\u7cfb\u7edf\u652f\u6301\u90e8\u5206\u547d\u4ee4\u7684\u53c2\u6570\u8865\u9f50\uff0c\u5176\u4e2d\u5c31\u5305\u542b\u8fd9\u6761\u547d\u4ee4\uff08\u5f88\u9177\u5427\uff09\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u73b0\u5728\u9664\u4e86\u80fd\u7528Tab\u952e\u81ea\u52a8\u8865\u9f50\u547d\u4ee4\u6216\u6587\u4ef6\u540d\u7b49\u5185\u5bb9\u4e4b\u5916\uff0c\u8fd8\u53ef\u4ee5\u7528Tab\u952e\u6765\u8865\u9f50\u88688-3\u4e2d\u6240\u793a\u7684\u957f\u683c\u5f0f\u53c2\u6570\u4e86\uff08\u8fd9\u592a\u68d2\u4e86\uff09\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u88688-3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 firewall-cmd\u547d\u4ee4\u4e2d\u4f7f\u7528\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n<table id=\"tablepress-88\" class=\"tablepress tablepress-id-88\" width=\"712\">\n<tbody class=\"row-hover\" style=\"box-sizing: border-box;\">\n<tr class=\"row-1 odd firstRow\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-top-width: 0px; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u53c2\u6570<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-top-width: 0px; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u4f5c\u7528<\/td>\n<\/tr>\n<tr class=\"row-2 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;get-default-zone<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u67e5\u8be2\u9ed8\u8ba4\u7684\u533a\u57df\u540d\u79f0<\/td>\n<\/tr>\n<tr class=\"row-3 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;set-default-zone=&lt;\u533a\u57df\u540d\u79f0&gt;<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u8bbe\u7f6e\u9ed8\u8ba4\u7684\u533a\u57df\uff0c\u4f7f\u5176\u6c38\u4e45\u751f\u6548<\/td>\n<\/tr>\n<tr class=\"row-4 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;get-zones<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u663e\u793a\u53ef\u7528\u7684\u533a\u57df<\/td>\n<\/tr>\n<tr class=\"row-5 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;get-services<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u663e\u793a\u9884\u5148\u5b9a\u4e49\u7684\u670d\u52a1<\/td>\n<\/tr>\n<tr class=\"row-6 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;get-active-zones<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u663e\u793a\u5f53\u524d\u6b63\u5728\u4f7f\u7528\u7684\u533a\u57df\u4e0e\u7f51\u5361\u540d\u79f0<\/td>\n<\/tr>\n<tr class=\"row-7 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;add-source=<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u5c06\u6e90\u81ea\u6b64IP\u6216\u5b50\u7f51\u7684\u6d41\u91cf\u5bfc\u5411\u6307\u5b9a\u7684\u533a\u57df<\/td>\n<\/tr>\n<tr class=\"row-8 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;remove-source=<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u4e0d\u518d\u5c06\u6e90\u81ea\u6b64IP\u6216\u5b50\u7f51\u7684\u6d41\u91cf\u5bfc\u5411\u67d0\u4e2a\u6307\u5b9a\u533a\u57df<\/td>\n<\/tr>\n<tr class=\"row-9 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;add-interface=&lt;\u7f51\u5361\u540d\u79f0&gt;<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u5c06\u6e90\u81ea\u8be5\u7f51\u5361\u7684\u6240\u6709\u6d41\u91cf\u90fd\u5bfc\u5411\u67d0\u4e2a\u6307\u5b9a\u533a\u57df<\/td>\n<\/tr>\n<tr class=\"row-10 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;change-interface=&lt;\u7f51\u5361\u540d\u79f0&gt;<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u5c06\u67d0\u4e2a\u7f51\u5361\u4e0e\u533a\u57df\u8fdb\u884c\u5173\u8054<\/td>\n<\/tr>\n<tr class=\"row-11 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;list-all<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u663e\u793a\u5f53\u524d\u533a\u57df\u7684\u7f51\u5361\u914d\u7f6e\u53c2\u6570\u3001\u8d44\u6e90\u3001\u7aef\u53e3\u4ee5\u53ca\u670d\u52a1\u7b49\u4fe1\u606f<\/td>\n<\/tr>\n<tr class=\"row-12 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;list-all-zones<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u663e\u793a\u6240\u6709\u533a\u57df\u7684\u7f51\u5361\u914d\u7f6e\u53c2\u6570\u3001\u8d44\u6e90\u3001\u7aef\u53e3\u4ee5\u53ca\u670d\u52a1\u7b49\u4fe1\u606f<\/td>\n<\/tr>\n<tr class=\"row-13 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;add-service=&lt;\u670d\u52a1\u540d&gt;<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u8bbe\u7f6e\u9ed8\u8ba4\u533a\u57df\u5141\u8bb8\u8be5\u670d\u52a1\u7684\u6d41\u91cf<\/td>\n<\/tr>\n<tr class=\"row-14 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;add-port=&lt;\u7aef\u53e3\u53f7\/\u534f\u8bae&gt;<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u8bbe\u7f6e\u9ed8\u8ba4\u533a\u57df\u5141\u8bb8\u8be5\u7aef\u53e3\u7684\u6d41\u91cf<\/td>\n<\/tr>\n<tr class=\"row-15 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;remove-service=&lt;\u670d\u52a1\u540d&gt;<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u8bbe\u7f6e\u9ed8\u8ba4\u533a\u57df\u4e0d\u518d\u5141\u8bb8\u8be5\u670d\u52a1\u7684\u6d41\u91cf<\/td>\n<\/tr>\n<tr class=\"row-16 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;remove-port=&lt;\u7aef\u53e3\u53f7\/\u534f\u8bae&gt;<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u8bbe\u7f6e\u9ed8\u8ba4\u533a\u57df\u4e0d\u518d\u5141\u8bb8\u8be5\u7aef\u53e3\u7684\u6d41\u91cf<\/td>\n<\/tr>\n<tr class=\"row-17 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;reload<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u8ba9\u201c\u6c38\u4e45\u751f\u6548\u201d\u7684\u914d\u7f6e\u89c4\u5219\u7acb\u5373\u751f\u6548\uff0c\u5e76\u8986\u76d6\u5f53\u524d\u7684\u914d\u7f6e\u89c4\u5219<\/td>\n<\/tr>\n<tr class=\"row-18 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">&#8211;panic-on<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u5f00\u542f\u5e94\u6025\u72b6\u51b5\u6a21\u5f0f<\/td>\n<\/tr>\n<tr class=\"row-19 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">&#8211;panic-off<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u5173\u95ed\u5e94\u6025\u72b6\u51b5\u6a21\u5f0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u4e0eLinux\u7cfb\u7edf\u4e2d\u5176\u4ed6\u7684\u9632\u706b\u5899\u7b56\u7565\u914d\u7f6e\u5de5\u5177\u4e00\u6837\uff0c\u4f7f\u7528firewalld\u914d\u7f6e\u7684\u9632\u706b\u5899\u7b56\u7565\u9ed8\u8ba4\u4e3a\u8fd0\u884c\u65f6\uff08Runtime\uff09\u6a21\u5f0f\uff0c\u53c8\u79f0\u4e3a\u5f53\u524d\u751f\u6548\u6a21\u5f0f\uff0c\u800c\u4e14\u968f\u7740\u7cfb\u7edf\u7684\u91cd\u542f\u4f1a\u5931\u6548\u3002\u5982\u679c\u60f3\u8ba9\u914d\u7f6e\u7b56\u7565\u4e00\u76f4\u5b58\u5728\uff0c\u5c31\u9700\u8981\u4f7f\u7528\u6c38\u4e45\uff08Permanent\uff09\u6a21\u5f0f\u4e86\uff0c\u65b9\u6cd5\u5c31\u662f\u5728\u7528firewall-cmd\u547d\u4ee4\u6b63\u5e38\u8bbe\u7f6e\u9632\u706b\u5899\u7b56\u7565\u65f6\u6dfb\u52a0&#8211;permanent\u53c2\u6570\uff0c\u8fd9\u6837\u914d\u7f6e\u7684\u9632\u706b\u5899\u7b56\u7565\u5c31\u53ef\u4ee5\u6c38\u4e45\u751f\u6548\u4e86\u3002\u4f46\u662f\uff0c\u6c38\u4e45\u751f\u6548\u6a21\u5f0f\u6709\u4e00\u4e2a\u201c\u4e0d\u8fd1\u4eba\u60c5\u201d\u7684\u7279\u70b9\uff0c\u5c31\u662f\u4f7f\u7528\u5b83\u8bbe\u7f6e\u7684\u7b56\u7565\u53ea\u6709\u5728\u7cfb\u7edf\u91cd\u542f\u4e4b\u540e\u624d\u80fd\u81ea\u52a8\u751f\u6548\u3002\u5982\u679c\u60f3\u8ba9\u914d\u7f6e\u7684\u7b56\u7565\u7acb\u5373\u751f\u6548\uff0c\u9700\u8981\u624b\u52a8\u6267\u884cfirewall-cmd &#8211;reload\u547d\u4ee4\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u63a5\u4e0b\u6765\u7684\u5b9e\u9a8c\u90fd\u5f88\u7b80\u5355\uff0c\u4f46\u662f\u63d0\u9192\u5927\u5bb6\u4e00\u5b9a\u8981\u4ed4\u7ec6\u67e5\u770b\u5218\u9044\u8001\u5e08\u4f7f\u7528\u7684\u662fRuntime\u6a21\u5f0f\u8fd8\u662fPermanent\u6a21\u5f0f\u3002\u5982\u679c\u4e0d\u5173\u6ce8\u8fd9\u4e2a\u7ec6\u8282\uff0c\u5c31\u7b97\u662f\u6b63\u786e\u914d\u7f6e\u4e86\u9632\u706b\u5899\u7b56\u7565\uff0c\u4e5f\u53ef\u80fd\u65e0\u6cd5\u8fbe\u5230\u9884\u671f\u7684\u6548\u679c\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u67e5\u770bfirewalld\u670d\u52a1\u5f53\u524d\u6240\u4f7f\u7528\u7684\u533a\u57df\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--get-default-zone\npublic<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u67e5\u8be2eno16777728\u7f51\u5361\u5728firewalld\u670d\u52a1\u4e2d\u7684\u533a\u57df\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--get-zone-of-interface=eno16777728\npublic<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u628afirewalld\u670d\u52a1\u4e2deno16777728\u7f51\u5361\u7684\u9ed8\u8ba4\u533a\u57df\u4fee\u6539\u4e3aexternal\uff0c\u5e76\u5728\u7cfb\u7edf\u91cd\u542f\u540e\u751f\u6548\u3002\u5206\u522b\u67e5\u770b\u5f53\u524d\u4e0e\u6c38\u4e45\u6a21\u5f0f\u4e0b\u7684\u533a\u57df\u540d\u79f0\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--permanent\u00a0--zone=external\u00a0--change-interface=eno16777728\nsuccess\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--get-zone-of-interface=eno16777728\npublic\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--permanent\u00a0--get-zone-of-interface=eno16777728\nexternal<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u628afirewalld\u670d\u52a1\u7684\u5f53\u524d\u9ed8\u8ba4\u533a\u57df\u8bbe\u7f6e\u4e3apublic\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--set-default-zone=public\nsuccess\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--get-default-zone\u00a0\npublic<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u542f\u52a8\/\u5173\u95edfirewalld\u9632\u706b\u5899\u670d\u52a1\u7684\u5e94\u6025\u72b6\u51b5\u6a21\u5f0f\uff0c\u963b\u65ad\u4e00\u5207\u7f51\u7edc\u8fde\u63a5\uff08\u5f53\u8fdc\u7a0b\u63a7\u5236\u670d\u52a1\u5668\u65f6\u8bf7\u614e\u7528\uff09\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--panic-on\nsuccess\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--panic-off\nsuccess<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u67e5\u8be2public\u533a\u57df\u662f\u5426\u5141\u8bb8\u8bf7\u6c42SSH\u548cHTTPS\u534f\u8bae\u7684\u6d41\u91cf\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--zone=public\u00a0--query-service=ssh\nyes\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--zone=public\u00a0--query-service=https\nno<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u628afirewalld\u670d\u52a1\u4e2d\u8bf7\u6c42HTTPS\u534f\u8bae\u7684\u6d41\u91cf\u8bbe\u7f6e\u4e3a\u6c38\u4e45\u5141\u8bb8\uff0c\u5e76\u7acb\u5373\u751f\u6548\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--zone=public\u00a0--add-service=https\nsuccess\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--permanent\u00a0--zone=public\u00a0--add-service=https\nsuccess\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--reload\nsuccess<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u628afirewalld\u670d\u52a1\u4e2d\u8bf7\u6c42HTTP\u534f\u8bae\u7684\u6d41\u91cf\u8bbe\u7f6e\u4e3a\u6c38\u4e45\u62d2\u7edd\uff0c\u5e76\u7acb\u5373\u751f\u6548\uff1a<\/p>\n<pre class=\"prettyprint bash\" style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 20px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--permanent\u00a0--zone=public\u00a0--remove-service=http\u00a0\nsuccess\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--reload\u00a0\nsuccess<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u628a\u5728firewalld\u670d\u52a1\u4e2d\u8bbf\u95ee8080\u548c8081\u7aef\u53e3\u7684\u6d41\u91cf\u7b56\u7565\u8bbe\u7f6e\u4e3a\u5141\u8bb8\uff0c\u4f46\u4ec5\u9650\u5f53\u524d\u751f\u6548\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--zone=public\u00a0--add-port=8080-8081\/tcp\nsuccess\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--zone=public\u00a0--list-ports\u00a0\n8080-8081\/tcp<\/pre>\n<div class=\"cnblogs_code_toolbar\" style=\"box-sizing: border-box; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17.1429px; white-space: normal; background-color: #ffffff;\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u628a\u539f\u672c\u8bbf\u95ee\u672c\u673a888\u7aef\u53e3\u7684\u6d41\u91cf\u8f6c\u53d1\u523022\u7aef\u53e3\uff0c\u8981\u4e14\u6c42\u5f53\u524d\u548c\u957f\u671f\u5747\u6709\u6548\uff1a<\/p>\n<blockquote style=\"box-sizing: border-box; padding: 10px 20px; margin: 0px 0px 20px; border-left-width: 5px; border-left-style: solid; border-color: rgba(0, 0, 0, 0.14902);\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u6d41\u91cf\u8f6c\u53d1\u547d\u4ee4\u683c\u5f0f\u4e3afirewall-cmd &#8211;permanent &#8211;zone=<strong style=\"box-sizing: border-box;\">&lt;\u533a\u57df&gt;<\/strong>\u00a0&#8211;add-forward-port=port=&lt;\u6e90\u7aef\u53e3\u53f7&gt;:proto=<strong style=\"box-sizing: border-box;\">&lt;\u534f\u8bae&gt;<\/strong>:toport=<strong style=\"box-sizing: border-box;\">&lt;\u76ee\u6807\u7aef\u53e3\u53f7&gt;<\/strong>:toaddr=<strong style=\"box-sizing: border-box;\">&lt;\u76ee\u6807IP\u5730\u5740&gt;<\/strong><\/p>\n<\/blockquote>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--permanent\u00a0--zone=public\u00a0--add-forward-port=port=888:proto=tcp:toport=22:toaddr=192.168.10.10success\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--reload\nsuccess<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5728\u5ba2\u6237\u7aef\u4f7f\u7528ssh\u547d\u4ee4\u5c1d\u8bd5\u8bbf\u95ee192.168.10.10\u4e3b\u673a\u7684888\u7aef\u53e3\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@client\u00a0A\u00a0~]#\u00a0ssh\u00a0-p\u00a0888\u00a0192.168.10.10\nThe\u00a0authenticity\u00a0of\u00a0host\u00a0'[192.168.10.10]:888\u00a0([192.168.10.10]:888)'\u00a0can't\u00a0be\u00a0established.\nECDSA\u00a0key\u00a0fingerprint\u00a0is\u00a0b8:25:88:89:5c:05:b6:dd:ef:76:63:ff:1a:54:02:1a.\nAre\u00a0you\u00a0sure\u00a0you\u00a0want\u00a0to\u00a0continue\u00a0connecting\u00a0(yes\/no)?\u00a0yesWarning:\u00a0Permanently\u00a0added\u00a0'[192.168.10.10]:888'\u00a0(ECDSA)\u00a0to\u00a0the\u00a0list\u00a0of\u00a0known\u00a0hosts.\nroot@192.168.10.10's\u00a0password:\u6b64\u5904\u8f93\u5165\u8fdc\u7a0broot\u7ba1\u7406\u5458\u7684\u5bc6\u7801Last\u00a0login:\u00a0Sun\u00a0Jul\u00a019\u00a021:43:48\u00a02017\u00a0from\u00a0192.168.10.10<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">firewalld\u4e2d\u7684\u5bcc\u89c4\u5219\u8868\u793a\u66f4\u7ec6\u81f4\u3001\u66f4\u8be6\u7ec6\u7684\u9632\u706b\u5899\u7b56\u7565\u914d\u7f6e\uff0c\u5b83\u53ef\u4ee5\u9488\u5bf9\u7cfb\u7edf\u670d\u52a1\u3001\u7aef\u53e3\u53f7\u3001\u6e90\u5730\u5740\u548c\u76ee\u6807\u5730\u5740\u7b49\u8bf8\u591a\u4fe1\u606f\u8fdb\u884c\u66f4\u6709\u9488\u5bf9\u6027\u7684\u7b56\u7565\u914d\u7f6e\u3002\u5b83\u7684\u4f18\u5148\u7ea7\u5728\u6240\u6709\u7684\u9632\u706b\u5899\u7b56\u7565\u4e2d\u4e5f\u662f\u6700\u9ad8\u7684\u3002\u6bd4\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u5728firewalld\u670d\u52a1\u4e2d\u914d\u7f6e\u4e00\u6761\u5bcc\u89c4\u5219\uff0c\u4f7f\u5176\u62d2\u7edd192.168.10.0\/24\u7f51\u6bb5\u7684\u6240\u6709\u7528\u6237\u8bbf\u95ee\u672c\u673a\u7684ssh\u670d\u52a1\uff0822\u7aef\u53e3\uff09\uff1a<\/p>\n<pre class=\"prettyprint perl\" style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 20px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--permanent\u00a0--zone=public\u00a0--add-rich-rule=\"rule\u00a0family=\"ipv4\"\u00a0source\u00a0address=\"192.168.10.0\/24\"\u00a0service\u00a0name=\"ssh\"\u00a0reject\"\nsuccess\n[root@linuxprobe\u00a0~]#\u00a0firewall-cmd\u00a0--reload\nsuccess<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5728\u5ba2\u6237\u7aef\u4f7f\u7528ssh\u547d\u4ee4\u5c1d\u8bd5\u8bbf\u95ee192.168.10.10\u4e3b\u673a\u7684ssh\u670d\u52a1\uff0822\u7aef\u53e3\uff09\uff1a<\/p>\n<pre class=\"prettyprint perl\" style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 20px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@client\u00a0A\u00a0~]#\u00a0ssh\u00a0192.168.10.10\nConnecting\u00a0to\u00a0192.168.10.10:22...\nCould\u00a0not\u00a0connect\u00a0to\u00a0'192.168.10.10'\u00a0(port\u00a022):\u00a0Connection\u00a0failed.<\/pre>\n<h6 style=\"box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 500; line-height: 1.1; margin-top: 10px; margin-bottom: 10px; font-size: 12px;\"><span id=\"832\" style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\"><strong style=\"box-sizing: border-box;\">8.3.2 \u56fe\u5f62\u7ba1\u7406\u5de5\u5177<\/strong><\/span><\/span><\/h6>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5728\u5404\u79cd\u7248\u672c\u7684Linux\u7cfb\u7edf\u4e2d\uff0c\u51e0\u4e4e\u6ca1\u6709\u80fd\u8ba9\u5218\u9044\u8001\u5e08\u6b23\u6170\u5e76\u63a8\u8350\u7684\u56fe\u5f62\u5316\u5de5\u5177\uff0c\u4f46\u662ffirewall-config\u505a\u5230\u4e86\u3002\u5b83\u662ffirewalld\u9632\u706b\u5899\u914d\u7f6e\u7ba1\u7406\u5de5\u5177\u7684GUI\uff08\u56fe\u5f62\u7528\u6237\u754c\u9762\uff09\u7248\u672c\uff0c\u51e0\u4e4e\u53ef\u4ee5\u5b9e\u73b0\u6240\u6709\u4ee5\u547d\u4ee4\u884c\u6765\u6267\u884c\u7684\u64cd\u4f5c\u3002\u6beb\u4e0d\u5938\u5f20\u7684\u8bf4\uff0c\u5373\u4f7f\u8bfb\u8005\u6ca1\u6709\u624e\u5b9e\u7684<a style=\"box-sizing: border-box; color: #d2322d; text-decoration: none;\" title=\"linux\u547d\u4ee4\" href=\"https:\/\/www.linuxprobe.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Linux\u547d\u4ee4<\/a>\u57fa\u7840\uff0c\u4e5f\u5b8c\u5168\u53ef\u4ee5\u901a\u8fc7\u5b83\u6765\u59a5\u5584\u914d\u7f6eRHEL 7\u4e2d\u7684\u9632\u706b\u5899\u7b56\u7565\u3002firewall-config\u7684\u754c\u9762\u5982\u56fe8-2\u6240\u793a\uff0c\u5176\u529f\u80fd\u5177\u4f53\u5982\u4e0b\u3002<\/p>\n<blockquote style=\"box-sizing: border-box; padding: 10px 20px; margin: 0px 0px 20px; border-left-width: 5px; border-left-style: solid; border-color: rgba(0, 0, 0, 0.14902);\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">1\uff1a<\/strong>\u9009\u62e9\u8fd0\u884c\u65f6\uff08Runtime\uff09\u6a21\u5f0f\u6216\u6c38\u4e45\uff08Permanent\uff09\u6a21\u5f0f\u7684\u914d\u7f6e\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">2<\/strong>\uff1a\u53ef\u9009\u7684\u7b56\u7565\u96c6\u5408\u533a\u57df\u5217\u8868\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">3<\/strong>\uff1a\u5e38\u7528\u7684\u7cfb\u7edf\u670d\u52a1\u5217\u8868\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">4<\/strong>\uff1a\u5f53\u524d\u6b63\u5728\u4f7f\u7528\u7684\u533a\u57df\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">5<\/strong>\uff1a\u7ba1\u7406\u5f53\u524d\u88ab\u9009\u4e2d\u533a\u57df\u4e2d\u7684\u670d\u52a1\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">6<\/strong>\uff1a\u7ba1\u7406\u5f53\u524d\u88ab\u9009\u4e2d\u533a\u57df\u4e2d\u7684\u7aef\u53e3\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">7<\/strong>\uff1a\u5f00\u542f\u6216\u5173\u95edSNAT\uff08\u6e90\u5730\u5740\u8f6c\u6362\u534f\u8bae\uff09\u6280\u672f\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">8<\/strong>\uff1a\u8bbe\u7f6e\u7aef\u53e3\u8f6c\u53d1\u7b56\u7565\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">9<\/strong>\uff1a\u63a7\u5236\u8bf7\u6c42icmp\u670d\u52a1\u7684\u6d41\u91cf\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">10<\/strong>\uff1a\u7ba1\u7406\u9632\u706b\u5899\u7684\u5bcc\u89c4\u5219\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">11<\/strong>\uff1a\u7ba1\u7406\u7f51\u5361\u8bbe\u5907\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">12<\/strong>\uff1a\u88ab\u9009\u4e2d\u533a\u57df\u7684\u670d\u52a1\uff0c\u82e5\u52fe\u9009\u4e86\u76f8\u5e94\u670d\u52a1\u524d\u9762\u7684\u590d\u9009\u6846\uff0c\u5219\u8868\u793a\u5141\u8bb8\u4e0e\u4e4b\u76f8\u5173\u7684\u6d41\u91cf\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; font-size: 14px; line-height: 23px; text-indent: 1em; text-align: justify;\"><strong style=\"box-sizing: border-box;\">13<\/strong>\uff1afirewall-config\u5de5\u5177\u7684\u8fd0\u884c\u72b6\u6001\u3002<\/p>\n<\/blockquote>\n<\/div>\n<div style=\"box-sizing: border-box; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17.1429px; white-space: normal; background-color: #ffffff;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/firewall-config%E7%95%8C%E9%9D%A2.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1512 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/firewall-config%E7%95%8C%E9%9D%A2.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 871px) 100vw, 871px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"871\" height=\"634\" \/><\/div><\/div>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u56fe8-2\u00a0 firewall-config\u7684\u754c\u9762<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u5218\u9044\u8001\u5e08\u518d\u5570\u55e6\u51e0\u53e5\u3002\u5728\u4f7f\u7528firewall-config\u5de5\u5177\u914d\u7f6e\u5b8c\u9632\u706b\u5899\u7b56\u7565\u4e4b\u540e\uff0c\u65e0\u987b\u8fdb\u884c\u4e8c\u6b21\u786e\u8ba4\uff0c\u56e0\u4e3a\u53ea\u8981\u6709\u4fee\u6539\u5185\u5bb9\uff0c\u5b83\u5c31\u81ea\u52a8\u8fdb\u884c\u4fdd\u5b58\u3002\u4e0b\u9762\u8fdb\u884c\u52a8\u624b\u5b9e\u8df5\u73af\u8282\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u6211\u4eec\u5148\u5c06\u5f53\u524d\u533a\u57df\u4e2d\u8bf7\u6c42http\u670d\u52a1\u7684\u6d41\u91cf\u8bbe\u7f6e\u4e3a\u5141\u8bb8\uff0c\u4f46\u4ec5\u9650\u5f53\u524d\u751f\u6548\u3002\u5177\u4f53\u914d\u7f6e\u5982\u56fe8-3\u6240\u793a\u3002<\/p>\n<div style=\"box-sizing: border-box; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17.1429px; white-space: normal; background-color: #ffffff;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E5%85%81%E8%AE%B8%E5%85%B6%E4%BB%96%E4%B8%BB%E6%9C%BA%E8%AE%BF%E9%97%AEhttp%E6%9C%8D%E5%8A%A1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1555 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E5%85%81%E8%AE%B8%E5%85%B6%E4%BB%96%E4%B8%BB%E6%9C%BA%E8%AE%BF%E9%97%AEhttp%E6%9C%8D%E5%8A%A1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 871px) 100vw, 871px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"871\" height=\"632\" \/><\/div><\/div>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u56fe8-3\u00a0 \u653e\u884c\u8bf7\u6c42http\u670d\u52a1\u7684\u6d41\u91cf<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u5c1d\u8bd5\u6dfb\u52a0\u4e00\u6761\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\uff0c\u4f7f\u5176\u653e\u884c\u8bbf\u95ee8080\uff5e8088\u7aef\u53e3\uff08TCP\u534f\u8bae\uff09\u7684\u6d41\u91cf\uff0c\u5e76\u5c06\u5176\u8bbe\u7f6e\u4e3a\u6c38\u4e45\u751f\u6548\uff0c\u4ee5\u8fbe\u5230\u7cfb\u7edf\u91cd\u542f\u540e\u9632\u706b\u5899\u7b56\u7565\u4f9d\u7136\u751f\u6548\u7684\u76ee\u7684\u3002\u5728\u6309\u7167\u56fe8-4\u6240\u793a\u7684\u754c\u9762\u914d\u7f6e\u5b8c\u6bd5\u4e4b\u540e\uff0c\u8fd8\u9700\u8981\u5728Options\u83dc\u5355\u4e2d\u5355\u51fbReload Firewalld\u547d\u4ee4\uff0c\u8ba9\u914d\u7f6e\u7684\u9632\u706b\u5899\u7b56\u7565\u7acb\u5373\u751f\u6548\uff08\u89c1\u56fe8-5\uff09\u3002\u8fd9\u4e0e\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884c&#8211;reload\u53c2\u6570\u7684\u6548\u679c\u4e00\u6837\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E5%85%81%E8%AE%B8%E5%85%B6%E4%BB%96%E4%B8%BB%E6%9C%BA%E8%AE%BF%E9%97%AE8080-8088%E7%AB%AF%E5%8F%A3.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1554 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E5%85%81%E8%AE%B8%E5%85%B6%E4%BB%96%E4%B8%BB%E6%9C%BA%E8%AE%BF%E9%97%AE8080-8088%E7%AB%AF%E5%8F%A3.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 871px) 100vw, 871px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"871\" height=\"633\" \/><\/div><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u56fe8-4\u00a0 \u653e\u884c\u8bbf\u95ee8080\uff5e8088\u7aef\u53e3\u7684\u6d41\u91cf<\/p>\n<div style=\"box-sizing: border-box; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17.1429px; white-space: normal; background-color: #ffffff;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E9%87%8D%E5%90%AF%E5%90%8E%E4%BE%9D%E7%84%B6%E6%9C%89%E6%95%88.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1556 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E9%87%8D%E5%90%AF%E5%90%8E%E4%BE%9D%E7%84%B6%E6%9C%89%E6%95%88.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 871px) 100vw, 871px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"871\" height=\"632\" \/><\/div><\/div>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u56fe8-5\u00a0 \u8ba9\u914d\u7f6e\u7684\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\u7acb\u5373\u751f\u6548<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u524d\u9762\u5728\u8bb2\u89e3firewall-config\u5de5\u5177\u7684\u529f\u80fd\u65f6\uff0c\u66fe\u7ecf\u63d0\u5230\u4e86SNAT\uff08Source Network Address Translation\uff0c\u6e90\u7f51\u7edc\u5730\u5740\u8f6c\u6362\uff09\u6280\u672f\u3002SNAT\u662f\u4e00\u79cd\u4e3a\u4e86\u89e3\u51b3IP\u5730\u5740\u532e\u4e4f\u800c\u8bbe\u8ba1\u7684\u6280\u672f\uff0c\u5b83\u53ef\u4ee5\u4f7f\u5f97\u591a\u4e2a\u5185\u7f51\u4e2d\u7684\u7528\u6237\u901a\u8fc7\u540c\u4e00\u4e2a\u5916\u7f51IP\u63a5\u5165Internet\u3002\u8be5\u6280\u672f\u7684\u5e94\u7528\u975e\u5e38\u5e7f\u6cdb\uff0c\u751a\u81f3\u53ef\u4ee5\u8bf4\u6211\u4eec\u6bcf\u5929\u90fd\u5728\u4f7f\u7528\uff0c\u53ea\u4e0d\u8fc7\u6ca1\u6709\u5bdf\u89c9\u5230\u7f62\u4e86\u3002\u6bd4\u5982\uff0c\u5f53\u6211\u4eec\u901a\u8fc7\u5bb6\u4e2d\u7684\u7f51\u5173\u8bbe\u5907\uff08\u6bd4\u5982\u65e0\u7ebf\u8def\u7531\u5668\uff09\u8bbf\u95ee\u672c\u4e66\u914d\u5957\u7ad9\u70b9<a style=\"box-sizing: border-box; color: #d2322d; text-decoration: none;\" href=\"https:\/\/www.linuxprobe.com\/\">www.linuxprobe.com<\/a>\u65f6\uff0c\u5c31\u7528\u5230\u4e86SNAT\u6280\u672f\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u5927\u5bb6\u53ef\u4ee5\u770b\u4e00\u4e0b\u5728\u7f51\u7edc\u4e2d\u4e0d\u4f7f\u7528SNAT\u6280\u672f\uff08\u89c1\u56fe8-6\uff09\u548c\u4f7f\u7528SNAT\u6280\u672f\uff08\u89c1\u56fe8-7\uff09\u65f6\u7684\u60c5\u51b5\u3002\u5728\u56fe8-6\u6240\u793a\u7684\u5c40\u57df\u7f51\u4e2d\u6709\u591a\u53f0PC\uff0c\u5982\u679c\u7f51\u5173\u670d\u52a1\u5668\u6ca1\u6709\u5e94\u7528SNAT\u6280\u672f\uff0c\u5219\u4e92\u8054\u7f51\u4e2d\u7684\u7f51\u7ad9\u670d\u52a1\u5668\u5728\u6536\u5230PC\u7684\u8bf7\u6c42\u6570\u636e\u5305\uff0c\u5e76\u56de\u9001\u54cd\u5e94\u6570\u636e\u5305\u65f6\uff0c\u5c06\u65e0\u6cd5\u5728\u7f51\u7edc\u4e2d\u627e\u5230\u8fd9\u4e2a\u79c1\u6709\u7f51\u7edc\u7684IP\u5730\u5740\uff0c\u6240\u4ee5PC\u4e5f\u5c31\u6536\u4e0d\u5230\u54cd\u5e94\u6570\u636e\u5305\u4e86\u3002\u5728\u56fe8-7\u6240\u793a\u7684\u5c40\u57df\u7f51\u4e2d\uff0c\u7531\u4e8e\u7f51\u5173\u670d\u52a1\u5668\u5e94\u7528\u4e86SNAT\u6280\u672f\uff0c\u6240\u4ee5\u4e92\u8054\u7f51\u4e2d\u7684\u7f51\u7ad9\u670d\u52a1\u5668\u4f1a\u5c06\u54cd\u5e94\u6570\u636e\u5305\u53d1\u7ed9\u7f51\u5173\u670d\u52a1\u5668\uff0c\u518d\u7531\u540e\u8005\u8f6c\u53d1\u7ed9\u5c40\u57df\u7f51\u4e2d\u7684PC\u3002<\/p>\n<div style=\"box-sizing: border-box; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17.1429px; white-space: normal; text-align: center; background-color: #ffffff;\">\n<div style=\"box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E6%9C%AA%E7%94%A8SNAT1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1339 size-full\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E6%9C%AA%E7%94%A8SNAT1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 863px) 100vw, 863px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"863\" height=\"336\" \/><\/div><\/div>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em;\">\u56fe8-6\u00a0 \u6ca1\u6709\u4f7f\u7528SNAT\u6280\u672f\u7684\u7f51\u7edc<\/p>\n<div style=\"box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E4%BD%BF%E7%94%A8SNAT1.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1338 size-full\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E4%BD%BF%E7%94%A8SNAT1.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 864px) 100vw, 864px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"864\" height=\"315\" \/><\/div><\/div>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em;\">\u56fe8-7\u00a0 \u4f7f\u7528SNAT\u6280\u672f\u5904\u7406\u8fc7\u7684\u7f51\u7edc<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: left;\">\u4f7f\u7528iptables\u547d\u4ee4\u5b9e\u73b0SNAT\u6280\u672f\u662f\u4e00\u4ef6\u5f88\u9ebb\u70e6\u7684\u4e8b\u60c5\uff0c\u4f46\u662f\u5728firewall-config\u4e2d\u5374\u662f\u5c0f\u83dc\u4e00\u789f\u4e86\u3002\u7528\u6237\u53ea\u9700\u6309\u7167\u56fe8-8\u8fdb\u884c\u914d\u7f6e\uff0c\u5e76\u9009\u4e2dMasquerade zone\u590d\u9009\u6846\uff0c\u5c31\u81ea\u52a8\u5f00\u542f\u4e86SNAT\u6280\u672f\u3002<\/p>\n<\/div>\n<div style=\"box-sizing: border-box; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17.1429px; white-space: normal; background-color: #ffffff;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E5%BC%80%E5%90%AF%E4%BC%AA%E8%A3%85%E5%8A%9F%E8%83%BD.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1553 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E5%BC%80%E5%90%AF%E4%BC%AA%E8%A3%85%E5%8A%9F%E8%83%BD.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"872\" height=\"632\" \/><\/div><\/div>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u56fe8-8\u00a0 \u5f00\u542f\u9632\u706b\u5899\u7684SNAT\u6280\u672f<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\u4e3a\u4e86\u8ba9\u5927\u5bb6\u76f4\u89c2\u67e5\u770b\u4e0d\u540c\u5de5\u5177\u5728\u5b9e\u73b0\u76f8\u540c\u529f\u80fd\u7684\u533a\u522b\uff0c\u8fd9\u91cc\u4f7f\u7528firewall-config\u5de5\u5177\u91cd\u65b0\u6f14\u793a\u4e86\u524d\u9762\u4f7f\u7528firewall-cmd\u6765\u914d\u7f6e\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\uff0c\u5c06\u672c\u673a888\u7aef\u53e3\u7684\u6d41\u91cf\u8f6c\u53d1\u523022\u7aef\u53e3\uff0c\u4e14\u8981\u6c42\u5f53\u524d\u548c\u957f\u671f\u5747\u6709\u6548\uff0c\u5177\u4f53\u5982\u56fe8-9\u548c\u56fe8-10\u6240\u793a\u3002<\/p>\n<div style=\"box-sizing: border-box; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 17.1429px; white-space: normal; background-color: #ffffff;\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E5%B0%86%E5%90%91%E6%9C%AC%E6%9C%BA888%E7%AB%AF%E5%8F%A3%E7%9A%84%E8%AF%B7%E6%B1%82%E8%BD%AC%E5%8F%91%E8%87%B3%E6%9C%AC%E6%9C%BA%E7%9A%8422%E7%AB%AF%E5%8F%A3.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1551 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E5%B0%86%E5%90%91%E6%9C%AC%E6%9C%BA888%E7%AB%AF%E5%8F%A3%E7%9A%84%E8%AF%B7%E6%B1%82%E8%BD%AC%E5%8F%91%E8%87%B3%E6%9C%AC%E6%9C%BA%E7%9A%8422%E7%AB%AF%E5%8F%A3.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 870px) 100vw, 870px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"870\" height=\"633\" \/><\/div><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center;\">\u56fe8-9\u00a0 \u914d\u7f6e\u672c\u5730\u7684\u7aef\u53e3\u8f6c\u53d1<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/reload%E7%AB%8B%E5%8D%B3%E7%94%9F%E6%95%88.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-49129 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/reload%E7%AB%8B%E5%8D%B3%E7%94%9F%E6%95%88.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 872px) 100vw, 872px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"872\" height=\"633\" \/><\/div><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center;\">\u56fe8-10\u00a0 \u8ba9\u9632\u706b\u5899\u6548\u7b56\u7565\u89c4\u5219\u7acb\u5373\u751f\u6548<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u914d\u7f6e\u5bcc\u89c4\u5219\uff0c\u8ba9192.168.10.20\u4e3b\u673a\u8bbf\u95ee\u5230\u672c\u673a\u76841234\u7aef\u53e3\u53f7\uff0c\u5982\u56fe8-11\u6240\u793a\u3002<\/p>\n<div style=\"box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E4%BB%85%E5%85%81%E8%AE%B8192.168.10.20%E4%B8%BB%E6%9C%BA%E8%AE%BF%E9%97%AE%E6%9C%AC%E6%9C%BA%E7%9A%841234%E7%AB%AF%E5%8F%A3.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1552 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E4%BB%85%E5%85%81%E8%AE%B8192.168.10.20%E4%B8%BB%E6%9C%BA%E8%AE%BF%E9%97%AE%E6%9C%AC%E6%9C%BA%E7%9A%841234%E7%AB%AF%E5%8F%A3.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 871px) 100vw, 871px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"871\" height=\"633\" \/><\/div><\/div>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: center;\">\u56fe8-11 \u914d\u7f6e\u9632\u706b\u5899\u5bcc\u89c4\u5219\u7b56\u7565<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5982\u679c\u751f\u4ea7\u73af\u5883\u4e2d\u7684\u670d\u52a1\u5668\u6709\u591a\u5757\u7f51\u5361\u5728\u540c\u65f6\u63d0\u4f9b\u670d\u52a1\uff08\u8fd9\u79cd\u60c5\u51b5\u5f88\u5e38\u89c1\uff09\uff0c\u5219\u5bf9\u5185\u7f51\u548c\u5bf9\u5916\u7f51\u63d0\u4f9b\u670d\u52a1\u7684\u7f51\u5361\u8981\u9009\u62e9\u7684\u9632\u706b\u5899\u7b56\u7565\u533a\u57df\u4e5f\u662f\u4e0d\u4e00\u6837\u7684\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u53ef\u4ee5\u628a\u7f51\u5361\u4e0e\u9632\u706b\u5899\u7b56\u7565\u533a\u57df\u8fdb\u884c\u7ed1\u5b9a\uff08\u89c1\u56fe8-12\uff09\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u9632\u706b\u5899\u533a\u57df\u7b56\u7565\uff0c\u5bf9\u6e90\u81ea\u4e0d\u540c\u7f51\u5361\u7684\u6d41\u91cf\u8fdb\u884c\u9488\u5bf9\u6027\u7684\u76d1\u63a7\uff0c\u6548\u679c\u4f1a\u66f4\u597d\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u6700\u540e\uff0c\u5218\u9044\u8001\u5e08\u60f3\u8bf4\u7684\u662f\uff0cfirewall-config\u5de5\u5177\u771f\u7684\u975e\u5e38\u5b9e\u7528\uff0c\u5f88\u591a\u539f\u672c\u590d\u6742\u7684\u957f\u547d\u4ee4\u88ab\u7528\u56fe\u5f62\u5316\u6309\u94ae\u66ff\u4ee3\uff0c\u8bbe\u7f6e\u89c4\u5219\u4e5f\u7b80\u5355\u660e\u4e86\uff0c\u8db3\u4ee5\u5e94\u5bf9\u65e5\u5e38\u5de5\u4f5c\u3002\u6240\u4ee5\u518d\u6b21\u5411\u5927\u5bb6\u5f3a\u8c03\u914d\u7f6e\u9632\u706b\u5899\u7b56\u7565\u7684\u539f\u5219\u2014\u53ea\u8981\u80fd\u5b9e\u73b0\u6240\u9700\u7684\u529f\u80fd\uff0c\u7528\u4ec0\u4e48\u5de5\u5177\u8bf7\u968f\u541b\u4fbf\u3002<\/p>\n<div style=\"box-sizing: border-box;\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E6%9F%A5%E7%9C%8B%E7%BD%91%E5%8D%A1%E8%AE%BE%E5%A4%87%E4%BF%A1%E6%81%AF.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1549 aligncenter\" style=\"box-sizing: border-box; max-width: 100%; border-radius: 4px; vertical-align: middle; height: auto; margin: 10px auto; display: block;\" title=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" data-original=\"https:\/\/www.linuxprobe.com\/wp-content\/uploads\/2015\/03\/%E6%9F%A5%E7%9C%8B%E7%BD%91%E5%8D%A1%E8%AE%BE%E5%A4%87%E4%BF%A1%E6%81%AF.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" sizes=\"auto, (max-width: 873px) 100vw, 873px\"  alt=\"\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\u7b2c8\u7ae0 Iptables\u4e0eFirewalld\u9632\u706b\u5899\u3002\" width=\"873\" height=\"632\" \/><\/div><\/div>\n<div style=\"box-sizing: border-box; text-align: center;\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u56fe8-12\u00a0 \u628a\u7f51\u5361\u4e0e\u9632\u706b\u5899\u7b56\u7565\u533a\u57df\u8fdb\u884c\u7ed1\u5b9a<\/p>\n<\/div>\n<h5 style=\"box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 100; line-height: 1.1; margin-top: 10px; margin-bottom: 10px; font-size: 14px;\"><span id=\"84\" style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\"><strong style=\"box-sizing: border-box;\">8.4 \u670d\u52a1\u7684\u8bbf\u95ee\u63a7\u5236\u5217\u8868<\/strong><\/span><\/span><\/h5>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">TCP Wrappers\u662fRHEL 7\u7cfb\u7edf\u4e2d\u9ed8\u8ba4\u542f\u7528\u7684\u4e00\u6b3e\u6d41\u91cf\u76d1\u63a7\u7a0b\u5e8f\uff0c\u5b83\u80fd\u591f\u6839\u636e\u6765\u8bbf\u4e3b\u673a\u7684\u5730\u5740\u4e0e\u672c\u673a\u7684\u76ee\u6807\u670d\u52a1\u7a0b\u5e8f\u4f5c\u51fa\u5141\u8bb8\u6216\u62d2\u7edd\u7684\u64cd\u4f5c\u3002\u6362\u53e5\u8bdd\u8bf4\uff0cLinux\u7cfb\u7edf\u4e2d\u5176\u5b9e\u6709\u4e24\u4e2a\u5c42\u9762\u7684\u9632\u706b\u5899\uff0c\u7b2c\u4e00\u79cd\u662f\u524d\u9762\u8bb2\u5230\u7684\u57fa\u4e8eTCP\/IP\u534f\u8bae\u7684\u6d41\u91cf\u8fc7\u6ee4\u5de5\u5177\uff0c\u800cTCP Wrappers\u670d\u52a1\u5219\u662f\u80fd\u5141\u8bb8\u6216\u7981\u6b62Linux\u7cfb\u7edf\u63d0\u4f9b\u670d\u52a1\u7684\u9632\u706b\u5899\uff0c\u4ece\u800c\u5728\u66f4\u9ad8\u5c42\u9762\u4fdd\u62a4\u4e86Linux\u7cfb\u7edf\u7684\u5b89\u5168\u8fd0\u884c\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">TCP Wrappers\u670d\u52a1\u7684\u9632\u706b\u5899\u7b56\u7565\u7531\u4e24\u4e2a\u63a7\u5236\u5217\u8868\u6587\u4ef6\u6240\u63a7\u5236\uff0c\u7528\u6237\u53ef\u4ee5\u7f16\u8f91\u5141\u8bb8\u63a7\u5236\u5217\u8868\u6587\u4ef6\u6765\u653e\u884c\u5bf9\u670d\u52a1\u7684\u8bf7\u6c42\u6d41\u91cf\uff0c\u4e5f\u53ef\u4ee5\u7f16\u8f91\u62d2\u7edd\u63a7\u5236\u5217\u8868\u6587\u4ef6\u6765\u963b\u6b62\u5bf9\u670d\u52a1\u7684\u8bf7\u6c42\u6d41\u91cf\u3002\u63a7\u5236\u5217\u8868\u6587\u4ef6\u4fee\u6539\u540e\u4f1a\u7acb\u5373\u751f\u6548\uff0c\u7cfb\u7edf\u5c06\u4f1a\u5148\u68c0\u67e5\u5141\u8bb8\u63a7\u5236\u5217\u8868\u6587\u4ef6\uff08\/etc\/hosts.allow\uff09\uff0c\u5982\u679c\u5339\u914d\u5230\u76f8\u5e94\u7684\u5141\u8bb8\u7b56\u7565\u5219\u653e\u884c\u6d41\u91cf\uff1b\u5982\u679c\u6ca1\u6709\u5339\u914d\uff0c\u5219\u53bb\u8fdb\u4e00\u6b65\u5339\u914d\u62d2\u7edd\u63a7\u5236\u5217\u8868\u6587\u4ef6\uff08\/etc\/hosts.deny\uff09\uff0c\u82e5\u627e\u5230\u5339\u914d\u9879\u5219\u62d2\u7edd\u8be5\u6d41\u91cf\u3002\u5982\u679c\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5168\u90fd\u6ca1\u6709\u5339\u914d\u5230\uff0c\u5219\u9ed8\u8ba4\u653e\u884c\u6d41\u91cf\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">TCP Wrappers\u670d\u52a1\u7684\u63a7\u5236\u5217\u8868\u6587\u4ef6\u914d\u7f6e\u8d77\u6765\u5e76\u4e0d\u590d\u6742\uff0c\u5e38\u7528\u7684\u53c2\u6570\u5982\u88688-4\u6240\u793a\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u88688-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TCP Wrappers\u670d\u52a1\u7684\u63a7\u5236\u5217\u8868\u6587\u4ef6\u4e2d\u5e38\u7528\u7684\u53c2\u6570<\/p>\n<table id=\"tablepress-118\" class=\"tablepress tablepress-id-118\" width=\"712\">\n<tbody class=\"row-hover\" style=\"box-sizing: border-box;\">\n<tr class=\"row-1 odd firstRow\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-top-width: 0px; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u5ba2\u6237\u7aef\u7c7b\u578b<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-top-width: 0px; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u793a\u4f8b<\/td>\n<td class=\"column-3\" style=\"box-sizing: border-box; padding: 8px; border-top-width: 0px; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u6ee1\u8db3\u793a\u4f8b\u7684\u5ba2\u6237\u7aef\u5217\u8868<\/td>\n<\/tr>\n<tr class=\"row-2 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u5355\u4e00\u4e3b\u673a<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">192.168.10.10<\/td>\n<td class=\"column-3\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">IP\u5730\u5740\u4e3a192.168.10.10\u7684\u4e3b\u673a<\/td>\n<\/tr>\n<tr class=\"row-3 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u6307\u5b9a\u7f51\u6bb5<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">192.168.10.<\/td>\n<td class=\"column-3\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">IP\u6bb5\u4e3a192.168.10.0\/24\u7684\u4e3b\u673a<\/td>\n<\/tr>\n<tr class=\"row-4 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u6307\u5b9a\u7f51\u6bb5<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">192.168.10.0\/255.255.255.0<\/td>\n<td class=\"column-3\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">IP\u6bb5\u4e3a192.168.10.0\/24\u7684\u4e3b\u673a<\/td>\n<\/tr>\n<tr class=\"row-5 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u6307\u5b9aDNS\u540e\u7f00<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">.linuxprobe.com<\/td>\n<td class=\"column-3\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u6240\u6709DNS\u540e\u7f00\u4e3a.linuxprobe.com\u7684\u4e3b\u673a<\/td>\n<\/tr>\n<tr class=\"row-6 even\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u6307\u5b9a\u4e3b\u673a\u540d\u79f0<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">www.linuxprobe.com<\/td>\n<td class=\"column-3\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: 0px 0px; background-repeat: initial;\">\u4e3b\u673a\u540d\u79f0\u4e3awww.linuxprobe.com\u7684\u4e3b\u673a<\/td>\n<\/tr>\n<tr class=\"row-7 odd\" style=\"box-sizing: border-box;\">\n<td class=\"column-1\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u6307\u5b9a\u6240\u6709\u5ba2\u6237\u7aef<\/td>\n<td class=\"column-2\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">ALL<\/td>\n<td class=\"column-3\" style=\"box-sizing: border-box; padding: 8px; border-right-style: none; border-bottom-style: none; border-left-style: none; vertical-align: top; float: none !important; background: 0px 0px #f9f9f9;\">\u6240\u6709\u4e3b\u673a\u5168\u90e8\u5305\u62ec\u5728\u5185<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u5728\u914d\u7f6eTCP Wrappers\u670d\u52a1\u65f6\u9700\u8981\u9075\u5faa\u4e24\u4e2a\u539f\u5219\uff1a<\/p>\n<ol class=\" list-paddingleft-2\" style=\"box-sizing: border-box; margin-bottom: 10px;\">\n<li>\u7f16\u5199\u62d2\u7edd\u7b56\u7565\u89c4\u5219\u65f6\uff0c\u586b\u5199\u7684\u662f\u670d\u52a1\u540d\u79f0\uff0c\u800c\u975e\u534f\u8bae\u540d\u79f0\uff1b<\/li>\n<li>\u5efa\u8bae\u5148\u7f16\u5199\u62d2\u7edd\u7b56\u7565\u89c4\u5219\uff0c\u518d\u7f16\u5199\u5141\u8bb8\u7b56\u7565\u89c4\u5219\uff0c\u4ee5\u4fbf\u76f4\u89c2\u5730\u770b\u5230\u76f8\u5e94\u7684\u6548\u679c\u3002<\/li>\n<\/ol>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u4e0b\u9762\u7f16\u5199\u62d2\u7edd\u7b56\u7565\u89c4\u5219\u6587\u4ef6\uff0c\u7981\u6b62\u8bbf\u95ee\u672c\u673asshd\u670d\u52a1\u7684\u6240\u6709\u6d41\u91cf\uff08\u65e0\u987b\/etc\/hosts.deny\u6587\u4ef6\u4e2d\u4fee\u6539\u539f\u6709\u7684\u6ce8\u91ca\u4fe1\u606f\uff09\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0vim\u00a0\/etc\/hosts.deny\n#\n#\u00a0hosts.deny\u00a0This\u00a0file\u00a0contains\u00a0access\u00a0rules\u00a0which\u00a0are\u00a0used\u00a0to\n#\u00a0deny\u00a0connections\u00a0to\u00a0network\u00a0services\u00a0that\u00a0either\u00a0use\n#\u00a0the\u00a0tcp_wrappers\u00a0library\u00a0or\u00a0that\u00a0have\u00a0been\n#\u00a0started\u00a0through\u00a0a\u00a0tcp_wrappers-enabled\u00a0xinetd.\n#\n#\u00a0The\u00a0rules\u00a0in\u00a0this\u00a0file\u00a0can\u00a0also\u00a0be\u00a0set\u00a0up\u00a0in\n#\u00a0\/etc\/hosts.allow\u00a0with\u00a0a\u00a0'deny'\u00a0option\u00a0instead.\n#\n#\u00a0See\u00a0'man\u00a05\u00a0hosts_options'\u00a0and\u00a0'man\u00a05\u00a0hosts_access'\n#\u00a0for\u00a0information\u00a0on\u00a0rule\u00a0syntax.\n#\u00a0See\u00a0'man\u00a0tcpd'\u00a0for\u00a0information\u00a0on\u00a0tcp_wrapperssshd:*[root@linuxprobe\u00a0~]#\u00a0ssh\u00a0192.168.10.10\nssh_exchange_identification:\u00a0read:\u00a0Connection\u00a0reset\u00a0by\u00a0peer<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\">\u63a5\u4e0b\u6765\uff0c\u5728\u5141\u8bb8\u7b56\u7565\u89c4\u5219\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e00\u6761\u89c4\u5219\uff0c\u4f7f\u5176\u653e\u884c\u6e90\u81ea192.168.10.0\/24\u7f51\u6bb5\uff0c\u8bbf\u95ee\u672c\u673asshd\u670d\u52a1\u7684\u6240\u6709\u6d41\u91cf\u3002\u53ef\u4ee5\u770b\u5230\uff0c\u670d\u52a1\u5668\u7acb\u523b\u5c31\u653e\u884c\u4e86\u8bbf\u95eesshd\u670d\u52a1\u7684\u6d41\u91cf\uff0c\u6548\u679c\u975e\u5e38\u76f4\u89c2\uff1a<\/p>\n<pre style=\"box-sizing: border-box; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; white-space: pre-wrap; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 1.42857; color: #333333; word-break: break-all; word-wrap: break-word; border: 1px solid #cccccc; border-radius: 4px; background-color: #f5f5f5;\">[root@linuxprobe\u00a0~]#\u00a0vim\u00a0\/etc\/hosts.allow\n#\n#\u00a0hosts.allow\u00a0This\u00a0file\u00a0contains\u00a0access\u00a0rules\u00a0which\u00a0are\u00a0used\u00a0to\n#\u00a0allow\u00a0or\u00a0deny\u00a0connections\u00a0to\u00a0network\u00a0services\u00a0that\n#\u00a0either\u00a0use\u00a0the\u00a0tcp_wrappers\u00a0library\u00a0or\u00a0that\u00a0have\u00a0been\n#\u00a0started\u00a0through\u00a0a\u00a0tcp_wrappers-enabled\u00a0xinetd.\n#\n#\u00a0See\u00a0'man\u00a05\u00a0hosts_options'\u00a0and\u00a0'man\u00a05\u00a0hosts_access'\n#\u00a0for\u00a0information\u00a0on\u00a0rule\u00a0syntax.\n#\u00a0See\u00a0'man\u00a0tcpd'\u00a0for\u00a0information\u00a0on\u00a0tcp_wrapperssshd:192.168.10.[root@linuxprobe\u00a0~]#\u00a0ssh\u00a0192.168.10.10\nThe\u00a0authenticity\u00a0of\u00a0host\u00a0'192.168.10.10\u00a0(192.168.10.10)'\u00a0can't\u00a0be\u00a0established.\nECDSA\u00a0key\u00a0fingerprint\u00a0is\u00a070:3b:5d:37:96:7b:2e:a5:28:0d:7e:dc:47:6a:fe:5c.\nAre\u00a0you\u00a0sure\u00a0you\u00a0want\u00a0to\u00a0continue\u00a0connecting\u00a0(yes\/no)?\u00a0yes\nWarning:\u00a0Permanently\u00a0added\u00a0'192.168.10.10'\u00a0(ECDSA)\u00a0to\u00a0the\u00a0list\u00a0of\u00a0known\u00a0hosts.\nroot@192.168.10.10's\u00a0password:\u00a0\nLast\u00a0login:\u00a0Wed\u00a0May\u00a04\u00a007:56:29\u00a02017\n[root@linuxprobe\u00a0~]#<\/pre>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify;\"><span style=\"box-sizing: border-box; color: #800080;\"><strong style=\"box-sizing: border-box;\">\u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n<div style=\"box-sizing: border-box; text-align: center;\"><span style=\"box-sizing: border-box; color: #800080;\"><strong style=\"box-sizing: border-box;\"><span style=\"box-sizing: border-box; color: #008000;\">\u672c\u7ae0\u8282\u7684\u590d\u4e60\u4f5c\u4e1a<\/span><\/strong><\/span><\/div>\n<\/div>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">1\uff0e\u5728RHEL 7\u7cfb\u7edf\u4e2d\uff0ciptables\u662f\u5426\u5df2\u7ecf\u88abfirewalld\u670d\u52a1\u5f7b\u5e95\u53d6\u4ee3\uff1f<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u7b54\uff1a<\/strong><span style=\"box-sizing: border-box; color: #ff0000;\">\u6ca1\u6709\uff0ciptables\u548cfirewalld\u670d\u52a1\u5747\u53ef\u7528\u4e8eRHEL 7\u7cfb\u7edf\u3002<\/span><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">2\uff0e\u8bf7\u7b80\u8ff0\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\u4e2dDROP\u548cREJECT\u7684\u4e0d\u540c\u4e4b\u5904\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u7b54\uff1a<\/strong><span style=\"box-sizing: border-box; color: #ff0000;\">DROP\u7684\u52a8\u4f5c\u662f\u4e22\u5305\uff0c\u4e0d\u54cd\u5e94\uff1bREJECT\u662f\u62d2\u7edd\u8bf7\u6c42\uff0c\u540c\u65f6\u5411\u53d1\u9001\u65b9\u56de\u9001\u62d2\u7edd\u4fe1\u606f\u3002<\/span><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">3\uff0e\u5982\u4f55\u628aiptables\u670d\u52a1\u7684INPUT\u89c4\u5219\u94fe\u9ed8\u8ba4\u7b56\u7565\u8bbe\u7f6e\u4e3aDROP\uff1f<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u7b54\uff1a<\/strong><span style=\"box-sizing: border-box; color: #ff0000;\">\u6267\u884c\u547d\u4ee4iptables -P INPUT DROP\u5373\u53ef\u3002<\/span><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">4\uff0e\u600e\u6837\u7f16\u5199\u4e00\u6761\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\uff0c\u4f7f\u5f97iptables\u670d\u52a1\u53ef\u4ee5\u7981\u6b62\u6e90\u81ea192.168.10.0\/24\u7f51\u6bb5\u7684\u6d41\u91cf\u8bbf\u95ee\u672c\u673a\u7684sshd\u670d\u52a1\uff0822\u7aef\u53e3\uff09\uff1f<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u7b54\uff1a<\/strong><span style=\"box-sizing: border-box; color: #ff0000;\">\u6267\u884c\u547d\u4ee4iptables -I INPUT -s 192.168.10.0\/24 -p tcp &#8211;dport 22 -j REJECT\u5373\u53ef\u3002<\/span><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">5\uff0e\u8bf7\u7b80\u8ff0firewalld\u4e2d\u533a\u57df\u7684\u4f5c\u7528\u3002<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u7b54\uff1a<\/strong><span style=\"box-sizing: border-box; color: #ff0000;\">\u53ef\u4ee5\u4f9d\u636e\u4e0d\u540c\u7684\u5de5\u4f5c\u573a\u666f\u6765\u8c03\u7528\u4e0d\u540c\u7684firewalld\u533a\u57df\uff0c\u5b9e\u73b0\u5927\u91cf\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\u7684\u5feb\u901f\u5207\u6362\u3002<\/span><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">6\uff0e\u5982\u4f55\u5728firewalld\u4e2d\u628a\u9ed8\u8ba4\u7684\u533a\u57df\u8bbe\u7f6e\u4e3admz\uff1f<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u7b54\uff1a<\/strong><span style=\"box-sizing: border-box; color: #ff0000;\">\u6267\u884c\u547d\u4ee4firewall-cmd &#8211;set-default-zone=dmz\u5373\u53ef\u3002<\/span><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">7\uff0e\u5982\u4f55\u8ba9firewalld\u4e2d\u4ee5\u6c38\u4e45\uff08Permanent\uff09\u6a21\u5f0f\u914d\u7f6e\u7684\u9632\u706b\u5899\u7b56\u7565\u89c4\u5219\u7acb\u5373\u751f\u6548\uff1f<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u7b54\uff1a<\/strong><span style=\"box-sizing: border-box; color: #ff0000;\">\u6267\u884c\u547d\u4ee4firewall-cmd &#8211;reload\u3002<\/span><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">8\uff0e\u4f7f\u7528SNAT\u6280\u672f\u7684\u76ee\u7684\u662f\u4ec0\u4e48\uff1f<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u7b54\uff1a<\/strong><span style=\"box-sizing: border-box; color: #ff0000;\">SNAT\u662f\u4e00\u79cd\u4e3a\u4e86\u89e3\u51b3IP\u5730\u5740\u532e\u4e4f\u800c\u8bbe\u8ba1\u7684\u6280\u672f\uff0c\u5b83\u53ef\u4ee5\u4f7f\u5f97\u591a\u4e2a\u5185\u7f51\u4e2d\u7684\u7528\u6237\u901a\u8fc7\u540c\u4e00\u4e2a\u5916\u7f51IP\u63a5\u5165Internet\uff08\u4e92\u8054\u7f51\uff09\u3002<\/span><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\">9\uff0e\u00a0TCP Wrappers\u670d\u52a1\u5206\u522b\u6709\u5141\u8bb8\u7b56\u7565\u914d\u7f6e\u6587\u4ef6\u548c\u62d2\u7edd\u7b56\u7565\u914d\u7f6e\u6587\u4ef6\uff0c\u8bf7\u95ee\u5339\u914d\u987a\u5e8f\u662f\u600e\u4e48\u6837\u7684\uff1f<\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; text-align: justify; color: #3d4450; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; background-color: #ffffff;\"><strong style=\"box-sizing: border-box;\">\u7b54\uff1a<\/strong><span style=\"box-sizing: border-box; color: #ff0000;\">TCP Wrappers\u4f1a\u5148\u4f9d\u6b21\u5339\u914d\u5141\u8bb8\u7b56\u7565\u914d\u7f6e\u6587\u4ef6\uff0c\u7136\u540e\u518d\u4f9d\u6b21\u5339\u914d\u62d2\u7edd\u7b56\u7565\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\u679c\u90fd\u6ca1\u6709\u5339\u914d\u5230\uff0c\u5219\u9ed8\u8ba4\u653e\u884c\u6d41\u91cf\u3002<\/span><\/p>\n<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 23px; text-indent: 1em; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 12px; white-space: normal; color: #88a6a4; background-color: #ffffff;\">\u672c\u6587\u539f\u521b\u5730\u5740\uff1a<a style=\"box-sizing: border-box; color: #d2322d; text-decoration: none;\" href=\"https:\/\/www.linuxprobe.com\/chapter-08.html\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.linuxprobe.com\/chapter-08.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a8\u8350\u7b80\u8ff0\uff1a \u8bf4\u5230Linux\u7cfb\u7edf\u4ece01\u5e74\u5f00\u59cb\u6211\u5c31\u4e00\u76f4\u5728\u63a5\u89e6\uff0c\u76f4\u523003\u5e74\u8fd8\u662f04\u5e74\u7684\u65f6\u5019\u5728\u60e0\u5dde\u65b0\u534e\u4e66\u5e97\u4e70\u4e86\u4e00\u672c\u300a\u9e1f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":511,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[495,123,35,442,122],"class_list":["post-54","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1","tag-firewalld","tag-iptables","tag-linux","tag-442","tag-122"],"_links":{"self":[{"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=54"}],"version-history":[{"count":1,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":3440,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions\/3440"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=\/wp\/v2\/media\/511"}],"wp:attachment":[{"href":"https:\/\/www.fatesky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fatesky.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}