1、Frp 架构
Frp 文档:https://github.com/fatedier/frp/blob/master/README_zh.md
Frp Release:https://github.com/fatedier/frp/releases
2、下载与解压
wget tar -zxvf frp_0.25.2_linux_amd64.tar.gz
3、配置说明:(具体说明,查看Frp 文档)
3.1 服务端配置文件 frps
和frps.ini
[common] bind_port = 7000 #与客户端绑定的进行通信的端口 vhost_http_port = 80 #访问客户端web服务自定义的端口号 vhost_https_port = 443
3.2 客户端配置文件 frpc
和frpc.ini
[common] server_addr = 192.168.1.200 #公网服务器ip server_port = 7000 #与服务端bind_port一致 #公网通过ssh访问内部服务器 [ssh] type = tcp #连接协议 local_ip = 192.168.1.100 #内网服务器ip local_port = 22 #ssh默认端口号 remote_port = 6000 #自定义的访问内部ssh端口号 #公网访问内部web服务器以http方式 [web] type = http #访问协议 local_port = 8081 #内网web服务的端口号 custom_domains = frp.qgstu.com #所绑定的公网服务器域名,一级、二级域名都可以
4、服务启动
4.1 服务端启动
./frps -c frps.ini nohup ./frps -c frps.ini &
4.2 客户端启动
./frpc -c frpc.ini nohup ./frpc -c frpc.ini &