搭建内网穿透
文章目录
- 摘要
- nps
- frp
- 服务提供商
摘要
内网穿透是一种方便的技术,可以让用户随时随地访问内网设备。有两种方式可以使用内网穿透:自己搭建,使用nps/frps软件;购买服务,快速享受内网穿透带来的便利。
nps
内网穿透。参考几款实用的内网穿透工具,推荐,选择使用nps-README。除了README,其他的参考搭建nps内网穿透服务。
# 服务端
wget https://github.com/ehang-io/nps/releases/download/v0.26.9/linux_amd64_server.tar.gz
mkdir nps
tar -zxvf linux_amd64_server.tar.gz -C npssudo ./nps install
......
You can start with:
nps start|stop|restart|uninstall|update or nps-update update
anywhere!sudo nps start## 放行端口
ufw allow 8080 # 后台web控制端口
ufw allow 8024 # 提供穿透服务端口
## 类似的放行其他端口## 卸载
sudo ./nps stop
sudo ./nps uninstall
ps -aux | grep nps # 查看此时进程是否存在
# ss -tnlp | grep nps # 查看进程占用的端口号# 客户端
wget https://github.com/ehang-io/nps/releases/download/v0.26.9/linux_amd64_client.tar.g
mkdir npc
tar -zxvf linux_amd64_client.tar.gz -C npc./npc --help
frp
-
服务端下载。
# 服务端 wget https://github.com/fatedier/frp/releases/download/v0.47.0/frp_0.47.0_linux_amd64.tar.gz tar -zxvf frp_0.47.0_linux_amd64.tar.gz cd frp_0.47.0_linux_amd64 ./frps --help
-
使用 systemd | frp,这样启动和后台运行会方便很多。初始配置参考:通过 SSH 访问内网机器 | frp
-
使用Web 界面 | frp,便于查看连接信息。
-
安全起见,必须使用身份认证 | frp。简单起见,使用密码生成器 随机数/密码生成 在线生成随机密码 iP138在线工具生成一个token就好。
-
我暂时不需要安装对应frpc。在openwrt安装frpc和luci-app-frpc,luci-i18n-frpc-zh-cn。
服务提供商
如果熟悉计算机操作,并且有自己服务器,我推荐上面的操作。
但是,这个年头,花钱可以省事。让服务提供商来摆平这些麻烦的事情,用户可以快速使用内容穿透。如:
- ddnsto:远程控制专家,一个浏览器让你回到内网。