MENU

配置frps和frpc服务端以及客户端内网穿透进行远程访问

• March 1, 2021 • Read: 955 • 记录

名词解释
  • frps(服务端)即远程服务器,简单点就是阿里云服务器。
  • frpc(客户端)即个人手机笔记本电脑等。

一、安装服务端(frps)

安装命令
wget https://code.aliyun.com/MvsCode/frps-onekey/raw/master/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install
Uninstall(卸载)
./install-frps.sh uninstall
Update(更新)
./install-frps.sh update
Server management(服务管理器)
Usage: /etc/init.d/frps {start|stop|restart|status|config|version}

配置参数(根据需要自行设定)

# [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 = 8000
# udp port used for kcp protocol, it can be same with 'bind_port'
# if not set, kcp is disabled in frps
kcp_bind_port = 8000
# if you want to configure or reload frps by dashboard, dashboard_port must be set
dashboard_port = 8001
# dashboard assets directory(only for debug mode)
dashboard_user = xuezhuang
dashboard_pwd = 12345678
# assets_dir = ./static
vhost_http_port = 7000
vhost_https_port = 6000
# console or real logFile path like ./frps.log
log_file = ./frps.log
# debug, info, warn, error
log_level = info
log_max_days = 3
# auth token
token = MFs7hXPgAignuxNsgfgrgree
# It is convenient to use subdomain configure for http、https type when many people use one frps server together.
subdomain_host = 65.chat
# only allow frpc to bind ports you list, if you set nothing, there won't be any limit
#allow_ports = 1-65535
# pool_count in each proxy will change to max_pool_count if they exceed the maximum value
max_pool_count = 50
# if tcp stream multiplexing is used, default is true
tcp_mux = true

二、安装客户端(frpc)

配置参数

[common]
server_addr = 182.56.19.111
server_port = 8000
token = MFs7hXPgAignuxNsgfgrgree
max_pool_count = 50 

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 11
remote_port = 11
use_encryption = true
use_compression = true


[nas]
type = https
local_port = 6000
remote_port = 6000
custom_domains = nas.65.chat
use_encryption = true
use_compression = true

[https_webdav]
type = tcp
local_ip = 192.168.2.2
local_port = 2103
remote_port = 2103

[xunlei]
type = tcp
local_ip = 127.0.0.1
local_port = 8283
remote_port = 8283
use_encryption = true
use_compression = true

  • 相关配置说明可参考官方文档,当然也可以直接通过 SSH 客户端,以威联通为例,在目录下/share/CACHEDEV1_DATA/.qpkg/frpc
  • 修改文件名为 frpc.ini 的配置参数,完成参数配置后重启客户端软件即可。

教程到此结束。

Archives Tip
QR Code for this page
Tipping QR Code