{"id":263594,"date":"2015-08-14T17:55:02","date_gmt":"2015-08-14T13:55:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=263594"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=263594","title":{"rendered":"Mikrotik VRF+NAT \u2014 \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438"},"content":{"rendered":"<p>     \t\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043c\u043e\u0449\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043c\u0438\u043a\u0440\u043e\u0442\u0438\u043a\u0430. \u041f\u0440\u043e\u0441\u044c\u0431\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0430\u044f. \u0418\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0441 \u043d\u0435\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c TCP\/IP \u0441\u0442\u0435\u043a\u043e\u043c. \u041d\u0430 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0431\u044b\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 IP, \u043f\u0440\u0438\u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e IP-\u0430\u0434\u0440\u0435\u0441 \u0438 \u043c\u0430\u0441\u043a\u0430, \u043d\u0438 \u0448\u043b\u044e\u0437, \u043d\u0438 DNS \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b. \u0421\u0442\u0440\u0430\u043d\u043d\u0430\u044f, \u043d\u043e, \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0432\u0435\u0441\u044c\u043c\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0447\u0438\u043d \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438 \u043d\u0430 \u044d\u0442\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442 \u0437\u0430 \u0430\u043a\u0441\u0438\u043e\u043c\u0443. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u0430\u043a, \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u0438 \u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0418\u0442\u0430\u043a, \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<br \/>   1. \u0427\u0435\u0442\u044b\u0440\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 IP \u2014 192.168.1.1\/24; GW \u0438 DNS \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b; \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<br \/>   2. \u041f\u041a, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c \u0447\u0435\u0442\u044b\u0440\u0435\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430 WEB-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<br \/>   3. \u041f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0439 MikroTik RB750GL \u043d\u0430 5 \u043f\u043e\u0440\u0442\u043e\u0432.<\/p>\n<p>  MikroTik RB750GL \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 1 \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 (NAT, FW), \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0440\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c DHCP \u2014 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u0440\u043e\u0443\u0442\u0435\u0440 \u0438\u043b\u0438 \u0440\u043e\u0443\u0442\u0435\u0440 Small Business \u0441\u0435\u0440\u0438\u0438. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 5 \u043f\u043e\u0440\u0442\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0447\u0438\u0441\u0442\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u0438 \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043e\u0442 NAT, FW \u0438 DHCP.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u043e\u0444\u0438\u0433 \u043e\u0447\u0438\u0441\u0442\u0438\u043b\u0438, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0445\u0435\u043c\u0443:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/317\/b44\/166\/317b441666f340ada493a8b635ea7938.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043a \u0434\u0435\u043b\u0443\u2026<br \/>  \u041f\u0435\u0440\u0432\u0430\u044f \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0441\u0442\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u2014 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438\u043b\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u041a\u0430\u043a \u0442\u0440\u0430\u043a\u0442\u0443\u044e\u0442 \u043e\u0441\u043d\u043e\u0432\u044b \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u043e\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0417\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u0431\u043b\u0438\u0446 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 Virtual Routing and Forwarding (VRF). \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 VRF \u2014 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<blockquote><p>\/ip route vrf<br \/>  add interfaces=ether1 routing-mark=DEV1<br \/>  add interfaces=ether2 routing-mark=DEV2<br \/>  add interfaces=ether3 routing-mark=DEV3<br \/>  add interfaces=ether4 routing-mark=DEV4<\/p><\/blockquote>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c IP-\u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u0445\u0435\u043c\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/3ba\/76c\/64f\/3ba76c64f90a4e47afcd7a7b95ec7f67.png\" alt=\"image\"\/><\/p>\n<p>  IP-\u0430\u0434\u0440\u0435\u0441 192.168.2.1 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0443 \u0441\u0430\u043c\u043e\u0433\u043e MikroTik&#8217;\u0430:  <\/p>\n<blockquote><p>\/ip address<br \/>  add address=192.168.2.1\/24 interface=ether5 network=192.168.2.0<br \/>  add address=192.168.1.2\/24 interface=ether1 network=192.168.1.0<br \/>  add address=192.168.1.2\/24 interface=ether2 network=192.168.1.0<br \/>  add address=192.168.1.2\/24 interface=ether3 network=192.168.1.0<br \/>  add address=192.168.1.2\/24 interface=ether4 network=192.168.1.0<\/p><\/blockquote>\n<p>  \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u0443\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c, \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0448\u043b\u044e\u0437\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0415\u0449\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c \u044d\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0441 MGMT PC. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e NAT. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u044b\u0434\u0435\u043b\u0438\u043c IP \u0438\u0437 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 192.168.2.0\/24 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 ether5:  <\/p>\n<blockquote><p>\/ip address<br \/>  add address=192.168.2.11\/24 interface=ether5 network=192.168.2.0<br \/>  add address=192.168.2.12\/24 interface=ether5 network=192.168.2.0<br \/>  add address=192.168.2.13\/24 interface=ether5 network=192.168.2.0<br \/>  add address=192.168.2.14\/24 interface=ether5 network=192.168.2.0<\/p><\/blockquote>\n<p>  \u0421\u0430\u043c NAT \u043f\u043e\u043a\u0430 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0435\u043c \u0438 \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0438 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u00ab\u0431\u0435\u0433\u0430\u0442\u044c\u00bb \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043a\u0438 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043d\u043e\u0432\u044b\u043c IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0431\u0443\u0434\u0435\u043c NAT&#8217;\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 NetFilter \u0442\u0430\u0431\u043b\u0438\u0446\u0430 Mangle, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043c\u0430\u0440\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u0442\u0440\u0430\u0444\u0438\u043a\u0430, \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u043d\u044c\u0448\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b NAT. \u041e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442 \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<blockquote><p>\/ip firewall mangle<br \/>  add action=mark-routing chain=prerouting dst-address=192.168.2.11 new-routing-mark=DEV1<br \/>  add action=mark-routing chain=prerouting dst-address=192.168.2.12 new-routing-mark=DEV2<br \/>  add action=mark-routing chain=prerouting dst-address=192.168.2.13 new-routing-mark=DEV3<br \/>  add action=mark-routing chain=prerouting dst-address=192.168.2.14 new-routing-mark=DEV4<\/p><\/blockquote>\n<p>  \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b \u043f\u0430\u043a\u0435\u0442\u044b, \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0435 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 ether5 \u043e\u0442 \u0445\u043e\u0441\u0442\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0443\u0436\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u043a \u0446\u0435\u043b\u0435\u0432\u043e\u043c\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443.<br \/>  \u041e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 ether5, \u043a\u0443\u0434\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043d\u0430\u0448 \u0445\u043e\u0441\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 Mangle \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e:  <\/p>\n<blockquote><p>\/ip firewall mangle<br \/>  add action=mark-routing chain=prerouting dst-address=192.168.2.2 new-routing-mark=main<\/p><\/blockquote>\n<p>  \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 192.168.2.2 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u00abmain\u00bb, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0445\u043e\u0441\u0442\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043e NAT. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0434\u0432\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430:  <\/p>\n<blockquote><p>\/ip firewall nat<br \/>  add action=dst-nat chain=dstnat dst-address=192.168.2.11 in-interface=ether5 to-addresses=192.168.1.1<br \/>  add action=src-nat chain=srcnat out-interface=ether1 to-addresses=192.168.1.2<br \/>  add action=dst-nat chain=dstnat dst-address=192.168.2.12 in-interface=ether5 to-addresses=192.168.1.1<br \/>  add action=src-nat chain=srcnat out-interface=ether2 to-addresses=192.168.1.2<br \/>  add action=dst-nat chain=dstnat dst-address=192.168.2.13 in-interface=ether5 to-addresses=192.168.1.1<br \/>  add action=src-nat chain=srcnat out-interface=ether3 to-addresses=192.168.1.2<br \/>  add action=dst-nat chain=dstnat dst-address=192.168.2.14 in-interface=ether5 to-addresses=192.168.1.1<br \/>  add action=src-nat chain=srcnat out-interface=ether4 to-addresses=192.168.1.2<\/p><\/blockquote>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e NAT&#8217;\u0430 \u0438 VRF \u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438, \u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e NAT&#8217;\u0430 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043c\u043e\u0442\u0440\u044f\u0442 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u044d\u0442\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u0438 \u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0435\u0437 \u0448\u043b\u044e\u0437\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<br \/>  \u0412 \u0438\u0442\u043e\u0433\u0435, \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0435\u0432\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 web-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441) \u043d\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u043c \u0445\u043e\u0441\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0431\u0440\u0430\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435:<br \/>  <code> DEV1 - http:\/\/192.168.2.11 <\/code><br \/>  <code> DEV2 - http:\/\/192.168.2.12 <\/code><br \/>  <code> DEV3 - http:\/\/192.168.2.13 <\/code><br \/>  <code> DEV4 - http:\/\/192.168.2.14 <\/code>     \t<\/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=\"http:\/\/habrahabr.ru\/post\/262091\/\"> http:\/\/habrahabr.ru\/post\/262091\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b \u043f\u043e\u043c\u043e\u0449\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043c\u0438\u043a\u0440\u043e\u0442\u0438\u043a\u0430. \u041f\u0440\u043e\u0441\u044c\u0431\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0430\u044f. \u0418\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441 \u043e\u0434\u043d\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0447\u0435\u0442\u044b\u0440\u044c\u043c\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0441 \u043d\u0435\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c TCP\/IP \u0441\u0442\u0435\u043a\u043e\u043c. \u041d\u0430 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0431\u044b\u043b\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 IP, \u043f\u0440\u0438\u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e IP-\u0430\u0434\u0440\u0435\u0441 \u0438 \u043c\u0430\u0441\u043a\u0430, \u043d\u0438 \u0448\u043b\u044e\u0437, \u043d\u0438 DNS \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b. \u0421\u0442\u0440\u0430\u043d\u043d\u0430\u044f, \u043d\u043e, \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0432\u0435\u0441\u044c\u043c\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0447\u0438\u043d \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438 \u043d\u0430 \u044d\u0442\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u043a\u0442 \u0437\u0430 \u0430\u043a\u0441\u0438\u043e\u043c\u0443. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u0430\u043a, \u043a\u0430\u043a \u0435\u0441\u0442\u044c, \u0438 \u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c.  <\/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-263594","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263594","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=263594"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263594\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=263594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=263594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=263594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}