{"id":584,"date":"2020-12-18T17:24:08","date_gmt":"2020-12-18T09:24:08","guid":{"rendered":"http:\/\/124.244.86.40:8080\/wordpress\/?p=584"},"modified":"2020-12-18T17:24:08","modified_gmt":"2020-12-18T09:24:08","slug":"%e5%9c%a8-debian-linux-%e4%b8%8b%e5%ae%89%e8%a3%9d-zerotier-%e7%b6%b2%e7%b5%a1","status":"publish","type":"post","link":"https:\/\/imuslab.com\/wordpress\/2020\/12\/18\/%e5%9c%a8-debian-linux-%e4%b8%8b%e5%ae%89%e8%a3%9d-zerotier-%e7%b6%b2%e7%b5%a1\/","title":{"rendered":"\u5728 Debian Linux \u4e0b\u5b89\u88dd ZeroTier \u7db2\u7d61"},"content":{"rendered":"\n<p>\u7531\u65bc\u5beb\u6559\u5b78\u592a\u82b1\u6642\u9593\u4e86\u6211\u5c31\u76f4\u63a5\u628a\u9700\u8981\u7684\u6307\u4ee4\u653e\u5230\u4e0b\u9762<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Upgrade and update the apt\nsudo apt-get upgrade\nsudo apt-get update\n\n# Install Git (if you didn't install it yet)\nsudo apt-get install git\n\n#Install Make and build dependencies\nsudo apt-get install make\nsudo apt-get install build-essential\n\n# Clone the source code of the zeroTier client\ncd ~\/\nmkdir build\ncd .\/build\ngit clone https:\/\/github.com\/zerotier\/ZeroTierOne\n\n# Optional: Install screen and run it inside screen so you can disconnect your ssh terminal\nsudo apt-get install screen -y\nscreen\n\n# Start building the ZeroTier Client\ncd .\/ZeroTierOne\nmake\n\n# Optional: If you have screen installed\n(Hold Ctrl A + D to detach the terminal)\n<\/code><\/pre>\n\n\n\n<p>\u7136\u5f8c\u4f60\u5c31\u53ef\u4ee5\u53bb\u5403\u500b\u98ef\u518d\u56de\u4f86\u4e86\u3002\u9019 Make \u5728 Intel \u8655\u7406\u5668\u7684\u96fb\u8166\u4e0a\u4e5f\u884c\u6709\u5920\u4e45\u7684\uff0c\u5982\u679c\u662f Rpi \u4e4b\u985e\u7684 SBC \u5c31\u66f4\u4e0d\u7528\u60f3\u5b83\u6703\u5feb\u4e86\u3002<\/p>\n\n\n\n<p>\u5728\u5b83\u5b8c\u6210\u5efa\u7f6e\u4e4b\u5f8c\uff0c\u4f60\u61c9\u8a72\u6703\u770b\u5230\u985e\u4f3c\u9019\u6a23\u7684\u6a94\u6848\u7d50\u69cb\uff0c\u5982\u679c OK \u7684\u8a71\u5c31\u53ef\u4ee5\u7e7c\u7e8c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"637\" height=\"245\" src=\"http:\/\/124.244.86.40:8080\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-17-15.png\" alt=\"\" class=\"wp-image-585\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-17-15.png 637w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-17-15-300x115.png 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code># Join your network using Network ID\nsudo .\/zerotier-cli join &lt;networkID>\n\n# Test if the compilation is working and setup the network\nsudo zerotier-one -d<\/code><\/pre>\n\n\n\n<p>\u524d\u5f80 ZeroTier \u7684\u7db2\u7ad9\uff0c\u5e6b\u65b0\u51fa\u73fe\u7684\u88dd\u7f6e\u6539\u540d\u548c\u8a2d\u6210 Auth <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"991\" height=\"100\" src=\"http:\/\/124.244.86.40:8080\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-18-35.png\" alt=\"\" class=\"wp-image-586\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-18-35.png 991w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-18-35-300x30.png 300w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-18-35-768x77.png 768w\" sizes=\"auto, (max-width: 991px) 100vw, 991px\" \/><\/figure>\n\n\n\n<p>\u7b49\u4e00\u4e0b\u4e4b\u5f8c\u4ed6\u6703\u986f\u793a DHCP \u6d3e\u767c\u7d66\u9019\u53f0\u88dd\u7f6e\u7684 IP \u5730\u5740\uff0c\u800c\u56de\u53bb Linux \u4e0a\u9762\u4f60\u4f7f\u7528 ifconfig \u61c9\u8a72\u80fd\u770b\u5230\u76f8\u540c\u7684\u5730\u5740<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"994\" height=\"94\" src=\"http:\/\/124.244.86.40:8080\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-19-49.png\" alt=\"\" class=\"wp-image-588\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-19-49.png 994w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-19-49-300x28.png 300w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-19-49-768x73.png 768w\" sizes=\"auto, (max-width: 994px) 100vw, 994px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"144\" src=\"http:\/\/124.244.86.40:8080\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-19-35.png\" alt=\"\" class=\"wp-image-587\" srcset=\"https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-19-35.png 649w, https:\/\/imuslab.com\/wordpress\/wp-content\/uploads\/2020\/12\/2020-12-18_17-19-35-300x67.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/figure>\n\n\n\n<p>\u5982\u679c\u662f\u6b63\u78ba\u7684\u8a71\u53ef\u4ee5\u7e7c\u7e8c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Create a start script for the zerotier daemon\nsudo nano ~\/zerotier.sh\n<\/code><\/pre>\n\n\n\n<p>\u628a\u4e0b\u9762\u7684\u8cc7\u6599\u653e\u9032\u53bb\u7136\u5f8c Save + Exit \uff08\u628a &lt;user_name> \u6539\u6210\u4f60\u73fe\u5728\u5728\u7528\u7684\u4f7f\u7528\u8005\u540d\u7a31\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/sh\nsudo \/home\/&lt;user_name>\/build\/ZeroTierOne\/zerotier-one<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># Add zeroTier to systemctl to start on boot\nsudo nano  \/etc\/systemd\/system\/zerotier.service<\/code><\/pre>\n\n\n\n<p>\u628a\u4e0b\u9762\u7684\u8cc7\u6599\u653e\u9032\u53bb zerotier.service\uff0c\u7136\u5f8c Save + Exit<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=ZeroTier Network Manager\n\n&#91;Install]\nWantedBy=multi-user.target\n\n&#91;Service]\nExecStart=\/bin\/bash \/home\/aroz\/zerotier.sh\nType=simple<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># Enable the service\nsudo systemctl enable zerotier.service\nsudo systemctl start zerotier.service\n\n# Reboot and see if new network pop up afterward\nsudo reboot\n\n#Wait until reboot finish\nsudo ifconfig\n\n#You should see the zeroTier network popup in the list<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7531\u65bc\u5beb\u6559\u5b78\u592a\u82b1\u6642\u9593\u4e86\u6211\u5c31\u76f4\u63a5\u628a\u9700\u8981\u7684\u6307\u4ee4\u653e\u5230\u4e0b\u9762 \u7136\u5f8c\u4f60\u5c31\u53ef\u4ee5\u53bb\u5403\u500b\u98ef\u518d\u56de\u4f86\u4e86\u3002\u9019 Make \u5728 Intel \u8655\u7406\u5668\u7684\u96fb\u8166\u4e0a\u4e5f\u884c\u6709\u5920\u4e45\u7684\uff0c\u5982\u679c\u662f Rpi \u4e4b\u985e\u7684 SBC \u5c31\u66f4\u4e0d\u7528\u60f3\u5b83\u6703\u5feb\u4e86\u3002 \u5728\u5b83\u5b8c\u6210\u5efa\u7f6e\u4e4b\u5f8c\uff0c\u4f60\u61c9\u8a72\u6703\u770b\u5230\u985e\u4f3c\u9019\u6a23\u7684\u6a94\u6848\u7d50\u69cb\uff0c\u5982\u679c OK \u7684\u8a71\u5c31\u53ef\u4ee5\u7e7c\u7e8c\uff1a \u524d\u5f80 ZeroTier \u7684\u7db2\u7ad9\uff0c\u5e6b\u65b0\u51fa\u73fe\u7684\u88dd\u7f6e\u6539\u540d\u548c\u8a2d\u6210 Auth \u7b49\u4e00\u4e0b\u4e4b\u5f8c\u4ed6\u6703\u986f\u793a DHCP \u6d3e\u767c\u7d66\u9019\u53f0\u88dd\u7f6e\u7684 IP \u5730\u5740\uff0c\u800c\u56de\u53bb Linux \u4e0a\u9762\u4f60\u4f7f\u7528 ifconfig \u61c9\u8a72\u80fd\u770b\u5230\u76f8\u540c\u7684\u5730\u5740 \u5982\u679c\u662f\u6b63\u78ba\u7684\u8a71\u53ef\u4ee5\u7e7c\u7e8c\uff1a \u628a\u4e0b\u9762\u7684\u8cc7\u6599\u653e\u9032\u53bb\u7136\u5f8c Save + Exit \uff08\u628a &lt;user_name> \u6539\u6210\u4f60\u73fe\u5728\u5728\u7528\u7684\u4f7f\u7528\u8005\u540d\u7a31\uff09 \u628a\u4e0b\u9762\u7684\u8cc7\u6599\u653e\u9032\u53bb zerotier.service\uff0c\u7136\u5f8c Save + Exit<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-584","post","type-post","status-publish","format-standard","hentry","category-instructions-and-information"],"_links":{"self":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/comments?post=584"}],"version-history":[{"count":1,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/584\/revisions"}],"predecessor-version":[{"id":589,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/posts\/584\/revisions\/589"}],"wp:attachment":[{"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/media?parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/categories?post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/imuslab.com\/wordpress\/wp-json\/wp\/v2\/tags?post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}