From 271d2417dc57f00cdaff69152457c09182c03832 Mon Sep 17 00:00:00 2001 From: serverbread Date: Thu, 4 Jul 2024 00:45:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=87=AA=E5=BB=BAfrp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/start/deploy/intranet-penetration.md | 99 +++++++++++++++++++++-- 1 file changed, 92 insertions(+), 7 deletions(-) diff --git a/docs/start/deploy/intranet-penetration.md b/docs/start/deploy/intranet-penetration.md index 307afc442..243879c8d 100644 --- a/docs/start/deploy/intranet-penetration.md +++ b/docs/start/deploy/intranet-penetration.md @@ -1,6 +1,6 @@ --- -title: 内网穿透 -sidebar_position: 5 +title: 内网穿透 +sidebar_position: 5 --- # 内网穿透 @@ -11,15 +11,100 @@ sidebar_position: 5 **来几个?** -内网穿透一抓一大把 - -比如比较有名的樱花内网穿透:https://www.natfrp.com/?page=panel&module=addproxy +内网穿透一抓一大把,比如[樱花内网穿透](https://www.natfrp.com/)和[OpenFrp](https://www.openfrp.net/) ~~因为rz用户比较多,你甚至能用某人用不用樱花来定性判断这人有没有技术~~ -openFrp:https://www.openfrp.net/ +## 自建Frp + +首先你得确保你有一台有公网IP的机器,最好是**Linux**的。 + +这里假定你有一台符合条件的Linux服务器,并且你已经可以连上你服务器的**SSH**。 + + +1. 首先确保服务器所有软件包是最新的: + +```bash +apt-get update && apt-get upgrade -y +``` + +2. 安装`screen`软件包: + +```bash +apt-get install screen -y +``` + +3. 下载`frp.go`软件: + +```bash +cd ~ +wget https://github.com/fatedier/frp/releases/download/v0.58.1/frp_0.58.1_linux_amd64.tar.gz +``` + +4. 解压 + +```bash +tar -xzvf frp_0.58.1_linux_amd64.tar.gz +``` + +### 配置服务端 + +1. 编写配置文件: +```bash +vim ~/frp_0.58.1_linux_amd64/frps.toml +``` +写入如下内容: +```toml +bindPort = 7000 # frps监听的端口 + +auth.token = "example" # 身份验证令牌,frpc要与frps一致 +``` + +2. 开启frps服务端: + +```bash +cd ~/frp_0.58.1_linux_amd64 +screen -dR frps ./frps +# 键盘上按Ctrl+A+D退出 +``` + +### 配置客户端: + +1. 编辑配置文件 +```bash +vim ~/frp_0.58.1_linux_amd64/frpc.toml +``` +输入以下内容: +```toml +serverAddr = "x.x.x.x" # 你frps服务器的ip地址 +serverPort = 7000 # 你frps服务开在的端口 + +auth.token = "example" # 令牌,与公网服务端保持一致 + +[[proxies]] +name = "mc je" +type = "tcp" # java版使用tcp协议通信,不可更改 +localIP = "127.0.0.1" # 默认不用改 +localPort = 25565 # mc服务端开在哪个端口? +remotePort = 25565 # 暴露服务的公网入口 + +# 如果你开了互通,要基岩支持 +[[proxies]] +name = "mc be" +type = "udp" # 基岩版使用udp协议通信,不可更改 +localIP = "127.0.0.1" +localPort = 19132 +remotePort = 19132 +``` + +2. 开启frps服务端: + +```bash +cd ~/frp_0.58.1_linux_amd64 +screen -dR frpc ./frpc +# 键盘上按Ctrl+A+D退出 +``` -TODO:自建Frp ## 可能的问题? From 92d8201cd84892d21d3db6af8a7e2c26d2aaae88 Mon Sep 17 00:00:00 2001 From: serverbread Date: Thu, 4 Jul 2024 01:05:08 +0800 Subject: [PATCH 2/2] fixed 'or replaceAll boss' --- docs/start/deploy/intranet-penetration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/start/deploy/intranet-penetration.md b/docs/start/deploy/intranet-penetration.md index 243879c8d..61efefffd 100644 --- a/docs/start/deploy/intranet-penetration.md +++ b/docs/start/deploy/intranet-penetration.md @@ -1,6 +1,6 @@ --- -title: 内网穿透 -sidebar_position: 5 +title: 内网穿透 +sidebar_position: 5 --- # 内网穿透