frp 内网穿透工具设置

简介:

下载地址:https://github.com/fatedier/frp/releases

参考地址:https://github.com/fatedier/frp/blob/master/README_zh.md

服务端配置

# [common] is integral section

[common]

# A literal address or host name for IPv6 must be enclosed

# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"

bind_addr = 0.0.0.0

bind_port = 7000


# if you want to support virtual host, you must set the http port for listening (optional)

vhost_http_port = 8080

vhost_https_port = 443


# if you want to configure or reload frps by dashboard, dashboard_port must be set

dashboard_port = 7500


# dashboard user and pwd 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


# debug, info, warn, error

log_level = info


log_max_days = 3


# if you enable privilege mode, frpc can create a proxy without pre-configure in frps when privilege_token is correct

privilege_mode = true

privilege_token = 12345678


# heartbeat configure, it's not recommended to modify the default value

# the default value of heartbeat_timeout is 30

# heartbeat_timeout = 30


# only allow frpc to bind ports you list, if you set nothing, there won't be any limit

privilege_allow_ports = 2000-3000,3001,3003,4000-50000


# pool_count in each proxy will change to max_pool_count if they exceed the maximum value

max_pool_count = 100


# authentication_timeout means the timeout interval (seconds) when the frpc connects frps

# if authentication_timeout is zero, the time is not verified, default is 900s

authentication_timeout = 900


# if subdomain_host is not empty, you can set subdomain when type is http or https in frpc's configure file

# when subdomain is test, the host used by routing is test.frps.com

subdomain_host = frps.com


# ssh is the proxy name, client will use this name and auth_token to connect to server

[ssh]

type = tcp

auth_token = 123

bind_addr = 0.0.0.0

listen_port = 9710


[dns]

type = udp

auth_token = 123

bind_addr = 0.0.0.0

listen_port = 5353


[svn]

# if type equals http, vhost_http_port must be set

type = tcp

auth_token = 123

listen_port=8081

# if proxy type equals http, custom_domains must be set separated by commas

custom_domains = web01.yourdomain.com,web01.yourdomain2.com


#[web02]

# if type equals https, vhost_https_port must be set

#type = https

#auth_token = 123

#custom_domains = web02.yourdomain.com



服务端启动

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


客户端配置:

# [common] is integral section

[common]

# A literal address or host name for IPv6 must be enclosed

# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"

server_addr = 服务端的公网IP地址

server_port = 7000


# if you want to connect frps by http proxy, you can set http_proxy here or in global environment variables

# http_proxy = http://user:pwd@192.168.1.128:8080


# console or real logFile path like ./frpc.log

log_file = ./frpc.log


# debug, info, warn, error

log_level = info


log_max_days = 3


# for authentication

auth_token = 123


# for privilege mode

privilege_token = 12345678


# heartbeat configure, it's not recommended to modify the default value

# the default value of heartbeat_interval is 10 and heartbeat_timeout is 30

# heartbeat_interval = 10

# heartbeat_timeout = 30


# ssh is the proxy name same as server's configuration

[ssh]

# tcp | http, default is tcp

type = tcp

local_ip = 127.0.0.1

local_port = 9710

# true or false, if true, messages between frps and frpc will be encrypted, default is false

use_encryption = false

# default is false

use_gzip = false


[dns]

type = udp

local_ip = 114.114.114.114

local_port = 53


# Resolve your domain names to [server_addr] so you can use http://web01.yourdomain.com to browse web01 and http://web02.yourdomain.com to browse web02, the domains are set in frps.ini

[svn]

type = tcp

local_ip = 127.0.0.1

local_port = 8080

use_gzip = false

use_encryption = false

# connections will be established in advance, default value is zero

#pool_count = 20

# http username and password are safety certification for http protocol

# if not set, you can access this custom_domains without certification

#http_user = admin

#http_pwd = admin

# if domain for frps is frps.com, then you can access [web01] proxy by URL http://test.frps.com

#subdomain = test


#[web02]

#type = http

#local_ip = 127.0.0.1

#local_port = 8000


#[privilege_ssh]

# if privilege_mode is enabled, this proxy will be created automatically

#privilege_mode = true

#type = tcp

#local_ip = 127.0.0.1

#local_port = 22

#use_encryption = true

#use_gzip = false

#remote_port = 6001


#[privilege_web]

#privilege_mode = true

#type = http

#local_ip = 127.0.0.1

#local_port = 8080

#use_gzip = true

#custom_domains = web03.yourdomain.com

# locations is only useful for http type

#locations = /,/pic

#host_header_rewrite = example.com

#subdomain = dev


客户端启动:

nohup ./frpc -c frpc.ini &


只需要设置[svn]的相应类型以及端口 会自动映射到端口


利用:http://外网ip地址:7500/访问


本文转自gaofeng36599 51CTO博客,原文链接:http://blog.51cto.com/786678398/1918028


相关文章
|
Linux
CentOS7.9服务器一键脚本部署FRP内网穿透服务端与客户端
CentOS7.9服务器一键脚本部署FRP内网穿透服务端与客户端
1153 1
|
安全 Shell Linux
【Shell 命令集合 系统管理 】⭐⭐⭐Linux 重启 reboot命令 使用指南
【Shell 命令集合 系统管理 】⭐⭐⭐Linux 重启 reboot命令 使用指南
649 0
|
开发工具
frp-免费内网穿透
frp-免费内网穿透
1383 0
|
弹性计算 安全 Linux
使用阿里云ECS服务器和frp配置SSH反向代理
校园网、公司内网中的设备一般是没有公网ip的,所以没办法用SSH直接连接。但是平时VSCode远程连接调调代码啥的都是通过SSH来连接的,平时不在学校或者公司的时候会很麻烦。虽然说VPN、向日葵花生壳之类的方法都能解决这个问题,但是这些方法不是麻烦就是贵或者不安全。frp只需要一台有公网ip的服务器就能实现外网SSH访问,相对来说比较简单。
|
弹性计算 网络协议 Linux
阿里云主机构建FRP内网穿透家用服务器避坑指南
详述了利用FRP工具搭建内网穿透的流程,包括阿里云ECS的配置、家用服务器的准备、FRP工具的下载与配置,以及通过SSH远程访问本地服务器的解决策略,确保了内外网间的稳定连接。
3906 1
阿里云主机构建FRP内网穿透家用服务器避坑指南
|
7月前
|
消息中间件 API 开发工具
实时获取短信发送状态,这个功能别错过!|阿里云短信服务
短信回执可以让你对每一次短信的审核和送达状态了如指掌,怎么样才能摆脱“状态轮询”,实时获取各种状态呢?
1071 17
|
缓存 Linux
CentOS7添加阿里云yum源
CentOS7添加阿里云yum源
9352 1
|
人工智能 边缘计算 物联网
云计算的未来:五大趋势与技术变革
【6月更文挑战第25天】云计算未来五大趋势: 1. 边缘计算与物联网结合,减少延迟,增强实时性。 2. AI与云计算融合,提升智能服务效率。 3. 量子计算的潜力,革新云计算处理能力。 4. 混合云和多云策略成主流,提供灵活安全选项。 5. 可持续性发展,绿色云计算降低环境影响。
1697 6
|
应用服务中间件 nginx
如何通过Nginx配置将请求转发到conf.d目录下的各个配置文件
如何通过Nginx配置将请求转发到conf.d目录下的各个配置文件
1044 2
|
存储 NoSQL MongoDB
【MongoDB 专栏】MongoDB 的 GridFS:存储与检索大文件
【5月更文挑战第10天】MongoDB's GridFS 是用于大规模数据和大文件存储的解决方案,它将文件分割成小块存储在不同文档中,以提升管理效率和避免性能问题。文件上传时记录元数据,通过唯一标识符实现快速检索。GridFS 提供高效存储、便捷检索和扩展性,适用于大文件管理。然而,应注意文件大小限制、数据一致性和性能优化。通过案例分析,展示了 GridFS 在实际应用中的优势和适用场景,为构建强大应用提供支持。
563 1
【MongoDB 专栏】MongoDB 的 GridFS:存储与检索大文件