frpc 内网端口映射

服务端配置文件 :

frps.ini

[common]
bind_port = 7000
#web控制面板端口号
dashboard_port = 15004
# dashboard's username and password are both optional,if not set, default is admin.
dashboard_user = abc
dashboard_pwd = 123

--------------------

客户端配置:

frpc.ini

[common]

server_addr = 8.1.1.2

server_port = 7000

[ssh]

type = tcp

local_ip = 127.0.0.1

local_port = 7890

remote_port = 7890

------------------

服务文件内容:

使用systemd配置开机自启,适用于 centos7 Ubuntu 16 或 debian 8。
vi /etc/systemd/system/frps.service 新建此文件,并写入以下内容:

 

[Unit]

Description=frps daemon

After=syslog.target network.target

Wants=network.target

[Service]

Type=simple

ExecStart=/root/frp_0.44.0_linux_amd64/frps -c /root/frp_0.44.0_linux_amd64/frps.ini

Restart= always

RestartSec=5s

[Install]

WantedBy=multi-user.target

 

启动并设为开机自启。

systemctl start frps //启动 
systemctl status frps //状态查询 
systemctl enable frps //开机启动

参考地址:

https://www.jianshu.com/p/5f7e71121a4f