教程开始前你需要符合这几个要求:
1.nas有公网IP。
2.nas已具备ddns解析。
3.有在cf(cloudflare)托管得域名,如果没有,可去申请免费us.kg域名。
这3条都符合,那么我们就开始教程。
1.申请CF得证书。
2.生成CF-DNS管理令牌
3.DDNS解析
这里我用的是Lucky
注意:这里必须开启云朵,因为不开启会导致后面的端口转发失败。(可能出现502错误)
4.nas设置
这里是我遇到的天坑,因为转发后访问无法登录DNS,所以必须打勾才能登录。
映射端口,我用的是NAS自带的,需要在路由开启upnp,也可以自己去路由器设置映射。需要访问哪个就映射哪个端口,我映射的是nas,我的nas是5000端口。我映射的是5090
注意这里设置后无法访问,请继续看下去。
5.CF转发端口
点击部署后就能无端口访问了。
注意,因为是端口转发。所以在你nas里。想访问里面带端口的应用是无法打开的。需要你自己再次映射端口写规则。所以如果是做web或个人影视站,或者在nas内部看电影下载分享链接,可以这么做。
有人会担心开启CF访问会不会收到限制。这是我nas的测试
下载测试:
看4K也没有问题:
给我分配了4个IP,隐藏的证实IP地址,相对安全
80端口和443端口也可以转发。但是国内做了屏蔽,所以请不要转发80和443.可能会失败
![图片[1]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/a/3/2/a32d3f49b82d7554f8ac3965829d215fa4c63473_2_690x479.png)
![图片[2]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/0/4/2/04283827e3c89678b56853bd7aadce167f5a2157_2_690x380.png)
![图片[3]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/9/b/f/9bfa92cc6ccd0d9ba203151740d909269aaf4115_2_690x466.png)
![图片[4]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/1/9/0/1909b84d1d324d68c2405213c2690388206db93a_2_618x500.png)
![图片[5]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/5/6/1/561dad50d43c7779d57455ec3015b7701b4e5c04_2_690x411.png)
![图片[6]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/0/2/b/02b6eba92bda5a3ec328d4521b46c64afa97d4bb_2_688x500.png)
![图片[7]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/f/0/1/f013b73d0f77d9fd9a92b870eb41bb591db7cd8a_2_508x500.png)
![图片[8]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/f/b/9/fb907a8742bd74bd555113d7d0d3c20d1754fa14_2_603x499.png)

![图片[10]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/9/d/0/9d01baffa4a4c6eb73002e472bcd264803148efd_2_690x382.png)
![图片[11]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/4/7/b/47ba90a0b41fb4a4fe7a1b4698dad05ace8e37c6_2_690x426.png)
![图片[12]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/7/4/e/74e3312b18e70fb23f09e6faad977d198f172bcc_2_553x500.png)
![图片[13]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/3/5/4/354b05aff07d6848919dd2eccf11d04e98b5a36b_2_690x308.png)
![图片[14]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/e/d/6/ed6b2a18817549ae10380d448bcf2a0ce22b8a08_2_669x500.jpeg)
![图片[15]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/b/5/c/b5c45abe91d1cf7facc647d8b8ce9d19fe77bc57_2_641x500.png)
![图片[16]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/6/b/c/6bcfa747deb58d68d3b3cdd8665c96638d88c4bc_2_648x500.png)
![图片[17]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/5/b/2/5b24ce96c952aabfd086d4103034068ad88975de_2_690x376.png)
![图片[18]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/7/1/8/7184770801145e7f45542f6aaa9cff9ad6f8ae04_2_690x468.png)
![图片[19]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/e/d/7/ed7486cc229a5f5f301ab5d04bf39cc238adcbae_2_690x392.jpeg)
![图片[20]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/7/c/6/7c6c7a812624f3b3901dc392e7665dbdb00410bd_2_690x245.png)
![图片[21]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/f/f/9/ff922347a1b4b60885357cadef5f2fa7bd7ae8f5_2_491x500.jpeg)
![图片[22]-nas也能实现无端口访问。-友友汇](https://cdn3.linux.do/optimized/4X/b/0/b/b0b0d927492a8844ae60317aaab7f4c304dcf552_2_554x500.png)