{"id":4861,"date":"2021-12-07T22:16:17","date_gmt":"2021-12-08T06:16:17","guid":{"rendered":"https:\/\/www.xh86.me\/?p=4861"},"modified":"2021-12-07T22:16:17","modified_gmt":"2021-12-08T06:16:17","slug":"mikrotik-routeros-%e6%a0%87%e8%ae%b0%e8%b7%af%e7%94%b1","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=4861","title":{"rendered":"MikroTik RouterOS \u6807\u8bb0\u8def\u7531"},"content":{"rendered":"<h1>1.\u4ecb\u7ecd<\/h1>\n<p>MikroTik\u8def\u7531\u5668\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u591a\u529f\u80fd\u7684\u8def\u7531\u5668\u7cfb\u7edf<\/p>\n<h1>2.\u6807\u8bb0(Mangle)<\/h1>\n<p>\u8be5\u9879\u4f4d\u4e8eip \/firewall\/mangle<\/p>\n<p>\u6807\u8bb0\u53ef\u4ee5\u7528\u6765\u6807\u8bb0\u5404\u4e2a\u94fe\u8868\u7684\u51fa\u5165\u8fde\u63a5,\u5305,\u6216\u8005\u8def\u7531\u7b49\u7b49<\/p>\n<h1>3.\u64cd\u4f5c<\/h1>\n<h4><strong>\u914d\u7f6eNAT<\/strong><\/h4>\n<ul>\n<li>\u914d\u7f6e.1\u6216l2tp-out\u7b49\u63a5\u53e3\u6216\u7f51\u5173\u5730\u5740\/\u4e0a\u5c42\u8def\u7531<\/li>\n<li>\u8fde\u63a5\u8fdb\u5165winbox<\/li>\n<li>\u5728\u5de6\u4fa7\u529f\u80fd\u83dc\u5355\u5217\u8868\u4e2d\u627e\u5230IP<\/li>\n<li>\u70b9\u51fbIP&gt;Firewall<\/li>\n<li>\u5728Firewall\u7684\u6807\u7b7e\u9875\u4e2d\u627e\u5230NAT<\/li>\n<li>\u70b9\u51fb\u65b0\u5efa<\/li>\n<li>\u7b2c\u4e00\u6807\u7b7e\u9875Genreal\u4e2d\u7684Chain\u4e3asrcnat<\/li>\n<li>Src. Address\u4e2d\u586b\u5199\u8981\u8def\u7531\u7684<strong>\u5185\u7f51\u5730\u5740<\/strong><\/li>\n<li>Out. Interface \u4e2d\u586b\u5199\u8981\u51fa\u53bb\u7684\u63a5\u53e3(\u70b9\u51fb\u4e0b\u4e09\u89d2\u4f1a\u6709\u63d0\u793a\u5217\u8868)<\/li>\n<li>\u8fd4\u56de\u6700\u4e0a\u9762\u7684\u6807\u7b7e\u9875\u9009\u62e9Action<\/li>\n<li>\u5728Action\u9875\u4e2d\u7684\u7b2c\u4e00\u9879(\u5373Action:)\u9009\u62e9masquerade<\/li>\n<li>\u70b9\u51fbok<\/li>\n<\/ul>\n<h4><strong>\u914d\u7f6e\u6807\u8bb0(\u5373Mangle)<\/strong><\/h4>\n<ul>\n<li>\u5728\u6700\u4e0a\u5c42\u9009\u62e9Mangle\u9875<\/li>\n<li>\u70b9\u51fb<strong>+<\/strong>\u53f7<\/li>\n<li>\u5728Genneral\u6807\u7b7e\u9875\u4e2d\u7684Chain\u4e2d\u9009\u62e9\u00a0<strong>preouting<\/strong><\/li>\n<li>\u4e0b\u4e00\u9879Src\u5730\u5740\u4e2d\u586b\u5199\u8981\u8def\u7531\u7684<strong>\u5185\u7f51\u5730\u5740<\/strong><\/li>\n<li>\u5728\u4e0a\u9762\u7684\u6807\u7b7e\u9875\u4e2d\u9009\u62e9Action<\/li>\n<li>Action\u60f3\u4e3a<strong>mark routing<\/strong><\/li>\n<li>\u5728<strong>New Routing Mark<\/strong>\u9879\u586b\u5199<strong>\u6807\u8bb0\u540d\u79f0<\/strong>(\u968f\u4fbf\u586b,\u4f46\u662f\u8981\u8bb0\u4f4f)<\/li>\n<li>\u52fe\u4e0a\u4e0b\u9762\u7684<strong>Passthrough<\/strong><\/li>\n<\/ul>\n<h4><strong>\u914d\u7f6e\u8def\u7531<\/strong><\/h4>\n<ul>\n<li>\u5728\u5de6\u4fa7\u529f\u80fd\u83dc\u5355\u5217\u8868\u4e2d\u627e\u5230IP&gt;Routes<\/li>\n<li>\u70b9\u51fb<strong>+<\/strong>\u53f7<\/li>\n<li>\u5728Gateway\u4e2d\u586b\u5199\u51fa\u53e3\u8def\u7531\u7684<strong>\u7f51\u5173\u5730\u5740(\u5373192.168.1.1\u7b49)<\/strong>\u7136\u540e<strong>%<\/strong>\u00a0<strong>\u63a5\u53e3\u5730\u5740(\u5373ether1\u7b49)<\/strong><\/li>\n<li>\u70b9\u51fbCheck Gatway \u9009\u62e9\u00a0<strong>ping<\/strong>\u00a0(\u8fd9\u6b65\u6ca1\u6709\u4e5f\u65e0\u6240\u8c13)<\/li>\n<li>Distance \u9009\u62e9\u00a0<strong>1<\/strong><\/li>\n<li><strong>Routing Mark<\/strong>\u00a0\u9879\u586b\u5199\u521a\u521a\u586b\u5165\u7684<strong>New Routing Mark \u540d\u79f0<\/strong>\u00a0\u70b9\u51fb\u4e0b\u62c9\u6709\u63d0\u793a\u5217\u8868<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1.\u4ecb\u7ecd MikroTik\u8def\u7531\u5668\u662f\u4e00\u4e2a\u9ad8\u6027\u80fd\u591a\u529f\u80fd\u7684\u8def\u7531\u5668\u7cfb\u7edf 2.\u6807\u8bb0(Mangle) \u8be5\u9879\u4f4d\u4e8eip \/fi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-4861","post","type-post","status-publish","format-standard","hentry","category-mikrotik"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/4861","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=4861"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/4861\/revisions"}],"predecessor-version":[{"id":4862,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/4861\/revisions\/4862"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}