{"id":279489,"date":"2016-05-03T16:05:01","date_gmt":"2016-05-03T12:05:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=279489"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=279489","title":{"rendered":"MikroTik \u0438 192.168.0.0\/24"},"content":{"rendered":"<p>       \u0412\u044b\u0448\u0435\u043b \u043d\u0430 \u043c\u0435\u043d\u044f \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0441 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u00ab\u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0434\u0432\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c VPN \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043e\u0444\u0438\u0441\u0430\u043c\u0438\u00bb.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u043b\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0422\u0417, \u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0445\u0435\u043c\u044b \u0432 Visio. <br \/>  \u0410 \u0432\u043e\u0442 \u0438 \u0441\u0430\u043c\u0430 \u0441\u0445\u0435\u043c\u0430  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/92b\/b00\/4da\/92bb004da4bc4d7a9bd085219cdecf42.png\" \/><\/div>\n<p>  \u0410 \u0432\u043e\u0442 \u0432 \u0447\u0451\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<br \/>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0435 R1 \u0442\u0440\u0438 192.168.0.0\/24 \u0441\u0435\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0442\u0440\u0435\u0442\u044c\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u044d\u0442\u043e \u0442\u043e \u0447\u0442\u043e \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u0435\u0442\u044c 192.168.0.0\/24<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c\u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432, VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u044b\u043b\u043e.<br \/>  \u0417\u0430\u0434\u0430\u0447\u0430, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c\u0438 \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0438\u0437 \u0441\u0435\u0442\u0438 \u0434\u0432\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c VPN \u043c\u0435\u0436\u0434\u0443 R1 \u0438 R2, \u0442\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u043e\u0444\u0438\u0441\u0430\u043c\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u043e \u043a\u0430\u043d\u0430\u043b\u0430\u043c.<\/p>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430, \u0432\u0440\u043e\u0434\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e \u043b\u0430\u0431\u044b \u0432 UnetLab<\/p>\n<p>  \u041c\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0430 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u043b\u0430\u043b \u00ab\u043e\u0434\u0438\u043d \u043a \u043e\u0434\u043d\u043e\u043c\u0443\u00bb, \u0432\u0441\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435.<br \/>  \u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0445\u0435\u043c\u0430 \u0432 UnetLab  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/96b\/965\/94e\/96b96594e12748adb2e58ccc231cd888.PNG\" \/><\/div>\n<p>  \u041c\u0435\u0436\u0434\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u00ab\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432\u00bb \u0438 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u00abinternet\u00bb \u043f\u043e\u0434\u043d\u044f\u0442 BGP \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0441 AS 65530.<\/p>\n<p>  \u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442\u043d\u0430\u044f \u0441\u0435\u0442\u044c 10.0.0.0\/8<br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u043a\u0443\u0447\u0443 \u0441\u0435\u0442\u0435\u0439 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u0430 \u0432\u0441\u0435\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u0445 \u0432\u043a\u043b\u044e\u0447\u0435\u043d RoMON, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e winbox \u043f\u043e mac \u043a \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u0447\u0435\u0440\u0435\u0437 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u044b, \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 BGP.<\/p>\n<h4>\u041f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0435 R1.<\/h4>\n<p>   \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430 IP \u0430\u0434\u0440\u0435\u0441 192.168.0.1\/24, \u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043e\u0442\u0434\u0430\u0451\u0442 \u043f\u043e DHCP \u0430\u0434\u0440\u0435\u0441 \u0438\u0437 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u0435\u0442\u0438 192.168.0.0\/24. <br \/>  \u0425\u043e\u0440\u043e\u0448\u043e, \u0447\u0442\u043e \u0448\u043b\u044e\u0437 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0441\u044f.<br \/>  \u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0451 \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u0442\u043e MikroTik \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c ECMP \u043d\u0430 Connected \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435. \u041d\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0438 \u0441\u0435\u0442\u0438, \u0447\u0438\u0441\u0442\u044b\u0439 Route Policy Based \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0442\u0440\u0430\u0444\u0438\u043a\u0443 \u0432 mangle.<br \/>  \u041d\u0430\u0448\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 VRF, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.<br \/>  \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 RPB \u0438 VRF \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 RPB \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u0442\u043e \u043f\u043e\u0438\u0441\u043a \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 main, \u0434\u043b\u044f VRF \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0440\u0430\u0444\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0432\u043e\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435.<\/p>\n<h4>\u0418 \u0442\u0430\u043a \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 R1.<\/h4>\n<p>  <\/p>\n<pre><code class=\"bash\">\/ip address add address=192.168.0.1\/24 interface=ether4 \/ip firewall nat add action=masquerade chain=srcnat out-interface=ether1 add action=masquerade chain=srcnat out-interface=ether2 \/ip dhcp-client add default-route-distance=0 dhcp-options=hostname,clientid disabled=no interface=ether1 add default-route-distance=0 dhcp-options=hostname,clientid disabled=no interface=ether2 \/ip route vrf add interfaces=ether1 routing-mark=ISP1 add interfaces=ether2 routing-mark=ISP2 <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u0442\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u044d\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 VRF. <br \/>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \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<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/87c\/af5\/f34\/87caf5f34ffb46db86fc8c4b3f6f0c68.PNG\" \/><\/div>\n<p>  \u0412\u0441\u0451 \u0431\u044b \u043d\u0435\u0447\u0435\u0433\u043e, \u043d\u043e \u043a\u0430\u043a \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0440\u0430\u043d\u0435\u0435 \u0438\u0437 VRF \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0438 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0432 MikroTik \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u00ab\u0443\u0442\u0435\u0447\u043a\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u00bb.<br \/>  \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0443\u0442\u0435\u0447\u043a\u0443 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0434\u0432\u0430 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430.  <\/p>\n<pre><code class=\"bash\">\/ip route add check-gateway=ping distance=10 gateway=192.168.0.1%ether1 add check-gateway=ping distance=20 gateway=192.168.0.1%ether2 <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0448\u043b\u044e\u0437, \u043a \u043d\u0435\u043c\u0443 \u0432 \u043a\u043e\u043d\u0435\u0446 \u0447\u0435\u0440\u0435\u0437 \u0437\u043d\u0430\u043a \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 VRF.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0438\u0437 main \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442, \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 VRF \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u041d\u043e \u0442\u0443\u0442 \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0432\u043e\u0437\u0434\u043a\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e VRF, \u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0432\u0448\u0438\u0439\u0441\u044f \u0442\u0440\u0430\u0444\u0438\u043a \u0441\u0430\u043c \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 main \u0438\u0437 VRF \u0435\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u043e\u0447\u044c=)  <\/p>\n<pre><code class=\"bash\">\/ip firewall mangle add action=mark-connection chain=input in-interface=ether1 new-connection-mark=Input\/ISP1 add action=mark-routing chain=prerouting connection-mark=Input\/ISP1 new-routing-mark=ISP1 passthrough=no add action=mark-routing chain=prerouting in-interface=ether1 new-routing-mark=main passthrough=no add action=mark-connection chain=input in-interface=ether2 new-connection-mark=Input\/ISP2 add action=mark-routing chain=prerouting connection-mark=Input\/ISP2 new-routing-mark=ISP2 passthrough=no add action=mark-routing chain=prerouting in-interface=ether2 new-routing-mark= main passthrough=no <\/code><\/pre>\n<p>  1,2,4,5 \u2013 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 \u043d\u0438\u0445 \u043d\u0435\u0442\u0443 \u043d\u0435\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e, \u043e\u043d\u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e.<br \/>  \u0410 \u0432\u043e\u0442 \u0442\u0440\u0435\u0442\u044c\u0435 \u0438 \u0448\u0435\u0441\u0442\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0442\u0430\u043c, \u0433\u0434\u0435 new-routing-mark= main, \u0438 \u0435\u0441\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 VRF \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u0440\u0430\u0444\u0438\u043a\u0430<br \/>  \u0418 \u0442\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a VPN<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 VPN<\/h4>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430 R1 \u043d\u0435\u0442\u0443 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430, \u0438 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u0445\u043e\u0442\u044c \u043f\u0430\u0440\u0443 \u043f\u043e\u0440\u0442\u043e\u0432, \u0440\u0435\u0448\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 Client-to-Server \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439, \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 SSTP<br \/>   \u041d\u0430\u0447\u0430\u043b \u044f \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c SSTP \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u043e\u0444\u0438\u043b\u0438 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435, \u043a\u0430\u043a \u0434\u043e \u043c\u0435\u043d\u044f \u0434\u043e\u0448\u043b\u043e, \u0447\u0442\u043e \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u044f \u043d\u0435 \u0441\u043c\u043e\u0433\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u044c src-address \u043a\u0430\u043a \u0432 ipip \u0438\u043b\u0438 gre \u0442\u0443\u043d\u043d\u0435\u043b\u0435, \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043c\u043d\u0435 \u043d\u0435 \u0437\u0430\u0446\u0435\u043f\u0438\u0442\u0441\u044f \u0437\u0430 \u0442\u0440\u0430\u0444\u0438\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u0442\u043e\u0440\u043e\u0439 \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430. \u0410\u0434\u0440\u0435\u0441 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0443 \u0434\u0432\u0443\u0445 \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439, \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043d\u0435 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0434\u0432\u0430 sstp \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 IP \u0438\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0430\u0445.<\/p>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u0441\u0435\u0431\u044f \u0434\u043e\u043b\u0433\u043e \u0436\u0434\u0430\u0442\u044c, \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b \u044f \u043f\u0440\u043e dst-nat, \u043a\u0442\u043e \u043d\u0430\u043c \u043c\u0435\u0448\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u0442 \u0443\u0436\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0430?! \u043d\u0435\u043a\u0442\u043e! \u0422\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0447\u0442\u043e \u0432 MikroTik \u0435\u0441\u0442\u044c action redirect, \u043e\u0434\u043d\u043e \u0438\u0437 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432 dst-nat. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0432\u0430 \u043f\u043e\u0440\u0442\u0430 443(ISP1) \u0438 1443(ISP2)<\/p>\n<p>  R2  <\/p>\n<pre><code class=\"bash\">\/ppp profile set *0 local-address=172.31.255.254  \/ppp secret add name=ppp1 password=ppp1 remote-address=172.31.255.1 service=sstp add name=ppp2 password=ppp2 remote-address=172.31.255.2 service=sstp  \/interface sstp-server server set enabled=yes  \/ip firewall nat add action=redirect chain=dstnat dst-port=1443 in-interface=ether1 protocol=tcp to-ports=443 <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043a\u0430\u043a \u0440\u0430\u0437 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0441 1443 \u043d\u0430 443(sstp Server)<br \/>  R1  <\/p>\n<pre><code class=\"bash\">\/interface sstp-client add connect-to=1.1.1.2 disabled=no mrru=1600 name=ISP1\/R2 password=ppp1 profile=default-encryption user=ppp1 add connect-to=1.1.1.2:1443 disabled=no mrru=1600 name=ISP2\/R2 password=ppp2 profile=default-encryption user=ppp2  \/ip firewall mangle add action=mark-routing chain=output dst-address=1.1.1.2 dst-port=1443 new-routing-mark=ISP2 passthrough=no protocol=tcp <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u044b\u0445\u043e\u0434 sstp \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 OSPF \u0438 NAT<\/h4>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0435\u0442\u044f\u043c\u0438 \u043f\u043e \u0438\u0445 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c, \u0435\u0441\u043b\u0438 \u0431\u044b \u0431\u044b\u043b \u043e\u0434\u0438\u043d DHCP \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u0440\u0435\u043b\u0435\u0439\u043e\u043c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043b\u0438\u0431\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0431\u0440\u0443\u0434\u043a\u0430\u0441\u0442 \u0434\u043e\u043c\u0435\u043d, \u0438\u043b\u0438 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430\u0445 arp-proxy, \u043d\u043e \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f.<br \/>  \u0418 \u0442\u0430\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0435\u0441\u0442\u044c, \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0430\u0434\u0440\u0435\u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044f \u0438 \u0430\u043f\u0435\u043b\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u044b\u043c\u0438 \u0441\u0435\u0442\u044f\u043c\u0438.<\/p>\n<p>  \u0421\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b R1 \u0431\u0443\u0434\u0435\u0442 \u0441\u0435\u0442\u044c 192.168.3.0\/24<br \/>  \u0421\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b R2 \u0431\u0443\u0434\u0435\u0442 \u0441\u0435\u0442\u044c 192.168.4.0\/24<\/p>\n<h5>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c R1 \u0438 OSPF<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">\/routing ospf instance set [ find default=yes ] disabled=yes redistribute-static=as-type-1 router-id=192.168.3.1 \/routing filter add action=accept chain=ospf-in prefix=192.168.0.0\/16 prefix-length=24 add action=discard chain=ospf-in add action=accept chain=ospf-out prefix=192.168.0.0\/16 prefix-length=24 add action=discard chain=ospf-out \/routing ospf network add area=backbone network=172.31.255.0\/24 \/ip route add distance=1 dst-address=192.168.3.0\/24 type=prohibit <\/code><\/pre>\n<h5>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c R2 \u0438 OSPF<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">\/routing ospf instance set [ find default=yes ] redistribute-static=as-type-1 router-id=192.168.4.1 \/routing filter add action=accept chain=ospf-in prefix=192.168.0.0\/16 prefix-length=24 add action=discard chain=ospf-in add action=accept chain=ospf-out prefix=192.168.0.0\/16 prefix-length=24 add action=discard chain=ospf-out \/routing ospf network add area=backbone network=172.31.255.0\/2 \/ip route add distance=1 dst-address=192.168.4.0\/24 type=prohibit <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435 \u043c\u044b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0443 \u0442\u0438\u043f\u0430 prohibit, \u043e\u043d\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 OSPF \u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f ECMP.<br \/>  \u041f\u0440\u043e\u0442\u043e\u043a\u043e\u043b OSPF \u043b\u0451\u0433\u043a\u0438\u0439 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0435\u0433\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043f\u0440\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u043e VPN \u0442\u0443\u043d\u043d\u0435\u043b\u044f\u043c \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0431\u043c\u0435\u043d \u0441\u0435\u0442\u044f\u043c\u0438, \u0430 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0434\u0432\u0443\u0445 \u0436\u0438\u0432\u044b\u0445 \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f ECMP.<br \/>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c \u043f\u0440\u043e\u0439\u0434\u0451\u043c\u0441\u044f<br \/>  \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0445 \u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u0443\u044e\u0449\u0438\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0447\u0442\u043e-\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0441\u0451 \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c.  <\/p>\n<pre><code class=\"bash\">add action=accept chain=ospf-in prefix=192.168.0.0\/16 prefix-length=24  <\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0432\u0441\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0438\u0437 \u0441\u0435\u0442\u0438 192.168.0.0\/16 \u0438 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \/24  <\/p>\n<pre><code class=\"bash\">add action=discard chain=ospf-in <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u0432\u0441\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b<\/p>\n<p>  <u><b>\u042f \u0435\u0449\u0451 \u0440\u0430\u0437 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u043d\u0435 \u043d\u0430\u0434\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u044f\u0434 \u0441\u0435\u0442\u0438. <a href=\"https:\/\/habrahabr.ru\/company\/yandex\/blog\/126709\/\">\u0412\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 yandex<\/a><\/b><\/u><br \/>  \u041a\u0430\u043a \u0436\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u0434\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0446\u0435\u043b\u044b\u0435 \u0441\u0435\u0442\u0438?<br \/>   \u0412\u0441\u0451 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 NAT same \u0438 netmap.<br \/>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430 R1  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d5e\/2ac\/b56\/d5e2acb56c864600b92b341d17ab0b31.png\" \/><\/div>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e <br \/>  \u0421\u0435\u0442\u044c 192.168.0.0\/24 \u043d\u0430 R1, \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0441 R2 \u043f\u043e \u0441\u0435\u0442\u0438 192.168.3.0\/24<br \/>  \u0421\u0435\u0442\u044c 192.168.0.0\/24 \u043d\u0430 R2, \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0441 R1 \u043f\u043e \u0441\u0435\u0442\u0438 192.168.4.0\/24<\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u0430\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 NAT  <\/p>\n<h4>\u0414\u043b\u044f R1<\/h4>\n<p>  <\/p>\n<pre><code class=\"bash\">\/ip firewall nat add action=same chain=srcnat dst-address=192.168.4.0\/24 src-address=192.168.0.0\/24 to-addresses=192.168.3.0\/24 add action=netmap chain=dstnat dst-address=192.168.3.0\/24 src-address=192.168.4.0\/24 to-addresses=192.168.0.0\/24 <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0414\u043b\u044f R2<\/h4>\n<p>  <\/p>\n<pre><code class=\"bash\">\/ip firewall nat add action=same chain=srcnat dst-address=192.168.3.0\/24 src-address=192.168.0.0\/24 to-addresses=192.168.4.0\/24 add action=netmap chain=dstnat dst-address=192.168.4.0\/24 src-address=192.168.3.0\/24 to-addresses=192.168.0.0\/24 <\/code><\/pre>\n<p>  \u041f\u0440\u0443\u0444<br \/>  <a href=\"http:\/\/wiki.mikrotik.com\/wiki\/Russian\/OSPF\">MikroTik \u2014 OSPF<\/a><br \/>  <a href=\"http:\/\/wiki.mikrotik.com\/wiki\/Manual:Virtual_Routing_and_Forwarding\">MikroTik \u2014 VRF<\/a><br \/>  <a href=\"http:\/\/wiki.mikrotik.com\/wiki\/Manual:IP\/Firewall\/NAT\">MikroTik \u2014 NAT<\/a><br \/>  <a href=\"http:\/\/wiki.mikrotik.com\/wiki\/Manual:RoMON\">MikroTik \u2014 RoMON<\/a><br \/>  <a href=\"http:\/\/www.unetlab.com\/\">UnetLab<br \/>  <\/a><br \/>  \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0443 \u0441\u0435\u0431\u044f \u043d\u0430 UnetLab \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0449\u0430\u0439\u0442\u0435\u0441\u044c \u0432 \u043b\u0438\u0447\u043a\u0443, \u043c\u043e\u0439 \u0441\u0430\u0439\u0442\u0438\u043a \u043d\u0435 \u0432\u044b\u0434\u0435\u0440\u0436\u0438\u0442 \u0445\u0430\u0431\u0440\u0430\u044d\u0444\u0435\u043a\u0442               <\/p>\n<div class=\"clear\"><\/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:\/\/habrahabr.ru\/post\/282858\/\"> https:\/\/habrahabr.ru\/post\/282858\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412\u044b\u0448\u0435\u043b \u043d\u0430 \u043c\u0435\u043d\u044f \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0441 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u00ab\u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0434\u0432\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c VPN \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043e\u0444\u0438\u0441\u0430\u043c\u0438\u00bb.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u043b\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0422\u0417, \u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0445\u0435\u043c\u044b \u0432 Visio. <br \/>  \u0410 \u0432\u043e\u0442 \u0438 \u0441\u0430\u043c\u0430 \u0441\u0445\u0435\u043c\u0430  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/92b\/b00\/4da\/92bb004da4bc4d7a9bd085219cdecf42.png\" \/><\/div>\n<p>  \u0410 \u0432\u043e\u0442 \u0432 \u0447\u0451\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<br \/>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0435 R1 \u0442\u0440\u0438 192.168.0.0\/24 \u0441\u0435\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0442\u0440\u0435\u0442\u044c\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u044d\u0442\u043e \u0442\u043e \u0447\u0442\u043e \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u0435\u0442\u044c 192.168.0.0\/24  <\/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-279489","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279489","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=279489"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/279489\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=279489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=279489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=279489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}