frp入门

frp入门

Tags
frp
Published
October 20, 2022
Author
evilgaoshu
简介

一、是什么

简单、高效的内网穿透工具
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
frp 采用 C/S 模式,将服务端部署在具有公网 IP 的机器上,客户端部署在内网或防火墙内的机器上,通过访问暴露在服务器上的端口,反向代理到处于内网的服务。 在此基础上,frp 支持 TCP, UDP, HTTP, HTTPS 等多种协议,提供了加密、压缩,身份认证,代理限速,负载均衡等众多能力。

二、安装

下载解压即可

三、基本使用

服务端:
  1. 修改服务端配置文件 frps.ini
[common] bind_port = 7000 # 避免防火墙干扰,加上以下一行 tls_enable = true
 
  1. 后台启动
nohup ./frps -c ./frps.ini &
notion image
 
客户端:
  1. 修改客户端配置文件 frpc.ini
[common] server_addr = x.x.x.x server_port = 7000 # 避免防火墙干扰,加上以下一行 tls_enable = true [tcp] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 11800
 
  1. 后台启动
nohup ./frpc -c ./frpc.ini &
notion image

四、总结

  1. 默认未对客户端进行验证,建议增加验证措施,或限制 7000 端口的访问
  1. 服务器和客户端最好同一版本
  1. 防火墙干扰 frp 通讯的访问,建议加上 tls。防火墙干扰会报错 login to server failed: EOF

五、参考