服务器端frp下载地址
:
https://github.com/fatedier/frp/releases
[root@server01 frp_0.45.0_linux_amd64]# ll
total 25256
-rwxr-xr-x 1 1001 docker 11374592 Oct 26 23:24 frpc
-rw-r--r-- 1 1001 docker 10934 Oct 26 23:30 frpc_full.ini
-rw-r--r-- 1 1001 docker 126 Oct 26 23:30 frpc.ini
-rwxr-xr-x 1 1001 docker 14446592 Oct 26 23:24 frps
-rw-r--r-- 1 1001 docker 5686 Oct 26 23:30 frps_full.ini
-rw-r--r-- 1 1001 docker 26 Oct 26 23:30 frps.ini # 配置文件
-rw-r--r-- 1 1001 docker 11358 Oct 26 23:30 LICENSE
编辑配置文件frps.ini
[common]
bind_port = 7000
token = xxxxx # 根据习惯编写一个复杂的字符串
启动
[root@server01 frp_0.45.0_linux_amd64]# ./frps -c ./frps.ini
2022/11/11 14:04:47 [I] [root.go:206] frps uses config file: ./frps.ini
2022/11/11 14:04:47 [I] [service.go:196] frps tcp listen on 0.0.0.0:7000
2022/11/11 14:04:47 [I] [root.go:215] frps started successfully
# 关闭连接后不关闭服务
[root@server01 frp_0.44.0_linux_amd64]# nohup ./frps -c frps.ini > runoob.log 2>&1 &
[1] 2370135
[root@server01 frp_0.44.0_linux_amd64]# jobs
[1]+ Running nohup ./frps -c frps.ini > runoob.log 2>&1 &
window端下载地址同上
https://github.com/fatedier/frp/releases
修改配置文件frpc.ini
windows中启动脚本
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
C:\Users\Admin\Desktop\frp_0.44.0_windows_amd64\frpc.exe -c C:\Users\Admin\Desktop\frp_0.44.0_windows_amd64\frpc.ini
linux作为客户端
使用systemd将其安装为服务
vim /etc/systemd/system/frpc.service
[Unit]
Description = frp client
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
ExecStart =/root/software/frp/frp_0.45.0_linux_amd64/frpc -c /root/software/frp/frp_0.45.0_linux_amd64/frpc.ini
[Install]
WantedBy = multi-user.target
使用 systemd 命令,管理 frpc
systemctl start frpc
systemctl enable frpc