frp内网穿透

下载

github主页:https://github.com/fatedier/frp/blob/master/README_zh.md

服务端配置

服务端指的是有公网IP的机器

frps.ini

[common]
bind_port = 7000

# 启用内网应用穿透
vhost_http_port = 8080

# set dashboard_addr and dashboard_port to view dashboard of frps
# dashboard_addr's default value is same with bind_addr
# dashboard is available only if dashboard_port is set
dashboard_addr = 0.0.0.0
dashboard_port = 7500

# dashboard user and passwd for basic auth protect, if not set, both default value is admin
dashboard_user = admin
dashboard_pwd = admin

# dashboard assets directory(only for debug mode)
# assets_dir = ./static
# console or real logFile path like ./frps.log
log_file = ./frps.log

# trace, debug, info, warn, error
log_level = info

log_max_days = 3

# disable log colors when log_file is console, default is false
disable_log_color = false

启动 nohup ./frps -c frps.ini &

客户端配置

客户端指的内网机器,暴露服务的机器

frpc.ini

[common]
server_addr = *.*.*.*  ## 此处填写服务端地址
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

[web]
type = http
local_port = 8080  ## 本地服务所在的端口
#remote_port = 10005
custom_domains = *.*.*.* ## 此处填写服务端地址

总结

** 服务端转发所有客户端流量 ** 一个客户端服务对应一个端口