frps
防火墙需要放行 : 80,443,7000-7200, 如果不限制端口,则都需要放行
需要修改的地方包括:
- 管理页面账号密码
- token
可以修改
- 放行端口
[common]
bind_addr = 0.0.0.0
bind_port = 7000
bind_udp_port = 7000
kcp_bind_port = 7001
# if you want to support virtual host, you must set the http port for listening (optional)
# Note: http port and https port can be same with bind_port
vhost_http_port = 80
vhost_https_port = 443
# response header timeout(seconds) for vhost http server, default is 60s
vhost_http_timeout = 60
# tcpmux_httpconnect_port specifies the port that the server listens for TCP
# HTTP CONNECT requests. If the value is 0, the server will not multiplex TCP
# requests on one single port. If it's not - it will listen on this value for
# HTTP CONNECT requests. By default, this value is 0.
# tcpmux_httpconnect_port = 1337
# 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 = 7002
# dashboard user and passwd for basic auth protect
dashboard_user = frps
dashboard_pwd = frps@2022
# enable_prometheus will export prometheus metrics on {dashboard_addr}:{dashboard_port} in /metrics api.
log_file = /tmp/frps.log
# trace, debug, info, warn, error
log_level = debug
log_max_days = 3
authentication_method = token
# auth token
token = xxxxxxxxxxx # 需要修改
# only allow frpc to bind ports you list, if you set nothing, there won't be any limit
allow_ports = 7006-7200 # 可以修改
# 注释 allow_ports 表示不做端口限制
# pool_count in each proxy will change to max_pool_count if they exceed the maximum value
max_pool_count = 5
# max ports can be used for each client, default value is 0 means no limit
max_ports_per_client = 0
# when subdomain is test, the host used by routing is test.frps.com
subdomain_host = frp.example.com # 需要修改
# specify keep alive interval for tcp mux.
# only valid if tcp_mux is true.
tcp_mux_keepalive_interval = 60
# tcp_keepalive specifies the interval between keep-alive probes for an active network connection between frpc and frps.
# If negative, keep-alive probes are disabled.
tcp_keepalive = 7200
# custom 404 page for HTTP requests
# custom_404_page = /path/to/404.html
# specify udp packet size, unit is byte. If not set, the default value is 1500.
# This parameter should be same between client and server.
# It affects the udp and sudp proxy.
udp_packet_size = 1500
# Enable golang pprof handlers in dashboard listener.
# Dashboard port must be set first
pprof_enable = false
# tls_only specifies whether to only accept TLS-encrypted connections. By default, the value is false.
tls_only = frp
tls_cert_file = /etc/frp/tls/cert.crt #证书配置需要修改或者注释
tls_key_file = /etc/frp/tls/cert.key #证书配置需要修改或者注释
#tls_trusted_ca_file = ca.crt
frpc
参考配置说明 http://v2.shuobude.top/post/3TYmndH4U/
通用配置
[common]
server_addr = frpserver.com # frps 服务器地址
server_port = 8085 # frps 服务器端口
log_file = /tmp/frpc.log
log_level = info
log_max_days = 3
token = xxxxx # frps 服务器token
user = user # 不分类可以不用配置
login_fail_exit = true
protocol = tcp
#subdomain = frpserver.com # 如果有域名可以配置,没有就注释掉
nps
除了端口,可以不修改
防火墙需要放行 : 如果不限制端口,则都需要放行
- tcp: 80,443,9000-9299
- udp: 9001-9005
appname = nps
#Boot mode(dev|pro)
runmode = pro
#HTTP(S) proxy port, no startup if empty
http_proxy_ip=0.0.0.0
http_proxy_port=80
https_proxy_port=443
https_just_proxy=true
#default https certificate setting
https_default_cert_file=/etc/nps/conf/server.pem
https_default_key_file=/etc/nps/conf/server.key
##bridge
bridge_type=tcp
bridge_port=9000
bridge_ip=0.0.0.0
# Public password, which clients can use to connect to the server
# After the connection, the server will be able to open relevant ports and parse related domain names according to its own configuration file.
#public_vkey=123
#Traffic data persistence interval(minute)
#Ignorance means no persistence
flow_store_interval=5
# log level LevelEmergency->0 LevelAlert->1 LevelCritical->2 LevelError->3 LevelWarning->4 LevelNotice->5 LevelInformational->6 LevelDebug->7
log_level=7
log_path=/tmp/nps.log
#Whether to restrict IP access, true or false or ignore
ip_limit=false
#p2p
p2p_ip=p2p.nps.com # 换成自己的服务器或者IP
p2p_port=9001
#web
web_host=p2p.nps.com # 换成自己的服务器或者IP
web_username=nps
web_password=Nps@2022
web_port = 9088
web_ip=0.0.0.0
web_base_url=
web_open_ssl=true
web_cert_file=/etc/nps/conf/server.pem
web_key_file=/etc/nps/conf/server.key
# if web under proxy use sub path. like http://host/nps need this.
#web_base_url=/nps
#Web API unauthenticated IP address(the len of auth_crypt_key must be 16)
#Remove comments if needed
#auth_key=test
auth_crypt_key =TnBzQDIwMjIK
allow_ports=9000-9299
#Web management multi-user login
allow_user_login=true
allow_user_register=false
allow_user_change_username=true
#extension
allow_flow_limit=true
allow_rate_limit=true
allow_tunnel_num_limit=true
allow_local_proxy=true
allow_connection_num_limit=true
allow_multi_ip=true
system_info_display=true
#cache
http_cache=true
http_cache_length=1024
#get origin ip
http_add_origin_header=true
#pprof debug options
#pprof_ip=0.0.0.0
#pprof_port=9999
#client disconnect timeout
disconnect_timeout=60
npc
参考服务器上的配置说明。
frps.service 配置 (/usr/lib/systemd/system/frps.service)
部分系统可用(系统支持systemd) : centos7及以上,ubuntu16 及以上
[Unit]
Description=Frp Server Service
After=network.target
[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/frps -c /etc/frp/frps.ini
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
frpc.service 配置 (/usr/lib/systemd/system/frpc.service)
部分系统可用(系统支持systemd) : centos7及以上,ubuntu16 及以上
[Unit]
Description=Frp Client Service
After=network.target
[Service]
Type=simple
User=frp
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/local/bin/frpc reload -c /etc/frp/frpc.ini
[Install]
WantedBy=multi-user.target