简介
frp是用go语言开发的内网穿透工具
官网
https://github.com/fatedier/frp
服务端安装
wget https://github.com/fatedier/frp/releases/download/v0.35.1/frp_0.35.1_linux_amd64.tar.gz
tar zxvf frp_0.35.1_linux_amd64.tar.gz
mv frp_0.35.1_linux_amd64 /opt/frp
修改配置文件
vim /opt/frp/frps.ini
[common]
bind_port = 7654
token = 4567
vhost_http_port = 888
#根域名
subdomain_host = wmmzz.com
启动
cd /opt/frp/
nohup ./frps -c frps.ini &
客户端安装
wget https://github.com/fatedier/frp/releases/download/v0.35.1/frp_0.35.1_linux_amd64.tar.gz
tar zxvf frp_0.35.1_linux_amd64.tar.gz
mv frp_0.35.1_linux_amd64 /opt/frp
修改配置文件
vim /opt/frp/frps.ini
[common]
#服务端公网ip
server_addr = 13.161.81.122
server_port = 7654
token = 4567
[web]
# 协议为http(即80端口)
type = http
# 内部映射的IP
local_ip =172.16.1.1
# 内部映射为80端口
local_port = 80
# 二级域名,接服务端根域名,合起来test1.wmmzz.com
subdomain = test1
[web2]
# 协议为http(即80端口)
type = http
# 内部映射的IP
local_ip =172.16.1.1
# 内部映射为80端口
local_port = 80
subdomain = test2
[ssh]
type = tcp
local_ip = 172.16.1.1
local_port = 22
remote_port = 22
启动
cd /opt/frp/
nohup ./frpc -c frpc.ini &
参考文献:
https://blog.csdn.net/kxwinxp/article/details/88428053
https://blog.csdn.net/momoringmok/article/details/104898314/