{"id":306775,"date":"2020-07-10T15:01:28","date_gmt":"2020-07-10T15:01:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306775"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306775","title":{"rendered":"\u0420\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Mikrotik \u0438 VPN: \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b"},"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\/company\/ruvds\/blog\/510038\/\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/510038\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8i\/8k\/ve\/8i8kvez0ardik4xqyvt5eey6zom.jpeg\"><\/div>\n<p><\/a><br \/>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Mikrotik, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u0435\u0449\u0451\u043d\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 VPN \u0438 \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0430\u043d\u0446\u0435\u0432 \u0441 \u0431\u0443\u0431\u043d\u0430\u043c\u0438: \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0438 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 VPN \u044f \u0432\u044b\u0431\u0440\u0430\u043b SoftEther: \u043e\u043d \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u043f\u0440\u043e\u0441\u0442 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u0430\u043a \u0438 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/505824\/\">RRAS<\/a> \u0438 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439. \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 VPN \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u043a\u043b\u044e\u0447\u0438\u043b Secure NAT, \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043d\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b RRAS, \u043d\u043e Mikrotik \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0441 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.\u00a0 \u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f, VPN \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u0440\u0435\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0432 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043b\u043e\u0433\u0435 Mikrotik \u043d\u0435 \u0443\u043c\u0435\u0435\u0442.<\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 RB3011UiAS-RM \u043d\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 6.46.11.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u0447\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2><font color=\"#3AC1EF\">1. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435<\/font><\/h2>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 VPN \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, SoftEther, L2TP \u0441 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c. \u0422\u0430\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u043e\u043c\u0443 \u0443\u0433\u043e\u0434\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043b\u044e\u0447 \u0437\u043d\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u043e\u0443\u0442\u0435\u0440 \u0438 \u0435\u0433\u043e \u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446. <\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b interfaces. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0432\u043e\u0434\u0438\u043c ip, \u043b\u043e\u0433\u0438\u043d, \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u043e\u0431\u0449\u0438\u0439 \u043a\u043b\u044e\u0447 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0416\u043c\u0435\u043c \u043e\u043a. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ub\/y7\/qw\/uby7qw36h7y_dqljdnfmhpzc6vs.png\"><\/div>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rc\/vn\/ln\/rcvnln1hjqb3xujatz2e-duq9qw.png\"><\/div>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<p>  <code>\/interface l2tp-client<br \/>  name=&quot;LD8&quot; connect-to=45.134.254.112 user=&quot;Administrator&quot; password=&quot;PASSWORD&quot; profile=default-encryption use-ipsec=yes ipsec-secret=&quot;vpn&quot;<\/code><\/p>\n<p>  SoftEther \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f ipsec proposals \u0438 ipsec profiles, \u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c, \u043d\u043e \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439, \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u0430\u0432\u0442\u043e\u0440 \u043e\u0441\u0442\u0430\u0432\u0438\u043b.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/51\/w4\/mo\/51w4mo08jxeiocxl_kypzvd8e3y.png\"><\/div>\n<p>  <i>\u0414\u043b\u044f RRAS \u0432 IPsec Proposals \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c PFS Group \u043d\u0430 none.<\/i><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0442\u044c \u0437\u0430 NAT \u044d\u0442\u043e\u0433\u043e VPN \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 IP &gt; Firewall &gt; NAT.<\/p>\n<p>  \u0422\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c masquerade \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e, \u0438\u043b\u0438 \u0432\u0441\u0435\u0445 PPP \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u0420\u043e\u0443\u0442\u0435\u0440 \u0430\u0432\u0442\u043e\u0440\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0441\u0440\u0430\u0437\u0443 \u043a \u0442\u0440\u0451\u043c VPN\u2019\u0430\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-v\/pl\/vu\/-vplvuliwqqbebqgfbt57ygaxxq.png\"><\/div>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/iz\/yk\/a8\/izyka8y3rtc_gvx0cnteyajawd8.png\"><\/div>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<p>  <code>\/ip firewall nat<br \/>  chain=srcnat action=masquerade out-interface=all-ppp<\/code><\/p>\n<h2><font color=\"#3AC1EF\">2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 Mangle<\/font><\/h2>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0430\u043c\u043e\u0435 \u0446\u0435\u043d\u043d\u043e\u0435 \u0438 \u0431\u0435\u0437\u0437\u0430\u0449\u0438\u0442\u043d\u043e\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e DNS \u0438 HTTP \u0442\u0440\u0430\u0444\u0438\u043a. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 HTTP.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 IP \u2192 Firewall \u2192 Mangle \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e.<\/p>\n<p>  \u0412 \u043f\u0440\u0430\u0432\u0438\u043b\u0435, Chain \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Prerouting. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434 \u0440\u043e\u0443\u0442\u0435\u0440\u043e\u043c \u0441\u0442\u043e\u0438\u0442 Smart SFP \u0438\u043b\u0438 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0440\u043e\u0443\u0442\u0435\u0440, \u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u0435\u0431 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443, \u0432 \u043f\u043e\u043b\u0435 Dst. Address \u043d\u0443\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e IP \u0430\u0434\u0440\u0435\u0441 \u0438\u043b\u0438 \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u043a \u043e\u0442\u0440\u0438\u0446\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c Mangle \u0432 \u0430\u0434\u0440\u0435\u0441\u0443 \u0438\u043b\u0438 \u043a \u044d\u0442\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438. \u0423 \u0430\u0432\u0442\u043e\u0440\u0430 \u0441\u0442\u043e\u0438\u0442 SFP GPON ONU \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0431\u0440\u0438\u0434\u0436\u0430, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0430\u0432\u0442\u043e\u0440 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0435\u0433\u043e \u0432\u0435\u0431\u043c\u043e\u0440\u0434\u0435.<\/p>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Mangle \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043a\u043e \u0432\u0441\u0435\u043c NAT State\u2019\u0430\u043c, \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u0440\u043e\u0441 \u043f\u043e\u0440\u0442\u0430 \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0431\u0435\u043b\u043e\u043c\u0443 IP \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 Connection NAT State \u0441\u0442\u0430\u0432\u0438\u043c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u043d\u0430 dstnat \u0438 \u0437\u043d\u0430\u043a \u043e\u0442\u0440\u0438\u0446\u0430\u043d\u0438\u044f. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e \u0441\u0435\u0442\u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0447\u0435\u0440\u0435\u0437 VPN, \u043d\u043e \u0432\u0441\u0435 \u0435\u0449\u0435 \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439 \u0431\u0435\u043b\u044b\u0439 IP.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ep\/nl\/rr\/epnlrrel4u4spsmbzcfayicint8.png\"><\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Action \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c mark routing, \u043e\u0431\u0437\u044b\u0432\u0430\u0435\u043c New Routing Mark \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u0430\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438 \u0435\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qa\/dw\/nz\/qadwnzkqhzuxvzyxn3o6krbwqoy.png\"><\/div>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<p>  <code>\/ip firewall mangle<br \/>  add chain=prerouting action=mark-routing new-routing-mark=HTTP passthrough=no connection-nat-state=!dstnat protocol=tcp dst-address=!192.168.1.1 dst-port=80<\/code><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0437\u0430\u0449\u0438\u0442\u0435 DNS. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430. \u041e\u0434\u043d\u043e \u0434\u043b\u044f \u0440\u043e\u0443\u0442\u0435\u0440\u0430, \u0434\u0440\u0443\u0433\u043e\u0435 \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0443.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0432 \u0440\u043e\u0443\u0442\u0435\u0440 DNS, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438 \u0430\u0432\u0442\u043e\u0440, \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u0436\u0435 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c chain prerouting, \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c output.<\/p>\n<p>  Output \u044d\u0442\u043e \u0446\u0435\u043f\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0430\u043c \u0440\u043e\u0443\u0442\u0435\u0440 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430. \u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 HTTP, \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b UDP, \u043f\u043e\u0440\u0442 53.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pq\/wf\/ue\/pqwfuenax0zawwaw4xn9dwnki2k.png\"><\/div>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kd\/5i\/n6\/kd5in6wag1f_nfpdxdi04qdn-xo.png\"><\/div>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438:<\/p>\n<p>  <code>\/ip firewall mangle<br \/>  add chain=prerouting action=mark-routing new-routing-mark=DNS passthrough=no protocol=udp<br \/>  add chain=output action=mark-routing new-routing-mark=DNS-Router passthrough=no protocol=udp dst-port=53<\/code><\/p>\n<h2><font color=\"#3AC1EF\">3. \u0421\u0442\u0440\u043e\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0447\u0435\u0440\u0435\u0437 VPN<\/font><\/h2>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 IP \u2192 Routes \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b.<\/p>\n<p>  \u041c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043b\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 HTTP \u043f\u043e VPN. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0438\u0445 VPN \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Routing Mark.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/il\/ai\/an\/ilaianeq29izptcrjaoalzwexl8.png\"><\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438, \u043a\u0430\u043a \u0432\u0430\u0448 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b <a href=\"https:\/\/habr.com\/ru\/post\/506218\/\">\u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u043a\u043b\u0430\u043c\u0443 \u0432 \u0432\u0430\u0448 HTTP \u0442\u0440\u0430\u0444\u0438\u043a<\/a>.<\/p>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<p>  <code>\/ip route<br \/>  add dst-address=0.0.0.0\/0 gateway=LD8 routing-mark=HTTP distance=2 comment=HTTP<\/code><\/p>\n<p>  \u0420\u043e\u0432\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b DNS, \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u0443\u044e \u043c\u0435\u0442\u043a\u0443:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zg\/82\/_e\/zg82_eadxoym565ewduq6duwdhy.png\"><\/div>\n<p>  \u0422\u0443\u0442 \u0432\u044b \u043e\u0449\u0443\u0442\u0438\u043b\u0438, \u043a\u0430\u043a \u0432\u0430\u0448\u0438 DNS \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u0442\u044c. \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438:<\/p>\n<p>  <code>\/ip route<br \/>  add dst-address=0.0.0.0\/0 gateway=LD8 routing-mark=DNS distance=1 comment=DNS<br \/>  add dst-address=0.0.0.0\/0 gateway=LD8 routing-mark=DNS-Router distance=1 comment=DNS-Router<\/code><\/p>\n<p>  \u041d\u0443 \u043f\u043e\u0434 \u043a\u043e\u043d\u0435\u0446, \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c Rutracker. \u0412\u0441\u044f \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043f\u043e\u0434\u0441\u0435\u0442\u044c.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ys\/ak\/97\/ysak97wm8rlcwqza83pj4un445k.png\"><\/div>\n<p>  \u0412\u043e\u0442 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0435\u0431\u0435 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442. \u041a\u043e\u043c\u0430\u043d\u0434\u0430:<\/p>\n<p>  <code>\/ip route<br \/>  add dst-address=195.82.146.0\/24 gateway=LD8 distance=1 commant=Rutracker.Org<\/code><\/p>\n<p>  \u0420\u043e\u0432\u043d\u043e \u044d\u0442\u0438\u043c \u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0447\u0442\u043e \u0438 \u0441 \u0440\u0443\u0442\u0440\u0435\u043a\u0435\u0440\u043e\u043c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u043e\u0432.<\/p>\n<p>  \u0410\u0432\u0442\u043e\u0440 \u043d\u0430\u0434\u0435\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u0435 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0437\u0430\u0445\u043e\u0434\u0430 \u043d\u0430 \u0440\u0443\u0442\u0440\u0435\u043a\u0435\u0440 \u0438 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0430\u043b \u0432 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0441\u043d\u0438\u043c\u0430\u044f \u0441\u0432\u0438\u0442\u0435\u0440.<\/p>\n<p>  <a href=\"http:\/\/ruvds.com\/ru-rub?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=ilya&amp;utm_content=mikrotikvpn#order\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/de\/0y\/l-\/de0yl-6ppopvisr_a80b4yuhjj8.png\"><\/a><\/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\/company\/ruvds\/blog\/510038\/\"> https:\/\/habr.com\/ru\/company\/ruvds\/blog\/510038\/<\/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\/company\/ruvds\/blog\/510038\/\"><a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/510038\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8i\/8k\/ve\/8i8kvez0ardik4xqyvt5eey6zom.jpeg\"><\/div>\n<p><\/a><br \/>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Mikrotik, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u0435\u0449\u0451\u043d\u043d\u044b\u0435 \u0441\u0430\u0439\u0442\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 VPN \u0438 \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0442\u0430\u043d\u0446\u0435\u0432 \u0441 \u0431\u0443\u0431\u043d\u0430\u043c\u0438: \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0438 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 VPN \u044f \u0432\u044b\u0431\u0440\u0430\u043b SoftEther: \u043e\u043d \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u043f\u0440\u043e\u0441\u0442 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u0430\u043a \u0438 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/505824\/\">RRAS<\/a> \u0438 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439. \u041d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 VPN \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u043a\u043b\u044e\u0447\u0438\u043b Secure NAT, \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043d\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b RRAS, \u043d\u043e Mikrotik \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0441 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.\u00a0 \u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f, VPN \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0445 \u0440\u0435\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0432 \u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043b\u043e\u0433\u0435 Mikrotik \u043d\u0435 \u0443\u043c\u0435\u0435\u0442.<\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 RB3011UiAS-RM \u043d\u0430 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 6.46.11.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u0447\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c.  <\/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-306775","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306775","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=306775"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306775\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}