更改

跳转至: 导航搜索

Orange Pi 5 Plus

添加456字节, 2023年5月31日 (三) 17:47
zerotier使用说明
== zerotier使用说明 ==
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''OpenWRT系统已经预装了zerotier客户端,在zerotier官网创建虚拟局域网后,在客户端可以通过Network ID直接加入其中,具体操作如下文所示。'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>下面自动分配地址这里可以自己选择网段,此处选择的是172.27.*.*</p>
<p>[[File:media/image603.png|374x233px]]</p></li>
<li><p>在OpenWRT终端输入下面命令就可以加入到上面创建的虚拟局域网,'''<span style="color:#FF0000">其中8286ac0e47d53bb5是上面创建的虚拟局域网的Network ID</span>'''</p></li></ol>{| class="wikitable" style="width:800px;" |-|
root@OpenWrt:/# '''zerotier-one -d''' #启动zerotier客户端
root@OpenWrt:/# '''zerotier-cli join 8286ac0e47d53bb5''' #加入网络
|}</li></ol>
<ol start="5" style="list-style-type: decimal;">
<li>在终端输入ifconfig可以看到已经有个新增的'''ztks54inm2'''设备,IP地址为'''172.27.214.213'''</li></ol>{| class="wikitable" style="width:800px;" |-|
root@OpenWrt:/# '''ifconfig'''
'''ztks54inm2''' Link encap:Ethernet HWaddr F6:4E:DE:BF:D8:52
::inet addr:'''172.27.214.213''' Bcast:172.27.255.255 Mask:255.255.0.0
::inet6 addr: fe80::e82f:d0ff:fe5a:867e/64 Scope:Link
::UP BROADCAST RUNNING MULTICAST MTU:2800 Metric:1
::RX packets:18 errors:0 dropped:0 overruns:0 frame:0
::TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
::collisions:0 txqueuelen:1000
::RX bytes:1720 (1.6 KiB) TX byte81 (8.2 KiB)|}</li></ol>
<ol start="6" style="list-style-type: decimal;">
<li>在另一台设备上安装zerotier客户端(此处以Ubuntu18.04为例),执行下面命令进行安装,安装完成后需要重启电脑</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
test@ubuntu:~$ '''curl -s https://install.zerotier.com | sudo bash'''
|}</li></ol>
<ol start="7" style="list-style-type: decimal;">
<li>重启后根据Network ID加入虚拟局域网,也可以看到已经获取到zerotier分配的ip地址,此时该Ubuntu PC和OrangePi R1 Plus LTS处于同一局域网中,两者可以自由通信</li></ol>{| class="wikitable" style="width:800px;" |-|
test@ubuntu:~$ '''sudo zerotier-cli join 8286ac0e47d53bb5'''
'''ztks54inm2''': flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt; mtu 2800
::inet '''172.27.47.214''' netmask 255.255.0.0 broadcast 172.27.255.255
::inet6 fe80::5ce1:85ff:fe2b:6918 prefixlen 64 scopeid 0x20&lt;link&gt;
::ether f6:fd:87:68:12:cf txqueuelen 1000 (以太网)
::RX packets 0 bytes 0 (0.0 B)
::RX errors 0 dropped 0 overruns 0 frame 0
::TX packets 46 bytes 10006 (10.0 KB)
::TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0|}</li></ol>
<ol start="8" style="list-style-type: decimal;">
<li>测试两个终端是否可以通信</li></ol>{| class="wikitable" style="width:800px;" |-|
root@OpenWrt:/# '''ping 172.27.47.214 -I ztks54inm2'''
round-trip min/avg/max = 1.136/1.195/1.235 ms
|}
</ol>
<ol start="9" style="list-style-type: decimal;">
<li>zerotier其他常用命令</li></ol>{| class="wikitable" style="width:800px;" |-|
root@OpenWrt:/# '''zerotier-one -d''' #启动zerotier客户端
OPENWRT_RELEASE=&quot;OpenWrt 22.03.4 r20123-38ccc47687&quot;
|}
</ol>
<span id="openwrt源码的编译方法"></span>
8,460
个编辑

导航菜单