From 3e122407bb5bb764d194e27be2a669f45c58746f Mon Sep 17 00:00:00 2001 From: "lion.chan" Date: Tue, 19 Jul 2022 21:56:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Ngrok=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=92=8C=E4=BD=BF=E7=94=A8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lion.chan --- .../Applications/Ngrok/Ngrok_设置和使用.md | 25 +++++++++++++++ .../ZerotierOne/ZerotierOne_的安装与使用.md | 32 +++++++++++++------ .../ZerotierOne/ZerotierOne_端口占用.md | 4 ++- 3 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 Software/Applications/Ngrok/Ngrok_设置和使用.md diff --git a/Software/Applications/Ngrok/Ngrok_设置和使用.md b/Software/Applications/Ngrok/Ngrok_设置和使用.md new file mode 100644 index 0000000..62f22f2 --- /dev/null +++ b/Software/Applications/Ngrok/Ngrok_设置和使用.md @@ -0,0 +1,25 @@ +# Ngrok 设置和使用 + +官网和下载地址: + +配置文件参考 cpolar + +参考 Systemd 文件: + +```bash +[Unit] +Description=Ngrok Service +After=syslog.target +After=network.target + +[Service] +RestartSec=2s +Type=simple +User=rick +Group=rick +ExecStart=///ngrok start -config ///ngrok.yml tty +Restart=always + +[Install] +WantedBy=multi-user.target +``` diff --git a/Software/Applications/ZerotierOne/ZerotierOne_的安装与使用.md b/Software/Applications/ZerotierOne/ZerotierOne_的安装与使用.md index 6ed5c12..10028c6 100644 --- a/Software/Applications/ZerotierOne/ZerotierOne_的安装与使用.md +++ b/Software/Applications/ZerotierOne/ZerotierOne_的安装与使用.md @@ -25,31 +25,43 @@ 通过 GitHub Clone ZeroTierOne 源码,然后编译和安装: - $git clone https://github.com/zerotier/ZeroTierOne.git - $git checkout - $make - $make install +```bash +git clone https://github.com/zerotier/ZeroTierOne.git +git checkout +make +make install +``` 启动主程序: - $sudo zerotier-one -d +```bash +sudo zerotier-one -d +``` 加入/退出私有网络: - $zerotier-cli join - $zerotier-cli leave +```bash +zerotier-cli join +zerotier-cli leave +``` 查看当前网络连接状况: - $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 到之前的网络中去。 diff --git a/Software/Applications/ZerotierOne/ZerotierOne_端口占用.md b/Software/Applications/ZerotierOne/ZerotierOne_端口占用.md index 6488019..903208b 100644 --- a/Software/Applications/ZerotierOne/ZerotierOne_端口占用.md +++ b/Software/Applications/ZerotierOne/ZerotierOne_端口占用.md @@ -2,7 +2,9 @@ 开启防火墙后,通过: - netstat -anp | grep zerotier-one +```bash +netstat -anp | grep zerotier-one +``` 命令查看到 zerotier-one 的端口占用情况如下: