{"id":554,"date":"2023-05-24T10:51:42","date_gmt":"2023-05-24T02:51:42","guid":{"rendered":"https:\/\/www.tyhlw.org\/?p=554"},"modified":"2023-05-24T10:51:42","modified_gmt":"2023-05-24T02:51:42","slug":"%e7%be%a4%e6%99%96%ef%bc%88nas%ef%bc%89%e5%ae%89%e8%a3%85-zerotier","status":"publish","type":"post","link":"https:\/\/www.tyhlw.org\/?p=554","title":{"rendered":"\u7fa4\u6656\uff08NAS\uff09\u5b89\u88c5 zerotier"},"content":{"rendered":"<h4><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.tyhlw.org\/wp-content\/uploads\/2023\/05\/secure-technology1.webp\" alt=\"\" width=\"900\" height=\"900\" class=\"alignnone size-full wp-image-555 aligncenter\" srcset=\"https:\/\/www.tyhlw.org\/wp-content\/uploads\/2023\/05\/secure-technology1.webp 900w, https:\/\/www.tyhlw.org\/wp-content\/uploads\/2023\/05\/secure-technology1-300x300.webp 300w, https:\/\/www.tyhlw.org\/wp-content\/uploads\/2023\/05\/secure-technology1-150x150.webp 150w, https:\/\/www.tyhlw.org\/wp-content\/uploads\/2023\/05\/secure-technology1-768x768.webp 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/h4>\n<h4><strong>\u7fa4\u6656\u7cfb\u7edf\u662fDSM 6<\/strong><\/h4>\n<p>Synology\u7684DSM 6\u5c06\u4e8e2023\u5e74\u67d0\u4e2a\u65f6\u5019\u8fdb\u5165EOL\u72b6\u6001\u3002\u5728\u6b64\u4e4b\u524d\uff0cZeroTier\u5c06\u652f\u6301DSM 6.2\u7684\u6700\u65b0\u8865\u4e01\u7248\u672c\u3002\u5982\u679c\u60a8\u4f7f\u7528DSM 6\uff0c\u60a8\u53ef\u4ee5\u8df3\u8fc7\u4ee5\u4e0b\u6240\u6709\u6b65\u9aa4\uff0c\u53ea\u9700\uff1a\u4e0b\u8f7dDSM 6\u8f6f\u4ef6\u5305\u3002\u8bf7\u6ce8\u610f\uff0c\u6700\u65b0\u7684\u8f6f\u4ef6\u5305\u5c06\u5728\u5b89\u88c5\u65f6\u5220\u9664\u60a8\u73b0\u6709\u7684\u6807\u8bc6\u3002\u5982\u679c\u60a8\u5e0c\u671b\u4fdd\u7559\u8fd9\u4e9b\u8eab\u4efd\uff0c\u8bf7\u5907\u4efd\u5b83\u4eec\u3002<\/p>\n<h4>\u7fa4\u6656\u7cfb\u7edf\u662fDSM 7<\/h4>\n<p>Synology\u7684DSM 7\u4e0d\u5141\u8bb8\u7b2c\u4e09\u65b9\u5e94\u7528\u7a0b\u5e8f\u4ee5root\u7528\u6237\u8eab\u4efd\u8fd0\u884c\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u73b0\u5728\u5efa\u8bae\u4f7f\u7528Docker\u6765\u8fd0\u884cZeroTier\u3002\u867d\u7136\u4e00\u5f00\u59cb\u8fd9\u6709\u70b9\u4e0d\u65b9\u4fbf\uff0c\u4f46\u4e0d\u53ef\u5426\u8ba4\uff0c\u5728NAS\u4e0a\u8fd0\u884c\u7b2c\u4e09\u65b9\u5e94\u7528\u7a0b\u5e8f\u662f\u4e00\u79cd\u66f4\u5b89\u5168\u7684\u65b9\u5f0f\u3002\u6b64\u914d\u7f6e\u5c06\u5728\u91cd\u65b0\u542f\u52a8\u548cDSM\u5347\u7ea7\u671f\u95f4\u4fdd\u6301\u4e0d\u53d8\u3002<\/p>\n<p>Synology Docker\u8f6f\u4ef6\u5305\u7684GUI\u5145\u5176\u91cf\u662f\u4e0d\u53ef\u9760\u7684\uff0c\u56e0\u6b64\u5efa\u8bae\u901a\u8fc7Docker CLI\u5bf9\u5bb9\u5668\u6267\u884c\u6240\u6709\u64cd\u4f5c\u3002\u5982\u679c\u60a8\u9009\u62e9\u4f7f\u7528GUI\uff0c\u90a3\u4e48\u60a8\u8fd9\u6837\u505a\u5c06\u81ea\u62c5\u98ce\u9669\u3002\u5982\u679c\u60a8\u6709\u4efb\u4f55\u95ee\u9898\u6216\u7591\u95ee\uff0c\u8bf7\u521b\u5efa\u4e00\u4e2a\u7968\u8bc1\uff0c\u6211\u4eec\u5c06\u5c3d\u529b\u63d0\u4f9b\u5e2e\u52a9\u3002<\/p>\n<h4>\u8981\u901a\u8fc7Docker\u8fdb\u884c\u5b89\u88c5\uff0c\u6709\u56db\u4e2a\u6b65\u9aa4\u53ea\u9700\u8981\u6267\u884c\u4e00\u6b21\uff1a<\/h4>\n<p>1\u3001\u6253\u5f00\u4f60NAS\u7684SSH\u670d\u52a1<\/p>\n<p><span>\u00a0 \u00a0 \u00a0ssh user@local-ip<\/span><\/p>\n<p><span>\u00a0 \u00a0 \u00a0sudo -i<\/span><\/p>\n<p>2\u3001\u521b\u5efa\u4e00\u4e2a\u6301\u7eed\u7684TUN<\/p>\n<p><span>echo -e '#!\/bin\/sh -e \\ninsmod \/lib\/modules\/tun.ko' &gt; \/usr\/local\/etc\/rc.d\/tun.sh<\/span><\/p>\n<p><span>chmod a+x \/usr\/local\/etc\/rc.d\/tun.sh<\/span><\/p>\n<p><span>\/usr\/local\/etc\/rc.d\/tun.sh<\/span><\/p>\n<p>3\u3001\u5b89\u88c5 Docker<\/p>\n<p>\u5728\u7fa4\u6656\u5957\u4ef6\u4e2d\u5b89\u88c5 docker<\/p>\n<p>\u5728ssh \u8fd0\u884c\u547d\u4ee4<\/p>\n<p><span>mkdir \/var\/lib\/zerotier-one<\/span><\/p>\n<p>4\u3001\u521b\u5efa\u8bbe\u7f6econtainer<\/p>\n<p>\u628a\u4e0b\u5217\u547d\u4ee4\u90fd\u590d\u5236\u7c98\u8d34\u5728ssh \u547d\u4ee4\u884c\u4e2d\uff0c\u8fd0\u884c<\/p>\n<div class=\"token-line\"><span class=\"token plain\">docker run -d \\<\/span><\/div>\n<div class=\"token-line\"><span class=\"token plain\"> --name zt \\<\/span><\/div>\n<div class=\"token-line\"><span class=\"token plain\"> --restart=always \\<\/span><\/div>\n<div class=\"token-line\"><span class=\"token plain\"> --device=\/dev\/net\/tun \\<\/span><\/div>\n<div class=\"token-line\"><span class=\"token plain\"> --net=host \\<\/span><\/div>\n<div class=\"token-line\"><span class=\"token plain\"> --cap-add=NET_ADMIN \\<\/span><\/div>\n<div class=\"token-line\"><span class=\"token plain\"> --cap-add=SYS_ADMIN \\<\/span><\/div>\n<div class=\"token-line\"><span class=\"token plain\"> -v \/var\/lib\/zerotier-one:\/var\/lib\/zerotier-one zerotier\/zerotier-synology:latest<\/span><\/div>\n<div><\/div>\n<div>\n<h4>\u7528\u6cd5#<\/h4>\n<p>\u6211\u4eec\u7684\u8f6f\u4ef6\u5305\u4ee5\u524d\u7684\u7248\u672c\u5305\u542bGUI\uff0c\u4f46\u73b0\u5728\u5df2\u7ecf\u4e0d\u662f\u8fd9\u6837\u4e86\uff0c\u5b83\u662f\u66f4\u597d\u7684\u3002CLI\u53ef\u4ee5\u6309\u5982\u4e0b\u65b9\u5f0f\u4f7f\u7528\uff1a<\/p>\n<p>\u67e5\u770b\u8282\u70b9\u72b6\u6001<br \/>\ndocker exec -it zt zerotier-cli status<\/p>\n<p>\u52a0\u5165\u4f60\u7684\u7f51\u7edc:<br \/>\ndocker exec -it zt zerotier-cli join \u4f60\u7684\u7f51\u7edcID<\/p>\n<p>\u6388\u6743\u7f51\u7edc\u4e0a\u7684NAS\u3002\u7136\u540e\u67e5\u770b\u7f51\u7edc\u72b6\u6001\uff1a<br \/>\ndocker exec -it zt zerotier-cli listnetworks<\/p>\n<h4>\u5347\u7ea7 ZeroTie<\/h4>\n<p>\u8981\u5347\u7ea7ZeroTier\uff0c\u60a8\u9700\u8981\u505c\u6b62\u5e76\u5220\u9664\u5bb9\u5668\uff0c\u7136\u540e\u63d0\u53d6\u6700\u65b0\u5bb9\u5668\u5e76\u542f\u52a8\u65b0\u5bb9\u5668\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p><span>docker ps<\/span><\/p>\n<\/div>\n<div>\n<p>\u8f93\u51faCONTAINER ID\u00a0 \u00a0IMAGE\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 COMMAND\u00a0 \u00a0 CREATED\u00a0 \u00a0 \u00a0 STATUS\u00a0 \u00a0 PORTS\u00a0 \u00a0 \u00a0NAMES<\/p>\n<div class=\"codeBlockContainer_K1bP\">\n<div class=\"codeBlockContent_hGly\">\n<div class=\"prism-code language-undefined codeBlock_23N8 thin-scrollbar\" tabindex=\"0\">\n<div class=\"codeBlockLines_39YC\">\n<div class=\"token-line\"><span class=\"token plain\"><span style=\"color: #993300;\">52c7cb58a1dd\u00a0<\/span> \u00a0zerotier\/zerotier-synology:latest \"zerotier-one\" 5 weeks ago Up 9 days<\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div>\u505c\u6b62\u5bb9\u5668\u00a0 \u00a0 <strong>docker stop <span style=\"color: #993300;\">52c7cb58a1dd<\/span><\/strong><\/div>\n<div>\u5220\u9664\u5bb9\u5668\u00a0 \u00a0<strong> docker container rm 52c7cb58a1dd<\/strong><\/div>\n<div>Pull\u6700\u65b0\u5bb9\u5668\u00a0 \u00a0<strong><span>docker pull zerotier\/zerotier-synology:latest<\/span><\/strong><\/div>\n<div>\u7136\u540e\u91cd\u65b0\u6267\u884c\u4e0a\u97621-4\u6b65\u3002<\/div>\n<div>\n<div class=\"codeBlockContainer_K1bP\">\n<div class=\"codeBlockContent_hGly\">\n<div class=\"prism-code language-undefined codeBlock_23N8 thin-scrollbar\" tabindex=\"0\">\n<div class=\"codeBlockLines_39YC\">\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7fa4\u6656\u7cfb\u7edf\u662fDSM 6 Synology\u7684DSM 6\u5c06\u4e8e2023\u5e74\u67d0\u4e2a\u65f6\u5019\u8fdb\u5165EOL\u72b6\u6001\u3002\u5728\u6b64\u4e4b\u524d\uff0cZeroTi [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":555,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,10],"tags":[42,35],"class_list":["post-554","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","category-nas","tag-docker","tag-nas"],"views":2191,"_links":{"self":[{"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=\/wp\/v2\/posts\/554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=554"}],"version-history":[{"count":0,"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=\/wp\/v2\/posts\/554\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=\/wp\/v2\/media\/555"}],"wp:attachment":[{"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tyhlw.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}