环境准备(公网IP服务器一台 本文使用Ubuntu系统)
一、下载FRP
# Github地址https://github.com/fatedier/frp/releases
选择对应的系统版本

本文使用linux_amd64版本
使用FTP工具上传到服务器
解压缩
tar -zxvf frp_0.37.0_linux_amd64.tar.gz

服务端
# 切换到目录cd frp_0.37.0_linux_amd64/# 服务端配置文件vim frps.ini[common]#设置允许访问的ipbind_addr = 0.0.0.0#服务端和客户端连接的端口bind_port = 8000#KCP协议在弱网环境下传输效率提升明显,但是对frps会有一些额外的流量消耗kcp_bind_port = 8000# 控制台端口dashboard_port = 8001#用户名 和密码dashboard_user = admindashboard_pwd = 123456#服务端信仰访问的端口 httpvhost_http_port = 7075#vhost_https_port = 444log_file = ./frps.loglog_level = infolog_max_days = 3#token 密码token = 123456#allow_ports = 1-65535max_pool_count=50tcp_mux = true


#启动后台运行命令nohup ./frps -c ./frps.ini &
客户端
# 切换到目录cd frp_0.37.0_linux_amd64/# 服务端配置文件vim frpc.ini[common]server_addr = 39.103.193.55 #公网IPserver_port =8000 #服务端端口号 一致token = 123456 #与服务端token 一致#log_file = frpc.loglog_level = infolog_max_days = 7dashboard_user = admin #与服务端用户名 一致dashboard_pwd = 123456 #与服务端密码 一致# 本地 ssh 映射[ssh]type = tcplocal_ip = 127.0.0.1local_port = 22 # 本地端口remote_port = 3386 # 公网的3386端口[mysql]type = tcplocal_ip = 127.0.0.1local_port = 3306 # 本地端口remote_port = 3036 # 公网端口[oracle]type = tcplocal_ip = 192.168.127.10 #本地Oracle监听IPlocal_port = 1521 #本地Oracle监听端口remote_port = 1551 # 公网端口

# 启动后台运行nohup ./frpc -c ./frpc.ini &

访问服务器ip加端口
http://公网ip:控制台端口

