Linux

搭建Frp内网穿透服务

by admin, 2020-03-07


服务端

# 下载frp可执行包
wget https://github.com/fatedier/frp/releases/download/v0.31.2/frp_0.31.2_linux_amd64.tar.gz

# 解压
tar zxf frp_0.31.2_linux_amd64.tar.gz

# 进入文件
cd frp_0.31.2_linux_amd64

编辑配置文件
nano frps.ini

[common]
bind_port = 7000
vhost_http_port = 80
vhost_https_port = 443
dashboard_port = 9999
# dashboard's username and password are both optional,if not set, default is a$
dashboard_user = admin
dashboard_pwd = admin

设置完成

# 启动
./frps -c frps.ini 

设置frps服务自启动

# 创建后台启动模版
nano /etc/systemd/system/frp.service
# 内容如下:
[Unit]
Description=frps
After=network.target

[Service]
ExecStart=/root/frp_0.31.2_linux_amd64 -c /root/frp_0.31.2_linux_amd64/frps.ini 

[Install]
WantedBy=multi-user.target


# 启动测试
systemctl start frp.service
# 查看启动状态
systemctl status frp.service
# 开机自启
systemctl enable frp.service

客户端

下载windows版64位客户端:https://github.com/fatedier/frp/releases
下载完进行解压,然后修改一下配置(frpc.ini)。

[common]
server_addr = 服务器ip
server_port = 7000
admin_addr = 127.0.0.1
admin_port = 9998
admin_user = admin
admin_pwd = admin

[web]
type = http
local_port = 80
# 可以是域名,也可以是外网ip
custom_domains = 你的域名

启动客户端:
linux
./frpc -c frpc.ini
windows
打开cmd,进入文件夹
frpc.exe -c frpc.ini

参考 宁静致远kioye

无标签
2020 © - home