{"id":11859,"date":"2023-04-04T22:39:02","date_gmt":"2023-04-05T05:39:02","guid":{"rendered":"https:\/\/www.xh86.me\/?p=11859"},"modified":"2023-04-04T22:39:02","modified_gmt":"2023-04-05T05:39:02","slug":"%e9%a3%9e%e5%a1%94%e9%98%b2%e7%81%ab%e5%a2%99%e5%bc%80%e5%b1%80%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=11859","title":{"rendered":"\u98de\u5854\u9632\u706b\u5899\u5f00\u5c40\u914d\u7f6e"},"content":{"rendered":"<p>\u4ee5\u4e0b\u662f\u4e00\u4e2aFortinet\u9632\u706b\u5899\u7684\u5f00\u5c40\u914d\u7f6e\u811a\u672c\u793a\u4f8b\uff0c\u5305\u62ec\u8bbe\u7f6e\u5916\u7f51IP\u5730\u5740\u3001\u5185\u7f51NAT\u3001\u65f6\u533a\u8bbe\u7f6e\u6210\u7f8e\u56fd\u6d1b\u6749\u77f6\u65f6\u533a\uff0c\u4f60\u9700\u8981\u6839\u636e\u4f60\u7684\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u4fee\u6539\u548c\u9002\u914d\uff1a<\/p>\n<p>! \u914d\u7f6e\u7ba1\u7406IP\u5730\u5740<br \/>\nconfig system interface<br \/>\nedit &#8220;port1&#8221;<br \/>\nset mode static<br \/>\nset ip 10.0.0.1\/24<br \/>\nset allowaccess ping https ssh telnet<br \/>\nnext<br \/>\nedit &#8220;port2&#8221;<br \/>\nset mode static<br \/>\nset ip 203.0.113.2\/24<br \/>\nset allowaccess ping https ssh telnet<br \/>\nnext<br \/>\nend<\/p>\n<p>! \u914d\u7f6e\u8def\u7531\u548cNAT<br \/>\nconfig router static<br \/>\nedit 1<br \/>\nset dst 0.0.0.0\/0<br \/>\nset gateway 203.0.113.1<br \/>\nset device &#8220;port2&#8221;<br \/>\nnext<br \/>\nend<\/p>\n<p>config firewall policy<br \/>\nedit 1<br \/>\nset name &#8220;Internal to External&#8221;<br \/>\nset srcintf &#8220;port1&#8221;<br \/>\nset dstintf &#8220;port2&#8221;<br \/>\nset srcaddr &#8220;all&#8221;<br \/>\nset dstaddr &#8220;all&#8221;<br \/>\nset action accept<br \/>\nset schedule &#8220;always&#8221;<br \/>\nset service &#8220;ALL&#8221;<br \/>\nnext<br \/>\nend<\/p>\n<p>config firewall policy<br \/>\nedit 2<br \/>\nset name &#8220;External to Internal&#8221;<br \/>\nset srcintf &#8220;port2&#8221;<br \/>\nset dstintf &#8220;port1&#8221;<br \/>\nset srcaddr &#8220;all&#8221;<br \/>\nset dstaddr &#8220;all&#8221;<br \/>\nset action accept<br \/>\nset schedule &#8220;always&#8221;<br \/>\nset service &#8220;ALL&#8221;<br \/>\nnext<br \/>\nend<\/p>\n<p>config firewall policy<br \/>\nedit 3<br \/>\nset name &#8220;Internal NAT&#8221;<br \/>\nset srcintf &#8220;port1&#8221;<br \/>\nset dstintf &#8220;port2&#8221;<br \/>\nset srcaddr &#8220;192.168.1.0\/24&#8221;<br \/>\nset dstaddr &#8220;all&#8221;<br \/>\nset action snat<br \/>\nset schedule &#8220;always&#8221;<br \/>\nset service &#8220;ALL&#8221;<br \/>\nset natip 203.0.113.2<br \/>\nnext<br \/>\nend<\/p>\n<p>! \u914d\u7f6e\u65f6\u533a<br \/>\nconfig system global<br \/>\nset timezone America\/Los_Angeles<br \/>\nend<\/p>\n<p>! \u914d\u7f6e\u7ba1\u7406\u5458\u8d26\u6237<br \/>\nconfig system admin<br \/>\nedit admin<br \/>\nset password mypassword<br \/>\nnext<br \/>\nend<\/p>\n<p>! \u914d\u7f6e\u57fa\u672c\u53c2\u6570<br \/>\nconfig system global<br \/>\nset hostname FortiGate<br \/>\nset admin-sport 8443<br \/>\nset https-redirect enable<br \/>\nend<\/p>\n<p>! \u4fdd\u5b58\u914d\u7f6e<br \/>\nexecute backup config flash<br \/>\n\u4ee5\u4e0a\u793a\u4f8b\u914d\u7f6e\u4e86\u4e00\u4e2a\u7ba1\u7406IP\u5730\u5740\u3001\u5916\u7f51IP\u5730\u5740\u3001\u8def\u7531\u548cNAT\u3001\u65f6\u533a\u3001\u7ba1\u7406\u5458\u8d26\u6237\u548c\u57fa\u672c\u53c2\u6570\u3002\u5176\u4e2d\uff0c\u914d\u7f6e\u4e86\u5185\u7f51\u5730\u5740\u6bb5\u4e3a192.168.1.0\/24\uff0c\u4f7f\u7528SNAT\u5c06\u5176\u8f6c\u6362\u6210\u5916\u7f51IP\u5730\u5740203.0.113.2\uff0c\u5b9e\u73b0\u4e86\u5185\u7f51\u8bbf\u95ee\u5916\u7f51\u3002\u65f6\u533a\u8bbe\u7f6e\u4e3a\u7f8e\u56fd\u6d1b\u6749\u77f6\u65f6\u533a\u3002<\/p>\n<p>\u6ce8\u610f\uff1a\u8fd9\u53ea\u662f\u4e00\u4e2a\u793a\u4f8b\uff0c\u5b9e\u9645\u7684\u914d\u7f6e\u53ef\u80fd\u56e0\u7f51\u7edc\u62d3\u6251\u548c\u5177\u4f53\u9700\u6c42\u800c\u6709\u6240\u4e0d\u540c\uff0c\u56e0\u6b64\u8bf7\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u4fee\u6539\u548c\u9002\u914d\u3002\u540c\u65f6\uff0c\u914d\u7f6e\u4e4b\u524d\u8bf7\u5907\u4efd\u73b0\u6709\u914d\u7f6e\uff0c\u4ee5\u514d\u610f\u5916\u4e22\u5931\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u662f\u4e00\u4e2aFortinet\u9632\u706b\u5899\u7684\u5f00\u5c40\u914d\u7f6e\u811a\u672c\u793a\u4f8b\uff0c\u5305\u62ec\u8bbe\u7f6e\u5916\u7f51IP\u5730\u5740\u3001\u5185\u7f51NAT\u3001\u65f6\u533a\u8bbe\u7f6e\u6210\u7f8e\u56fd\u6d1b\u6749\u77f6\u65f6\u533a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-11859","post","type-post","status-publish","format-standard","hentry","category-network"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/11859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11859"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/11859\/revisions"}],"predecessor-version":[{"id":11860,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/11859\/revisions\/11860"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}