前言

内网穿透可以很好的将本地服务暴露到互联网中

本地部署

穿透资源放在 E:\装机必备软件\SSSS开发相关\选装99999999999999999999\内网穿透

不能直接复制已有云服务器的frp文件,还是老实用下面

frp_0.46.1_linux_amd64.tar.gz 拷贝到 linux 服务器上 /nwa 下

1
2
cd /nwa
tar -xvf frp_0.46.1_linux_amd64.tar.gz

解压后可以删除 frpc 相关的文件。frps 的都是服务端文件,frpc 的都是客户端文件

1
2
cd frp_0.46.1_linux_amd64
rm -f frpc*

服务端配置

文件 frps.ini

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[common]
#默认端口7000,客户端和服务端通信的端口,可以不用修改
bind_port = 7000
#http服务监听的端口,即frp服务端向外部暴露出去的端口
token=luckyNwa
#frp的web管理控制台的用户名和密码,7500是默认端口,可以通过服务端ip+7500端口登录
dashboard_port = 7500
#frp管理页面的账号密码,随意设置
dashboard_user = admin
dashboard_pwd = 自己填一个密码
#日志
log_file = ./frps.log
#log_level = info
log_max_days = 3

启动 frps 服务端

1
2
3
4
5
6
7
8
9
10
./frps -c ./frps.ini

下面是正常
[root@iZbp1cnztnu129tiwtcmslZ frp_0.46.1_linux_amd64]# ps aux | grep frps
root 29888 0.8 0.8 720192 16892 pts/1 Sl 12:59 0:00 ./frps -c ./frps.ini
root 29927 0.0 0.0 112812 976 pts/1 S+ 13:00 0:00 grep --color=auto frps

kill -9 29888 杀掉进程

nohup ./frps -c ./frps.ini > frps_output.log 2>&1 & 不断执行

端口记得开放7000、7500是web面板

http://ip:7500 访问,关闭shell终端就会退出,重命名文件夹为frp,重新进入

账号:admin

密码:xxx

1
2
cd /nwa/frp
./frps -c ./frps.ini &

客户端配置

解压,留下 4 个文件即可 frpc.exe | frpc.ini | frpc_full.ini | LICENSE

编辑 frpc.ini ,其中这种[] 里的标题不能重复

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
[common]
server_addr = ip
#与服务端通信的端口,与frps.ini文件中的bind_port一致,默认不变
server_port = 7000
token = luckyNwa

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

[ssh-13311]
type = tcp
local_ip = 127.0.0.1
local_port = 13311
remote_port = 13311

[windows-13306]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 13306

[docker-23998]
type = tcp
local_ip = 127.0.0.1
local_port = 23998
remote_port = 23998

[mysql-13307]
type = tcp
local_ip = 192.168.0.109
local_port = 13307
remote_port = 13307

[mysql-13308]
type = tcp
local_ip = 192.168.0.109
local_port = 13308
remote_port = 13308

#xshell-23311 docker-23998 redis-26379
#mysql5.7-23307 mysql8-23308
[range:FTP]
type = tcp
local_port = 20000-30000
remote_port = 20000-30000
local_ip = 127.0.0.1

1w个端口太卡了,上面仅供参考

N100最新

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
[common]
server_addr = ip
#与服务端通信的端口,与frps.ini文件中的bind_port一致,默认不变
server_port = 7000
token = luckyNwa

[Xshell|Xftp-23311]
type = tcp
local_ip = 127.0.0.1
local_port = 23311
remote_port = 23311

[1panel-33333]
type = tcp
local_ip = 127.0.0.1
local_port = 33333
remote_port = 33333

[docker-23998]
type = tcp
local_ip = 127.0.0.1
local_port = 23998
remote_port = 23998

[mysql5.7-23307]
type = tcp
local_ip = 127.0.0.1
local_port = 23307
remote_port = 23307

[mysql8-23308]
type = tcp
local_ip = 127.0.0.1
local_port = 23308
remote_port = 23308

[mysql5.7主-23309]
type = tcp
local_ip = 127.0.0.1
local_port = 23309
remote_port = 23309

[mysql5.7从-23310]
type = tcp
local_ip = 127.0.0.1
local_port = 23310
remote_port = 23310

[redis-26379]
type = tcp
local_ip = 127.0.0.1
local_port = 26379
remote_port = 26379

[maxkb-18080]
type = tcp
local_ip = 127.0.0.1
local_port = 18080
remote_port = 18080

[ollama-11434]
type = tcp
local_ip = 127.0.0.1
local_port = 11434
remote_port = 11434

[minio-9000]
type = tcp
local_ip = 127.0.0.1
local_port = 9000
remote_port = 9000

[minio-9001]
type = tcp
local_ip = 127.0.0.1
local_port = 9001
remote_port = 9001

[kodbox-8787]
type = tcp
local_ip = 127.0.0.1
local_port = 8787
remote_port = 8787

[joplin-22300]
type = tcp
local_ip = 127.0.0.1
local_port = 22300
remote_port = 22300

[NodeExporter-9101]
type = tcp
local_ip = 127.0.0.1
local_port = 9100
remote_port = 9101


[portainer-9209]
type = tcp
local_ip = 127.0.0.1
local_port = 9209
remote_port = 9209

#下面是直接主机跑的

[nacos-8848]
type = tcp
local_ip = 127.0.0.1
local_port = 8848
remote_port = 8848

[xxl-8088]
type = tcp
local_ip = 127.0.0.1
local_port = 8088
remote_port = 8088

[xxl-executor-9999]
type = tcp
local_ip = 127.0.0.1
local_port = 9999
remote_port = 9999

[xxl-executor-8999]
type = tcp
local_ip = 127.0.0.1
local_port = 8999
remote_port = 8999


window配合run_frp.bat,快速启动,关闭小黑窗即关闭

1
2
3
@echo off
cd /d D:\bgsoft\frp
call .\frpc.exe -c frpc.ini

客户端启动命令:

1
.\frpc.exe -c frpc.ini

第三方穿透

https://natapp.cn/tunnel/lists 免费的内网穿透 luckyNwa Nw..

注册完购买免费的 ,再下载它的客户端

E:\other\装机必备软件\SSSS开发相关\natapp_windows_amd64_2_3_9 不用下载,直接复制这个文件夹并启动,或者修改里面的bat

解压,并新建 start.bat脚本,内容那个token再申请那可以找到

1
natapp.exe -authtoken=760fb2fc902fb7f5

双击启动即可看到Online 用来测试各种第三方回调