当前位置:网站首页>frp:开源内网穿透工具
frp:开源内网穿透工具
2022-08-03 07:30:00 【木尧大兄弟】
前言
frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。
官网GitHub:https://github.com/fatedier/frp
官网文档:https://gofrp.org/docs/
下载与安装
安装包:https://github.com/fatedier/frp/releases
以Ubuntu为例,执行命令下载:
wget https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_linux_amd64.tar.gz
执行命令解压:
tar -zxvf frp_0.44.0_linux_amd64.tar.gz
客户端(公网IP设备):保留文件 frps 和 frps.ini
服务端(局域网设备):保留文件 frpc 和 frpc.ini
服务端配置
[common]
bind_port = 8888
token = this_is_your_token
dashboard_port = 10000
dashboard_user = username
dashboard_pwd = password
vhost_http_port = 12888
配置完成后,服务端完成了这些事情:
- 配置了 frp 服务监听端口 8888
- 配置了访问秘钥为 “this_is_your_token”
- 配置了 dashboard 的 port、用户名、密码,访问公网IP:10000,输入用户名密码即可登陆后台
- 配置了监听 12888 端口代理 http 请求
快速启动服务端,执行:
./frps -c ./frps.ini
更多配置,详见:https://gofrp.org/docs/reference/server-configures/
客户端配置
[common]
# 公网IP和服务端监听端口,以及连接秘钥
server_addr = 188.188.188.188
server_port = 8888
token = this_is_your_token
[ssh_local]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 10099
[static_file]
type = tcp
remote_port = 11099
plugin = static_file
# 要对外暴露的文件目录
plugin_local_path = /home/xxxx/xxx/share
# 用户访问 URL 中会被去除的前缀,保留的内容即为要访问的文件路径
plugin_strip_prefix = static
plugin_http_user = uuuuuuusername
plugin_http_passwd = ppppppppassword
[web_01]
type = http
local_port = 12888
custom_domains = www.fuck.cn
配置完成后,服务端完成了这些事情:
- common:把服务端的IP、监听端口告诉客户端,然后配置好秘钥以顺利连接
- ssh_local:ssh连接,访问公网IP:10099 即可转发到内网机器22端口
- static_file:公开文件,访问公网IP:11099 输入user和password就可访问共享文件
- web_01:http映射,访问www.fuck.cn:12888 即可发起内网IP:12888 的HTTP请求
快速启动客户端,执行:
./frpc -c ./frpc.ini
注意:应配置防火墙放通上述端口。
开机自启
使用 systemd 来控制 frps,需要先安装 systemd,然后在 /etc/systemd/system 目录下创建一个 frps.service 文件,写入以下内容:
[Unit]
# 服务名称,可自定义
Description = frp server
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /path/to/frps -c /path/to/frps.ini
[Install]
WantedBy = multi-user.target
管理frp服务:
# 启动frp
systemctl start frps
# 停止frp
systemctl stop frps
# 重启frp
systemctl restart frps
# 查看frp状态
systemctl status frps
配置 frps 开机自启:
systemctl enable frps
边栏推荐
- 【图像去雾】基于matlab暗通道和非均值滤波图像去雾【含Matlab源码 2011期】
- 华为设备配置BFD单跳检测二层链路
- 如何在安装GBase 8c数据库的时候,报错显示“Host ips belong to different cluster?
- Nanny level explains Transformer
- Pyspark - an empty string is replaced by None
- WordPress主题-B2美化通用子主题商业运营版
- 分治法求解中位数
- PostMan使用,访问路径@RequestMapping
- DSP-ADAU1452输出通道配置
- pgaudit 的安装使用《postgresql》
猜你喜欢

实时目标检测新高地之#YOLOv7#更快更强的目标检测器

Roson的Qt之旅#104 QML Image控件

Detailed explanation of cause and effect diagram of test case design method

“碳中和”愿景下,什么样的数据中心才是我们需要的?

2022年 SQL 优化大全总结详解

pyspark---encode the suuid interval (based on the number of exposures and clicks)

mysql备份时的快照原理

jolt语法

CDGA|如何加强数字政府建设?

Roson的Qt之旅#105 QML Image引用大尺寸图片
随机推荐
安全狗云原生安全能力全面亮相全球数字经济大会暨ISC互联网安全大会
Data warehouse buried point system and attribution practice
DSP Trick:向量长度估算
Qt5开发从入门到精通——第二篇(控件篇)
pgaudit 的安装使用《postgresql》
最佳高质量字体
mysql5.7服务器The innodb_system data file 'ibdata1' must be writable导致无法启动服务器
mysqlbinlog: unknown variable 'default-character-set=utf8'
The ORB - SLAM2 extracting feature points
rust 学习笔记
mysql的innodb存储引擎和myisam存储引擎的区别
tmp
Poke the myth of Web3?Poke the iron plate.
标准输入流
postman将接口返回结果生成json文件到本地
SSM整合流程
sqlserver2019安装失败
Daily practice of PMP | Do not get lost in the exam-8.2 (including agility + multiple choice)
22-08-02 西安 尚医通(02)Vscode、ES6、nodejs、npm、Bable转码器
如何让背景色在任何设备宽高都能填充整个屏幕