-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0b8a5b
commit 8c65fbd
Showing
128 changed files
with
1,035 additions
and
1,035 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ date = "2019-10-10" | |
description = "" | ||
categories = ["HomeLab"] | ||
tags = ["宽带"] | ||
image = "https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/title.avif" | ||
image = "https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/title.avif" | ||
+++ | ||
|
||
网上有不少将内网内容上到公网的方法,大多都是借助frp。不过随着宽带提供商对于公网IP的放宽,如果有公网IP就可以方便得解决这个问题。 | ||
|
@@ -19,11 +19,11 @@ image = "https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5% | |
|
||
启动你需要的项目,我这里随便起一个网页端服务。但是端口选择要注意,常用端口一般会被屏蔽,包括 8080。比如我 8848 端口起了个 qbittorrent 服务 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/1.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/1.avif) | ||
|
||
8849 端口起了个 jellyfin | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/2.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/2.avif) | ||
|
||
## 路由器设置 | ||
|
||
|
@@ -33,62 +33,62 @@ image = "https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5% | |
|
||
进入路由器的 NAT 服务功能 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/3.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/3.avif) | ||
|
||
端口映射里,ip选择你启动项目的设备内网IP,内外端口都填你设定的端口 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/4.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/4.avif) | ||
|
||
端口触发里设置类似 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/5.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/5.avif) | ||
|
||
如果没什么问题了,公网访问你的IP跟上端口号即可访问。如果还有别的服务和设备,就多添加几条。 | ||
|
||
### DMZ 主机 | ||
|
||
填写运行项目的主机内网IP地址即可 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/6.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/6.avif) | ||
|
||
## 配置 DDNS | ||
|
||
1. 在 he 官网注册账号 [https://dns.he.net/](https://dns.he.net/) | ||
2. 注册完毕后,在 [https://dns.he.net](https://dns.he.net/) 这里设置 DNS,他会给你几个 he 的 NS 地址,把这个填到你现在的 NS 服务里解析(需要 NS 服务商支持 NS 记录) | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/7.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/7.avif) | ||
|
||
3. 在 he 的 DNS 设置里添加这个子域名 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/8.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/8.avif) | ||
|
||
4. 点击 Edit Zone 查看记录 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/9.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/9.avif) | ||
|
||
5. 为了避免麻烦,先把默认的几条记录的 TTL 改成五分钟,300秒 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/10.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/10.avif) | ||
|
||
6. 新建一个 A 记录。Name 就填用于 ddns 的域名;IP 地址随便填写一个,这样如果到时还能正确访问自己的公网地址,就说明 ddns 成功生效了;TTL 选择 5 分钟;下面的 Enable entry for dynamic dns 一定要勾选上 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/11.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/11.avif) | ||
|
||
7. 点击这个图标,生成一个 DDNS Key | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/12.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/12.avif) | ||
|
||
8. 可以随机生成一个 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/13.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/13.avif) | ||
|
||
9. 在设备后台运行下面的命令设置 DDNS,注意修改下域名和密码 | ||
|
||
curl -4 "https://xxx.xxx.xxx:[email protected]/nic/update?hostname=xxx.xxx.xxx" | ||
|
||
10. 提示 good 即为成功,此时,访问 域名+端口 即可访问页面 | ||
|
||
![](https://hf-public-source.mitsea.com:8840/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/14.avif) | ||
![](https://gitee.com/flintylemming/mitsea-public-source/raw/master/images/blog/posts/2019/10/%E5%80%9F%E5%8A%A9%E5%AE%BD%E5%B8%A6%E5%85%AC%E7%BD%91%20IP%20%E5%88%86%E5%8F%91%E5%86%85%E7%BD%91%E5%86%85%E5%AE%B9/14.avif) | ||
|
||
11. 现在需要创建一个计划任务让设备几分钟就执行下这句话。但由于群晖不能直接通过 crontab 命令创建任务。首先需要切换到 root 账户,然后编辑计划任务的文件 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.