1. 准备要求
nps-server: https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz
nps-client: https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_client.tar.gz
服务端安装到公网服务器,客户端安装到内网电脑上,在nps配置好,通过公网服务器的IP:端口,把请求转发到内网的电脑上.
2. 在公网服务器安装服务端
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
## 下载服务端
curl https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz
tar -zxvf linux_amd64_server.tar.gz
## 修改服务端配置
vi ./conf/nps.conf
## 代理的http协议端口
#http_proxy_port=7070
#https_proxy_port=8443
## nps客户端连接服务端的端口
bridge_port=8024
## nps自带的web管理界面的账号密码和端口
#web_username=admin
#web_password=123
#web_port = 8080
## 启动服务端
./nps
#后台运行,建议设置开机启动
#nohup /root/nps &
|
3.配置服务端
访问设置的服务器 web_port(8080) 端口,设置中文

添加客户端,客户端就是内网电脑.

记录客户端的 唯一验证密钥.

添加TCP隧道,给内网电脑设置穿透的端口.一个客户端可以映射多个隧道端口.

4.npc客户端连接NPS服务端
1
2
3
4
5
6
7
8
|
curl https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_client.tar.gz
tar -zxvf linux_amd64_client.tar.gz
#./npc -server=公网服务器IP:bridge_port -vkey=web界面中显示的唯一验证密钥
./npc -server=88.88.88.88:8024 -vkey=dsdfsdfsdf
#后台运行,建议设置开机启动
#nohup /root/npc -server=88.88.88.88:8024 -vkey=dsdfsdfsdf &
|