Frp下载地址:https://github.com/fatedier/frp/releases
WINDOWS:frp_0.51.1_freebsd_386.tar.gz
Frp分为公网机器、内网机器
公网机器:绑定的是frps
查看需要的配置文件:
[root@yyds frp_0.51.0_linux_386]# ls
frps frps_full.ini frps.ini LICENSE
该配置的文件配置项:
[root@yyds frp_0.51.0_linux_386]# cat frps.ini
[common]
bind_port = 7000
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = adminkill
authentication_method = token
token = passkill123
vhost_http_port = 6001
启动服务节点
[root@yyds frp_0.51.0_linux_386]# ./frps -c frps.ini
2023/07/24 15:44:04 [I] [root.go:204] frps uses config file: frps.ini
2023/07/24 15:44:05 [I] [service.go:206] frps tcp listen on 0.0.0.0:7000
2023/07/24 15:44:05 [I] [service.go:267] http service listen on 0.0.0.0:6001
2023/07/24 15:44:05 [I] [service.go:318] Dashboard listen on 0.0.0.0:7500
2023/07/24 15:44:05 [I] [root.go:213] frps started successfully
内网机器:绑定的是frpc
查看需要的配置文件:
F:\ng_install\frp_0.51.0_windows_386> ls
LICENSE frpc.exe frpc.ini frpc_full.ini
该配置的文件配置项:
[common]
server_addr = 47.113.227.150
authentication_method = token
token = passkill123
server_port = 7000
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 20022
[rdp]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 23389
[http]
type = http
local_port = 6001
remote_port=6001
custom_domains = 47.113.227.150
启动客户端节点
F:\ng_install\frp_0.51.0_windows_386> frpc.exe -c frpc.ini
2023/07/24 15:49:49 [I] [root.go:220] start frpc service for config file [frpc.ini]
2023/07/24 15:49:49 [I] [service.go:301] [f9b1bcb2282777d5] login to server success, get run id [f9b1bcb2282777d5]
2023/07/24 15:49:49 [I] [proxy_manager.go:150] [f9b1bcb2282777d5] proxy added: [ssh rdp http]
2023/07/24 15:49:49 [I] [control.go:172] [f9b1bcb2282777d5] [ssh] start proxy success
2023/07/24 15:49:49 [I] [control.go:172] [f9b1bcb2282777d5] [rdp] start proxy success
2023/07/24 15:49:49 [I] [control.go:172] [f9b1bcb2282777d5] [http] start proxy success
服务端节点会输出:
2023/07/24 15:49:49 [I] [service.go:539] [f9b1bcb2282777d5] client login info: ip [112.48.25.70:49250] version [0.51.0] hostname [] os [windows
] arch [386]
2023/07/24 15:49:49 [I] [tcp.go:81] [f9b1bcb2282777d5] [ssh] tcp proxy listen port [20022]
2023/07/24 15:49:49 [I] [control.go:484] [f9b1bcb2282777d5] new proxy [ssh] type [tcp] success
2023/07/24 15:49:49 [I] [tcp.go:81] [f9b1bcb2282777d5] [rdp] tcp proxy listen port [23389]
2023/07/24 15:49:49 [I] [control.go:484] [f9b1bcb2282777d5] new proxy [rdp] type [tcp] success
2023/07/24 15:49:49 [I] [http.go:110] [f9b1bcb2282777d5] [http] http proxy listen for host [47.113.227.150] location [] group [], routeByHTTPUs
er []
2023/07/24 15:49:49 [I] [control.go:484] [f9b1bcb2282777d5] new proxy [http] type [http] success
客户端断开连接,服务节点输出:
2023/07/24 15:54:02 [I] [control.go:326] [f9b1bcb2282777d5] control writer is closing
2023/07/24 15:54:02 [I] [proxy.go:110] [f9b1bcb2282777d5] [ssh] proxy closing
2023/07/24 15:54:02 [W] [proxy.go:196] [f9b1bcb2282777d5] [ssh] listener is closed: accept tcp [::]:20022: use of closed network connection
2023/07/24 15:54:02 [I] [proxy.go:110] [f9b1bcb2282777d5] [rdp] proxy closing
2023/07/24 15:54:02 [W] [proxy.go:196] [f9b1bcb2282777d5] [rdp] listener is closed: accept tcp [::]:23389: use of closed network connection
2023/07/24 15:54:02 [I] [proxy.go:110] [f9b1bcb2282777d5] [http] proxy closing
2023/07/24 15:54:02 [I] [control.go:415] [f9b1bcb2282777d5] client exit success
标签:24,15,07,49,穿透,Frp,2023,go,内网 From: https://blog.51cto.com/u_11585002/6836088