banner
NEWS LETTER

frp 内外网穿透

Scroll down

1. 链接

  • 在下载链接下载对应系统的压缩包,解压在指定目录。

2. 服务端

  • 编辑 frps.toml
1
2
3
4
5
6
7
8
9
bindPort = 9847 # 客户端链接端口
vhostHTTPPort = 9848 # 虚拟 http 端口
auth.token = 'mypass@123' # 客户端链接的密码, 自行设置

# 网页端 用于监控链接详情
webServer.addr = "0.0.0.0"
webServer.user = "myFrp"
webServer.password = "mypass@123"
webServer.port = 9488
  • 启动
1
./frps -c ./frps.toml
  • 挂载在 systemctl ,将 frps.service 放入 /etc/systemd/system 下
1
2
3
4
5
6
7
8
9
10
11
12
13
[Unit]
Description=Frp Server Service
After=network.target

[Service]
Type=simple
ExecStart=frps所在目录/frps -c frps.toml所在目录/frps.toml
Restart=on-failure
RestartSec=5s
User=ubuntu

[Install]
WantedBy=multi-user.target
  • 执行命令
1
2
3
systemctl enable frps.service
systemctl start frps.service
systemctl status frps.service

3. 客户端

  • 编辑 frpc.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
serverAddr = "" # 公网服务端 IP 访问地址
serverPort = 9847 # 与远程绑定的端口相同
auth.token = "" # 客户端链接的密码

[[proxies]]
name = "test-tcp" # 代理名称(随便填)
type = "tcp" # 代理类型
localIP = "" # 代理地址, 要转发到哪个地址(本地服务地址)
localPort = # 代理端口, 要转发到哪个端口(本地服务端口)
remotePort = # 远程代理到公网的端口,服务端与客户端连接的桥梁(此端口记得进行端口开放,避免连接不上)

[[proxies]]
name = "test-http"
type = "http"
localPort = # 代理端口, 要转发到哪个端口(本地服务端口)
customDomains = ["公网服务器 IP 访问地址"]
  • 启动
1
./frpc -c frpc.toml

你那么好看,应该会支持一下我吧~

其他文章
cover
ubuntu 配制
  • 24/09/20
  • 15:37
  • ubuntu
目录导航 置顶
  1. 1. 1. 链接
  2. 2. 2. 服务端
  3. 3. 3. 客户端
请输入关键词进行搜索