NowTunnel For Linux/Unix 安装配置说明
NowTunnel纯静态编译,无需环境配置
1. 下载nowtunnel :
文件结构说明 :
| - nowtunnel 主程序文件,执行文件
| - nowtunnel-bash.sh linux运行脚本
| - nowtunnel-wsl.bat windows wsl运行脚本(推荐wsl for Ubuntu)
| - cache 缓存目录
| - log 日志目录
下载说明:
1. 纯静态编译,不需要环境配置,支持 Linux / Windows(WSL) / Docker 等.
2. 部署/运行
# 安装 wget
apt install wget
#yum install wget
# 下载解压 x86_64
wget -qO- https://download.nowtunnel.com/nowtunnel-linux-x86_64.tar.gz | tar -xz -C /usr/local/ && \
chmod +x /usr/local/nowtunnel/nowtunnel && \
chmod +x /usr/local/nowtunnel/nowtunnel-bash.sh && \
chmod 755 /usr/local/nowtunnel/cache && \
chmod 755 /usr/local/nowtunnel/log
# 下载解压 aarch64 arm64
wget -qO- https://download.nowtunnel.com/nowtunnel-linux-aarch64.tar.gz | tar -xz -C /usr/local/ && \
chmod +x /usr/local/nowtunnel/nowtunnel && \
chmod +x /usr/local/nowtunnel/nowtunnel-bash.sh && \
chmod 755 /usr/local/nowtunnel/cache && \
chmod 755 /usr/local/nowtunnel/log
# 运行
/bin/bash /usr/local/nowtunnel/nowtunnel-bash.sh
# 看到以下内容证明软件成功运行
NowTunnel starting. [DATE:2024-08-16 10:48:37, VER:2.1.20, LST:0.0.0.0:9501]
# DATE : 运行时间
# VER : 软件版本
# LST : 客户端管理IP和端口,通过浏览器访问 http://你的主机IP:9501
3. WGD功能
不使用WGD功能可忽略此段
WGD是nowtunnel点对点转发能力 + wireguard + iptables 整合方案,以实现节点间3层路由转发。
功能依赖 wireguard 和 iptables,且 wireguard 内核版本大于>=5.6.
# Centos安装配置
yum install epel-release elrepo-release
yum install yum-plugin-elrepo
yum install ca-certificates iptables-services kmod-wireguard wireguard-tools iproute2
#开启内核转发功能
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.forwarding = 1" >> /etc/sysctl.conf
sysctl -p
# Ubuntu安装配置
sudo apt install ca-certificates iptables wireguard iproute2
#开启内核转发功能
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.forwarding = 1" >> /etc/sysctl.conf
sysctl -p
# Alpine安装配置
apk add ca-certificates iptables wireguard-tools iproute2
#开启内核转发功能
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.forwarding = 1" >> /etc/sysctl.conf
sysctl -p
4. 浏览器打开 http://你的IP:9501 客户端管理
默认帐号/密码 : admin/nowtunnel (建议登录后修改)
此时环境配置完成,进一步配置请浏览 配置管理

附加: 后台运行 (熟悉可跳过)
a. 通过systemd守护运行,适用 Centos7+ / Ubuntu18+ 等
vi /etc/systemd/system/nowtunnel.service
# 开机启动
systemctl enable nowtunnel.service
# 服务启动
systemctl start nowtunnel.service
b. 通过openrc-run守护运行,适用 Alpine 等
vi /etc/init.d/nowtunnel
# 开机启动
rc-update add nowtunnel
# 服务启动
rc-service nowtunnel restart
c. nohup
# 一般放入启动文件中 /etc/rc.local
nohup /bin/bash /usr/local/nowtunnel/nowtunnel-bash.sh > /usr/local/nowtunnel/run.log 2>&1&
# 查看
jobs -l
# 结束
kill -9 进程ID