添加 Ngrok 设置和使用.

Signed-off-by: lion.chan <cy187lion@sina.com>
This commit is contained in:
lion.chan 2022-07-19 21:56:38 +08:00
parent 9120eb9e84
commit 3e122407bb
3 changed files with 50 additions and 11 deletions

View File

@ -0,0 +1,25 @@
# Ngrok 设置和使用
官网和下载地址:<https://dashboard.ngrok.com>
配置文件参考 cpolar
参考 Systemd 文件:
```bash
[Unit]
Description=Ngrok Service
After=syslog.target
After=network.target
[Service]
RestartSec=2s
Type=simple
User=rick
Group=rick
ExecStart=/<path>/<to>/ngrok start -config /<path>/<to>/ngrok.yml tty
Restart=always
[Install]
WantedBy=multi-user.target
```

View File

@ -25,31 +25,43 @@
通过 GitHub Clone ZeroTierOne 源码,然后编译和安装:
$git clone https://github.com/zerotier/ZeroTierOne.git
$git checkout <TAG>
$make
$make install
```bash
git clone https://github.com/zerotier/ZeroTierOne.git
git checkout <TAG>
make
make install
```
启动主程序:
$sudo zerotier-one -d
```bash
sudo zerotier-one -d
```
加入/退出私有网络:
$zerotier-cli join <network id>
$zerotier-cli leave <network id>
```bash
zerotier-cli join <network id>
zerotier-cli leave <network id>
```
查看当前网络连接状况:
$zerotier-cli listnetworks
```bash
zerotier-cli listnetworks
```
开机启动:
$sudo vim /etc/rc.local
```bash
sudo vim /etc/rc.local
```
然后在“exit 0”所在行之前前添加如下代码
zerotier-one -d
```bash
zerotier-one -d
```
之后在命令行里 join 到某网络,如果不调用 leave则下次重启后自动启动 zerotier-one 服务并 join 到之前的网络中去。

View File

@ -2,7 +2,9 @@
开启防火墙后,通过:
netstat -anp | grep zerotier-one
```bash
netstat -anp | grep zerotier-one
```
命令查看到 zerotier-one 的端口占用情况如下: