标签 frp 下的文章

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

注意事项:
1.软件包含服务端和客户端,请根据系统下载

2.服务器注意开放相关的端口和防火墙

#iptables放行端口
iptables -A INPUT -p tcp --dport 7000 -j ACCEPT
service iptables save
#firewalld放行端口
firewall-cmd --zone=public --add-port=7000/tcp --permanent
firewall-cmd --reload

3.服务端配置frps.ini

[common]
bind_port = 7000
#客户端也要设置一样的
token = 12345678
#服务端控制面板设置
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
#远程代理端口设置
vhost_http_port = 10080
vhost_https_port = 10443
#服务器端的域名设置
subdomain_host = example.com

4 服务端再持续运行

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

服务端设置启动运行 把命令写进文件

/etc/rc.local

5客户端按客户端系统下载配置(frpc.ini)

[common]
server_addr = 0.0.0.0
server_port = 7000
token = 12345678

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
use_encryption = false
use_compression = false
remote_port = 6001

[router-web]
type = http
local_ip = 127.0.0.1
local_port = 80
use_encryption = true
use_compression = true
http_user = admin
http_pwd = admin
subdomain = web01
custom_domains = web02.yourdomain.com
locations = /abc,/def
host_header_rewrite = dev.yourdomain.com

[range:multi-port]
type = tcp
local_ip = 127.0.0.1
use_encryption = false
use_compression = false
local_port = 6010-6020,6022,6024-6028
remote_port = 16010-16020,16022,16024-16028

6.客户端运行可以widnows计划任务,liunx可以按服务端一样设置后台运行