{"id":310538,"date":"2020-09-26T21:00:46","date_gmt":"2020-09-26T21:00:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=310538"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=310538","title":{"rendered":"\u042f\u043d\u0434\u0435\u043a\u0441 \u043e\u0431\u043b\u0430\u043a\u043e \u0438 MikroTik MultiWAN"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/520778\/\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438 \u044f\u043d\u0434\u0435\u043a\u0441 \u043e\u0431\u043b\u0430\u043a\u0430 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 RouterOS MikroTik.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c <code>VPC<\/code> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0438 \u0440\u0430\u0437\u0434\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 <code>ip<\/code> \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0412\u041c \u0447\u0435\u0440\u0435\u0437 \u0448\u043b\u044e\u0437 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0437\u0430 <code>NAT<\/code>\u2019\u043e\u043c, \u0447\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e <code>ip<\/code> \u0432 \u044f\u043d\u0434\u0435\u043a\u0441 \u043e\u0431\u043b\u0430\u043a\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pb\/3e\/tx\/pb3etxjhwylud58uom6luj0bwc4.png\" \/><\/div>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u043e\u0434\u0438\u043d \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 <code>ip<\/code> \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 <code>NAT-instance<\/code> \u0438\u043b\u0438 \u043b\u044e\u0431\u0443\u044e \u0412\u041c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0432 <code>forward<\/code>, \u043d\u043e \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u0432 \u0441\u0435\u0442\u044c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0430\u043c\u043e\u0439 \u0412\u041c \u0438 \u0442\u0430\u043a \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438. \u041d\u0443\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u044f\u043c\u0438\/\u043f\u043e\u0434\u0441\u0435\u0442\u044f\u043c\u0438 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 (\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0433\u0440\u0443\u043f\u043f\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 <code>VPC<\/code> \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0432 \u0441\u0442\u0430\u0434\u0438\u0438 Preview).<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u043e, \u0442\u043e \u0445\u043e\u0442\u0435\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0445\u0435\u043c\u0443:<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dt\/_k\/op\/dt_kopgvxqfhswrkybd6ugxuulq.png\" \/><\/div>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0443 \u0441\u0440\u0430\u0437\u0443 \u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0435\u0440\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0442\u0430\u043a\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Internal1-a \u2013 10.1.0.0\/24 Internal2-a \u2013 10.1.1.0\/24 Internal1-b \u2013 10.1.2.0\/24 Internal2-b \u2013 10.1.3.0\/24 Internal1-c \u2013 10.1.4.0\/24 Internal2-c \u2013 10.1.5.0\/24<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d, \u0442. \u043a. \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 <code>ip<\/code> \u0440\u043e\u0443\u0442\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0448\u043b\u044e\u0437<br \/>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Gateway \u2013 X.X.X.1 Internal DNS \u2013 X.X.X.2<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0412\u041c \u0441 \u043e\u0431\u0440\u0430\u0437\u043e\u043c <code>RouterOS<\/code>. <\/p>\n<p>  <\/p>\n<p>\u0412 \u043e\u0431\u043b\u0430\u043a\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <code>Cloud Marketplace -&gt; \u0421\u0435\u0442\u0435\u0432\u0430\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 -&gt; Cloud Hosted Router<\/code> \u0438 \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 <code>ip<\/code> \u0430\u0434\u0440\u0435\u0441\u0430 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u0435\u0442\u0435\u0432\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">RouterOS Ether1 \u2013 10.1.0.254 Ether2 \u2013 10.1.1.254<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0412\u041c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a <code>ether1<\/code> \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c <code>winbox<\/code>. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u043e\u043b\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438, \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <code>admin<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>rsa public key<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0447\u0435\u0440\u0435\u0437 <code>CLI<\/code>. \u0412\u0441\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0432 <code>winbox<\/code>, \u043c\u0435\u043d\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0435, \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043c\u0435\u043d\u044e <code>ip<\/code> \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c <code>route<\/code> \u0438 \u0442.\u0434.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip route print  Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip,  b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit   #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE  0 ADS  0.0.0.0\/0                          10.1.0.1                  1  1 ADC  10.1.1.0\/24        10.1.1.254      ether2                    0  2 ADC  10.1.0.0\/24        10.1.0.254      ether1                    0<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438\u0434\u0435\u0442 \u0441 \u043f\u043e\u0440\u0442\u0430 <code>ether1<\/code> \u0447\u0435\u0440\u0435\u0437 \u0448\u043b\u044e\u0437 <code>10.1.0.1<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430 <code>NAT<\/code> \u0432\u044b\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0441\u0435\u0442\u044c. \u0415\u0441\u043b\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 <code>ip<\/code> \u0430\u0434\u0440\u0435\u0441\u0430, \u0442\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443 \u043d\u0430\u0441 2 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0437\u0430 \u0448\u043b\u044e\u0437\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0442\u0435\u0439, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b 2 \u043f\u043e\u0440\u0442\u0430, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0443\u043a\u0430\u0437\u0430\u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>distance<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0434\u0441\u0435\u0442\u044f\u043c.<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip route add dst-address=0.0.0.0\/0 gateway=10.1.1.1 distance=2  add dst-address=10.1.2.0\/24 gateway=10.1.0.1 distance=1   add dst-address=10.1.3.0\/24 gateway=10.1.1.1 distance=1   add dst-address=10.1.5.0\/24 gateway=10.1.1.1 distance=1   add dst-address=10.1.4.0\/24 gateway=10.1.0.1 distance=1 <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u043e\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 <code>b<\/code> \u0438 <code>c<\/code> \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0447\u0435\u0440\u0435\u0437 \u0448\u043b\u044e\u0437 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0437\u043e\u043d\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 <code>a<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c <code>firewall<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0412\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0442\u0435\u0439<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip firewall filter add chain=input action=accept src-address=10.1.5.0\/24  add chain=input action=accept src-address=10.1.1.0\/24  add chain=input action=accept src-address=10.1.3.0\/24  add chain=input action=accept src-address=10.1.2.0\/24  add chain=input action=accept src-address=10.1.0.0\/24  add chain=input action=accept src-address=10.1.4.0\/24 <\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c <code>ping<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip firewall filter add chain=input action=accept protocol=icmp <\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u043f\u0440\u043e\u0431\u0440\u043e\u0441 \u0432\u043f\u0435\u0440\u0435\u0434<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip firewall filter add chain=forward action=accept src-address=10.1.5.0\/24 \\ dst-address=0.0.0.0\/0  add chain=forward action=accept src-address=10.1.1.0\/24 \\ dst-address=0.0.0.0\/0  add chain=forward action=accept src-address=10.1.3.0\/24 \\ dst-address=0.0.0.0\/0  add chain=forward action=accept src-address=10.1.2.0\/24 \\ dst-address=0.0.0.0\/0  add chain=forward action=accept src-address=10.1.0.0\/24 \\ dst-address=0.0.0.0\/0  add chain=forward action=accept src-address=10.1.4.0\/24 \\ dst-address=0.0.0.0\/0 <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip firewall filter add chain=input action=drop log=no<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0435\u043d\u044f\u0435\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip firewall filter move numbers=&quot;[old rule no]&quot; \\ destination=&quot;[new rule no]&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041b\u044e\u0431\u0443\u0435\u043c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip firewall filter print<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0435\u0440\u0435\u0437 \u0448\u043b\u044e\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438 \u0438 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043f\u043e\u0440\u0442\u043e\u0432 \u0441 \u043f\u0440\u044f\u043c\u044b\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c <code>ip<\/code> \u0430\u0434\u0440\u0435\u0441\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 <code>MultiWAN<\/code>. \u041e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <code>\u0420\u0415\u0410\u041b\u0418\u0417\u0410\u0426\u0418\u042f MULTIWAN<\/code> (\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438)<\/p>\n<p>  <\/p>\n<p>\u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0412\u041c \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 <code>WAN<\/code> \u043f\u043e\u0440\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e <code>firewall mangle<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c 2 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 <code>interface list<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/interface list add name=&quot;WAN1&quot; add name=&quot;WAN2&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c <code>firewall mangle<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip firewall mangle add chain=input action=mark-connection \\ new-connection-mark=con-WAN1 passthrough=yes in-interface-list=WAN1 add chain=input action=mark-connection \\ new-connection-mark=con-WAN2 passthrough=yes in-interface-list=WAN2 add chain=output action=mark-routing \\ new-routing-mark=WAN1 passthrough=yes connection-mark=con-WAN1  add chain=output action=mark-routing \\ new-routing-mark=WAN2 passthrough=yes connection-mark=con-WAN2 <\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip route add dst-address=0.0.0.0\/0 gateway=10.1.0.1 distance=1 routing-mark=WAN1  add dst-address=0.0.0.0\/0 gateway=10.1.1.1 distance=1 routing-mark=WAN2 <\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0438\u0434\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 <code>ether1<\/code>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u043f\u043e\u0434\u0441\u0435\u0442\u0438, \u0442\u0430\u043a \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0445\u043e\u0441\u0442\u044b<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip route rule add src-address=10.1.3.0\/24 action=lookup-only-in-table table=WAN2  add src-address=10.1.5.0\/24 action=lookup-only-in-table table=WAN2<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u0441\u0435 2 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 <code>ip<\/code> \u043e\u0442\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0441\u0435\u0442\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0434\u0432\u0443\u0445 \u043a\u043e\u043d\u0442\u0443\u0440\u043e\u0432 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u044f\u043d\u0434\u0435\u043a\u0441 \u043e\u0431\u043b\u0430\u043a\u0430:<br \/>  <code>Virtual Private Cloud<\/code> -&gt; <code>\u041e\u0431\u043b\u0430\u0447\u043d\u044b\u0435 \u0441\u0435\u0442\u0438<\/code> -&gt; \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 <code>\u041f\u043e\u0434\u0441\u0435\u0442\u0438<\/code> \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c <code>NAT \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442<\/code> -&gt; <code>\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/code> -&gt; <code>\u0421\u043e\u0437\u0434\u0430\u0442\u044c<\/code>, \u0435\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c -&gt; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 <code>\u041f\u0440\u0435\u0444\u0438\u043a\u0441 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f: 0.0.0.0\/0, Next hop: 10.1.0.1\/10.1.1.1<\/code> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0443\u0440\u0430 \u0441\u0432\u043e\u0439 \u0448\u043b\u044e\u0437 -&gt; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u043f\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 \u0440\u043e\u0443\u0442\u0435\u0440\u0430 <\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip firewall nat add chain=srcnat action=masquerade src-address=10.1.0.0\/24 dst-address=0.0.0.0\/0  add chain=srcnat action=masquerade src-address=10.1.1.0\/24 dst-address=0.0.0.0\/0  add chain=srcnat action=masquerade src-address=10.1.2.0\/24 dst-address=0.0.0.0\/0  add chain=srcnat action=masquerade src-address=10.1.3.0\/24 dst-address=0.0.0.0\/0  add chain=srcnat action=masquerade src-address=10.1.4.0\/24 dst-address=0.0.0.0\/0  add chain=srcnat action=masquerade src-address=10.1.5.0\/24 dst-address=0.0.0.0\/0<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0436\u0434\u0430\u044f \u0412\u041c \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c <code>ip<\/code> \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0445\u0435\u043c\u0443:<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/t9\/g0\/xi\/t9g0xiltwdk0qd_-cy8si6jk9ga.png\" \/><\/div>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432\/\u043f\u0430\u0440\u0442\u043d\u0435\u0440\u043e\u0432\/\u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0412\u041c \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 <code>ip<\/code> \u0430\u0434\u0440\u0435\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/ip firewall nat add chain=dstnat action=netmap to-addresses=10.1.5.20 \\ to-ports=10050 protocol=tcp src-address=7.7.7.1 in-interface-list=WAN2 port=10055  add chain=dstnat action=netmap to-addresses=10.1.0.5 \\ to-ports=3306 protocol=tcp src-address=7.7.7.2 in-interface-list=WAN1 port=11050<\/code><\/pre>\n<p>  <\/p>\n<p>\u0433\u0434\u0435 7.7.7.1\/7.7.7.2 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 <code>ip<\/code> \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044e, \u0441\u043e\u0437\u0434\u0430\u0435\u043c <code>ipsec<\/code>, \u0440\u0435\u0436\u0438\u043c \u0441\u0435\u0442\u0438 \u0432 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0435, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u041c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0441\u0435\u0442\u0435\u0439 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d.<\/p>\n<p>  <\/p>\n<p>\u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044e \u0434\u043b\u044f <code>MikroTik RouterOS<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0441\u0442\u0438, \u0438\u043d\u0430\u0447\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u0440\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 100 \u041c\u0431\u0438\u0442\/\u0441 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443<br \/>  <a href=\"https:\/\/wiki.mikrotik.com\/wiki\/Manual:License\">https:\/\/wiki.mikrotik.com\/wiki\/Manual:License<\/a><\/p>\n<p>  <\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438:<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/mum.mikrotik.com\/presentations\/RU18M\/presentation_6157_1554717194.pdf\"><code>\u0420\u0415\u0410\u041b\u0418\u0417\u0410\u0426\u0418\u042f MULTIWAN<\/code><\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/520778\/\"> https:\/\/habr.com\/ru\/post\/520778\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/520778\/\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438 \u044f\u043d\u0434\u0435\u043a\u0441 \u043e\u0431\u043b\u0430\u043a\u0430 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 RouterOS MikroTik.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c <code>VPC<\/code> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0438 \u0440\u0430\u0437\u0434\u0430\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 <code>ip<\/code> \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0412\u041c \u0447\u0435\u0440\u0435\u0437 \u0448\u043b\u044e\u0437 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0437\u0430 <code>NAT<\/code>\u2019\u043e\u043c, \u0447\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-310538","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/310538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=310538"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/310538\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=310538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=310538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=310538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}