Frp - 内网穿透
# 服务端(公网)
# 配置
bindPort = 7000
auth.token = "abc"
# 服务
sudo vim /etc/systemd/system/frps.service
[Unit]
# 服务名称,可自定义
Description = frp server
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /path/to/frps -c /path/to/frps.toml
[Install]
WantedBy = multi-user.target
# 启动frp
sudo systemctl start frps
# 停止frp
sudo systemctl stop frps
# 重启frp
sudo systemctl restart frps
# 查看frp状态
sudo systemctl status frps
# 客户端(内网)
# 配置
serverAddr = "123.123.123.123"
serverPort = 7000
auth.token = "abc"
[[proxies]]
name = "test"
type = "tcp"
localIP = "127.0.0.1"
localPort = 80
remotePort = 80
# 服务
sudo vim /etc/systemd/system/frpc.service
[Unit]
# 服务名称,可自定义
Description = frp client
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /path/to/frpc -c /path/to/frpc.toml
[Install]
WantedBy = multi-user.target
# 参考文献
- frp. 文档 [EB/OL]. [2022 年 6 月 17 日]. https://gofrp.org/docs/.
上次更新: 2024/11/22, 23:30:59