{"id":284712,"date":"2017-04-10T14:50:02","date_gmt":"2017-04-10T10:50:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=284712"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=284712","title":{"rendered":"Mikrotik 6to4 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u043c IPv4"},"content":{"rendered":"<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0442\u0435\u043c, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u044c IPv6 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 6to4, \u043d\u043e \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 IPv4.<\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>Mikrotik IPv6<\/h2>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 6to4 \u0448\u043b\u044e\u0437, \u043f\u0438\u043d\u0433\u0443\u0435\u043c \u0435\u0433\u043e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443: 192.88.99.1<br \/>  \u0415\u0441\u043b\u0438 \u043f\u0438\u043d\u0433 \u0438\u0434\u0435\u0442, \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<br \/>  \u0418 \u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 IPv6 (\u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c Extra packages \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 <a href=\"http:\/\/www.mikrotik.com\/download\">http:\/\/www.mikrotik.com\/download<\/a>). \u0418\u0437 \u0430\u0440\u0445\u0438\u0432\u0430 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c ipv6-*.npk \u0438 \u0437\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440, \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 IPv6, \u0443\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 firewall \u0434\u043b\u044f \u043d\u0435\u0451 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 6to4<\/h3>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u00ab6to4 Tunnel\u00bb, \u0432 Remote Adress \u0441\u0442\u0430\u0432\u0438\u043c \u0430\u0434\u0440\u0435\u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0448\u043b\u044e\u0437\u0430, \u0432 Local Adress \u043d\u0430\u0448 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 IPv4 \u0430\u0434\u0440\u0435\u0441.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0435\u0441\u0442\u044c \u043b\u0438 \u043f\u0438\u043d\u0433 \u0434\u043e \u0447\u0435\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 IPv6 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 ipv6.google.com)<br \/>  \u0415\u0441\u043b\u0438 \u043f\u0438\u043d\u0433\u0438 \u0435\u0441\u0442\u044c, \u0442\u043e \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u0435\u0435:<\/p>\n<h3>\u0421\u043a\u0440\u0438\u043f\u0442 \u0430\u0432\u0442\u043e\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">##############Script Settings##################  :local EXTif &quot;ext&quot; :local TUNif &quot;6to4tun&quot; :local LOCif &quot;local&quot; ###############################################  :local EXTipv4 [\/ip address get [find interface=$EXTif] address]; :local TUNipv4 [\/interface 6to4 get [find name=$TUNif] local-address];  :for i from=( [:len $EXTipv4] - 1) to=0 do={  \t:if ( [:pick $EXTipv4 $i] = &quot;\/&quot;) do={  \t\t:set $EXTipv4 ([:pick $EXTipv4 0 $i]); \t} }  :global dec2hex do={ \t:local hex &quot;&quot; \t:local dec [:tonum $1] \t:for i from=0 to=4 step=4 do={ \t\t:set hex ([:pick &quot;0123456789ABCDEF&quot; (($dec&gt;&gt;$i)&0xf) ((($dec&gt;&gt;$i)&0xf)+1)].$hex) \t} \t:return ([:tostr $hex]) } :local 6to4prefix do={ \t:global dec2hex \t:local oct \t:local ipv6 &quot;2002:&quot; \t:local tmp 0 \t:local c 0 \t:local ipv4 $1 \t:for i from=0 to=( [:len $ipv4] - 1) do={  \t\t:if ( [:pick $ipv4 $i] = &quot;.&quot; || [:pick $ipv4 $i] = &quot;\/&quot;) do={  \t\t\t:set oct ([:pick $ipv4 $tmp $i]) \t\t\t:set tmp ($i+1) \t\t\t:set ipv6 (&quot;$ipv6&quot;.[$dec2hex $oct]) \t\t\t:if ( c =1 || c =3) do={  \t\t\t\t:set ipv6 (&quot;$ipv6&quot;.&quot;:&quot;) \t\t\t} \t\t\t:set c (c+1) \t\t} \t} \t:return ($ipv6) } :if ( $TUNipv4 != $EXTipv4 ) do={ \t\/interface 6to4 set [find name=$TUNif] local-address=$EXTipv4 \t\/ipv6 address remove  [find interface=$TUNif] \t\/ipv6 address remove  [find interface=$LOCif] \t:local ipv6new [$6to4prefix ($EXTipv4.&quot;\/&quot;)] \t:log info ($ipv6new) \t\/ipv6 address add interface=$TUNif advertise=no address=(&quot;$ipv6new&quot;.&quot;:1\/48&quot;) \t\/ipv6 address add interface=$LOCif advertise=yes address=(&quot;$ipv6new&quot;.&quot;:1\/64&quot;) } <\/code><\/pre>\n<p>  \u0412 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c:  <\/p>\n<ul>\n<li>EXTif \u2014 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/li>\n<li>TUNif \u2014 \u0442\u0443\u043d\u043d\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/li>\n<li>LOCif \u2014 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/li>\n<\/ul>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0441\u043a\u0440\u0438\u043f\u0442, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c \/64.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a (\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043a\u0430\u0436\u0434\u044b\u0435 5 \u043c\u0438\u043d\u0443\u0442), \u0438 \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e IPv4, \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 6to4 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d.<\/p>\n<h3>\u041a\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0441 \u0436\u0434\u0443\u0442?<\/h3>\n<p>  \u041a\u043b\u0438\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 IPv6 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SLAAC, \u0438 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0434\u0430\u0442\u044c DNS \u0438 \u0448\u043b\u044e\u0437. \u0412 Mikrotik \u0435\u0441\u0442\u044c DHCPv6, \u043d\u043e \u0442\u043e\u043b\u043a\u0443 \u043e\u0442 \u043d\u0435\u0433\u043e \u0435\u0449\u0451 \u043c\u0430\u043b\u043e (\u043d\u0435 \u0434\u043e\u0434\u0435\u043b\u0430\u043d \u043e\u043d \u0432 \u043f\u043e\u043b\u043d\u043e\u0439 \u043c\u0435\u0440\u0435).<br \/>  \u0414\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 DNS \u0432 \u0441\u0430\u043c\u043e\u043c Mikrotik \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 2620:0:ccc::2 \u0438 2620:0:ccd::2), \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c link local \u0430\u0434\u0440\u0435\u0441 Mikrotik.<br \/> \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\/326076\/\"> https:\/\/habrahabr.ru\/post\/326076\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0442\u0435\u043c, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u044c IPv6 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 6to4, \u043d\u043e \u0438\u043c\u0435\u044e\u0449\u0435\u0433\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 IPv4.<\/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-284712","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/284712","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=284712"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/284712\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=284712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=284712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=284712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}