🧑‍🏫
liualexiang
  • Introduction
  • Azure
    • AKS Basic
    • AKS Spark
    • AZ ACR SYNC
    • Azure CMI SDWAN
    • Azure LB DeepDive
      • Azure LB DeepDive
    • Azure Service Principal Basic
    • Azure Internal VM Network Connectivity
      • Azure Internal VM Network Connectivity
    • Azure Cli Build
    • Azure Vm Memory Monitor
  • Blockchain
    • BTC
  • CRISPR
    • 使用Parallel_Cluster提升CRISPA效率
  • OpenSource
    • ElasticSearch
      • ES Get Started
      • ES Search Query
      • Kibana 可视化
      • Logstash配置
    • Ansible 基础
    • Infra As Code
      • Pulumi Get Started
      • Terraform Basic
    • ZooKeeper 基础
    • RPC与REST
    • 使用Python申请大量内存测试
    • 使用TPC_DS产生压测数据
    • Superset
      • Superset部署手册
    • 代码扫描
    • Git
      • Git Basic
      • Github Action Basic
      • Gitlab与AzureAD集成
      • Gitbook 基础教程
    • K8S
      • enter_node
      • K8s X509 Client Cert
      • K8s Basic
      • K8s Oidc
      • Docker 基础
      • helm基础
      • K8S_Secrets管理
      • 深入了解K8S
      • 混沌工程
      • Istio
      • 生态
      • CRD开发
      • k8s网络
    • Cloud_Custodian
    • Jenkins Basic
    • Nginx
    • ETCD
    • 正则
    • VictoriaMetrics
    • Kafka
  • MySQL
    • MySQL 调优
  • Linux
    • SSH Tunnel 上网
    • 内存管理
    • 在Linux系统中通过LUKS加密磁盘
    • 量子计算 Basic
    • IO多路复用
    • Iptables
    • tmux和screen
    • Systemd
    • OS 基础
    • jq基础
    • yum
    • neovim
  • Web
    • Html Css
    • Web部署
    • 缓存
  • Programming
    • 算法
      • 返回list中最大生序子序列长度
    • Python技巧
      • Python的语法糖
      • Python常用装饰器
      • AsyncIO基础
      • 自动化测试pytest
      • python中的下划线
      • 面向对象
      • Python的坑
      • Python配置文件管理
      • HTTP Stream Response
      • Python项目管理
    • 设计模式
      • 设计模式
      • 面向对象的思想
      • 编程概念
    • Go
      • Go 基础
      • Go常用功能
      • 结构体入门
    • 前端
    • Vue
    • NodeJS
  • Math
    • 多项式插值法
  • Security
    • HTTP常见攻击
    • 加密与签名
    • RSA
    • ECDSA
  • Solidity
    • Solidity基础
    • Blockchain Testnet Faucet
  • Tools
    • 视频处理ffmpeg
    • IDE配置
    • iTerm2美化
    • 密码管理
    • FRP配置
    • 工具集
由 GitBook 提供支持
在本页
  • 简介
  • 架构
  • 配置
  1. Tools

FRP配置

上一页密码管理下一页工具集

最后更新于1年前

简介

FRP是一个反向代理软件,文档。不仅仅支持 tcp,udp的代理,还支持 HTTP等协议。使用frp建立了一个tcp隧道之后,可以在这个隧道里,转发任意端口的流量

架构

如下图所示,如果想要让user account里的用户,访问 service account的数据库的3306端口,那么可以在user account里部署一个 frp server,监听到 7002端口,service account里部署 frp client,连到 frp server的7002端口,同时 service account里的 frpc 配置里,需要指明 remote_port为6007,转发的本地port是 rds的3306。这样frp server那一侧的服务,会自动监听到 frp server这台机器的6007端口。user account得用户,直接连 frp server的6007,实际流量就会转发到 service account 的 rds 3306

配置

frp server 的配置,只需要启动 frps 的进程,配置到 frps.ini 文件里即可

[common]
bind_port = 7002
authentication_method = token
authenticate_heartbeats = true
authenticate_new_work_conns = true
token = ANY_PLAIN_TEXT
log_file = /opt/frp/frps.log
log_level = info
log_max_days = 30

frp client的配置,只需要启动 frpc 的进程,配置到 frpc.ini 里即可

[common]
server_addr = FRP_SERVER_ADDRESS
server_port = 7002
authentication_method = token
authenticate_heartbeats = true
authenticate_new_work_conns = true
token = THE_FRP_SERVER_TOKEN
log_file = /opt/frp/frpc.log
log_level = info
log_max_days = 30

[db_biz_account]
type = tcp
local_ip = RDS_DNS_ADDR
local_port = 3306
remote_port = 6007
地址
image-20230625105922390