以前写的太罗嗦了。简单点。
frps.ini

[common]
bind_addr = 0.0.0.0
bind_port = 7000
bind_udp_port = 7001
kcp_bind_port = 7000
dashboard_addr = 0.0.0.0
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = password
log_file = ./frps.log
log_level = info
log_max_days = 3
allow_ports = 2000-3000,3001,3003,4000-50000
max_pool_count = 5
max_ports_per_client = 0
tcp_mux = true

frpc.ini

[common]
server_addr = frp.server.com
server_port = 7000

#每个机器的名字不能一样,最好是用“服务名_主机名”,这样好区分。
[ssh_myubuntu]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 62222

sudo vim /lib/systemd/system/frpc.service

[Unit]
Description=frpc service
After=network.target syslog.target
Wants=network.target

[Service]
Type=simple
# 服务端
#ExecStart=/home/ubuntu/frp/frps -c /home/ubuntu/frp/frps.ini
# 客户端
ExecStart=/home/ubuntu/frp/frpc -c /home/ubuntu/frp/frpc.ini

[Install]
WantedBy=multi-user.target

标签: none

添加新评论