[新手向] WebHorizon家3.99刀新加坡nat机基于ipv6一条龙教程

c7J8 大佬有话说 : 2021-12-16 19:15:38

[新手向] WebHorizon家3.99刀新加坡nat机基于ipv6一条龙教程

本帖最后由 c7J8 于 2022-1-21 19:01 编辑

WebHorizon家$3.99/y的nat+ipv6的机子也买了半个月了,来个教程,排版渣,如有错别字语法错误啥的就凑活看吧。

思路:ipv6建站反代代理再套cf,warp解锁Disney+ 奈飞 ,优选cf本地ip,奔放

按步骤来问题不大,毕竟我按着本文来重装系统好几次,测试过后才发布的贴。如果有问题,建议尝试自行解决。

毕竟我只是一个菜鸡

https://img.7shy.com/images/1635153829630.gif

一、准备工作
1.先将从面板获取到的ipv6地址添加解析至托管到cloudflare的域名(如图所示,/80前的那一串复制下来)。登录cf面板,添加记录,选择AAAA记录,名称随意,ipv6地址填写上面复制的,代理状态因为后面申请ssl证书需要验证暂时先关闭,ssl证书申请完成后记得打开,最后保存。
https://img.7shy.com/images/mmexport1638878944828.jpg
https://img.7shy.com/images/20211207212941.jpg

2.打开ssh软件,新建会话 地址填上面的ipv6地址 端口22 用户root 密码自己设置的,连接即可。
注意:本地需要有ipv6网络,电脑没有ipv6就用手机移动数据。

安装宝塔
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
bt工具箱 ,7.7.0版去强登后ssl申请好像有点问题,进去输入10降到7.6.0,输入3和1,去除强登
wget -O btpanel_tools.sh https://download.btpanel.cm/tools/btpanel_tools.sh && bash btpanel_tools.sh
从v6地址登录宝塔,安装nginx1.18和php 5.6,不用担心,资源够用。
https://img.7shy.com/images/qq_pic_merged_1638885158599.jpg

二、建站 安装V2及修改配置文件
1.建站及修改网站配置文件
宝塔建站没什么好说的,域名填之前在cf添加的域名,ssl证书申请Let’s Encrypt的就好,打开强制https
证书下来了记得去cf打开代理
https://img.7shy.com/images/20211207213234.jpg

修改站点配置文件,如图位置,复制粘贴
    location /webhorizon/
   {
    proxy_pass http://127.0.0.1:11800;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 300s;
   }
https://img.7shy.com/images/20211216154508.png

2.安装v2以及最新的 geoip.dat 和 geosite.dat
curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh && curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh && bash install-release.sh && bash install-dat-release.sh
3.编辑v2配置文件
上述步骤完成后,进入宝塔编辑v2配置文件config.json,左侧文件,如图所示目录依次打开
https://img.7shy.com/images/QQ20211207211335.png

清空原内容,复制粘贴进去,再根据你的实际情况进行修改

{
"log": {
      "access": "/var/log/v2ray/access.log",
      "error": "/var/log/v2ray/error.log",
      "loglevel": "warning"
    },
"dns": {
    "servers": [
      "https+local://1.1.1.1/dns-query",
          "1.1.1.1",
          "1.0.0.1",
          "8.8.8.8",
          "8.8.4.4",
          "localhost"
    ]
},
"inbounds": [
    {
    "port":11800,
      "listen": "127.0.0.1",
      "tag": "vmess-in-1",
      "protocol": "vmess",
      "settings": {
      "clients": [
          {
          "id":"39841fb2-aa95-4d8d-945e-903c65b2b028",      ##uuid,https://1024tools.com/uuid 在线生成uuid,记得修改
          "alterId":0
          }
      ]
      },
       "streamSettings": {
      "network": "ws",
      "wsSettings": {
            "path": "/webhorizon/",            ##路径 /webhorizon/,如需修改网站配置文件那边也要同步修改
            "headers": {
                "Host": "test.test.com"         ##填写上面那你添加的域名
            }
      }
    }
}
],
"outbounds": [
    {
      "protocol": "freedom",
      "settings": { },
      "tag": "direct"
    },
    {
      "protocol": "freedom",
      "settings": {"domainStrategy": "UseIPv4"},   ##根据实际情况选择nf走v4或v6,可"UseIPv4"修改为"UseIPv6",建议默认,如果修改下面的全部改
      "tag": "ipv4"                                              ##根据实际情况选择nf走v4或v6,可"ipv4"修改为"ipv6",建议默认
    },
    {
      "protocol": "blackhole",
      "settings": { },
      "tag": "blocked"
    }
],
"routing": {
    "domainStrategy": "IPIfNonMatch",
    "domainMatcher": "mph",
    "rules": [
   {
      "type": "field",
      "inboundTag": ["vmess-in-1"],
      "domain": ["geosite:category-ads-all"],
      "outboundTag": "blocked"
      },
      {
      "type": "field",
      "inboundTag": ["vmess-in-1"],
      "domain": ["geosite:netflix"],
      "outboundTag": "ipv4"                   ##根据实际情况选择nf走v4或v6,可"ipv4"修改为"ipv6",建议默认
      },
      {
      "type": "field",
      "inboundTag": ["vmess-in-1"],
      "outboundTag": "direct"
      }
    ]
}
}
配置文件修改完保存退出后,执行命令
v2开机自启
systemctl enable v2ray
v2启动
systemctl start v2ray
v2状态
systemctl status v2ray
在启动v2后,执行 v2状态 应输出 “active (running)”,无误后进行下一步操作,报错请排查配置文件。

v2相关命令(仅了解,请勿按行执行)
v2开机自启
systemctl enable v2ray
取消v2开机自启
systemctl disable v2ray
v2启动
systemctl start v2ray
v2停止
systemctl stop v2ray
v2状态
systemctl status v2ray
v2重启
systemctl restart v2ray

三、套warp以解锁nf非自制剧并后台监控自动刷新ip
1.去控制面板打开小鸡Enable Tun/Tap和Enable PPP,如图,开启后请在面板内执行一次关闭和启动服务器的操作
https://img.7shy.com/images/20211216110428.png
2.优先选择使用IPv4
vi /etc/gai.conf
复制进去,保存退出
precedence ::ffff:0:0/96100
3.安装warp,v6刷半天刷不出解锁的ip,所以直接上v4,一般5-6次即可成功
bash <(curl -fsSL git.io/warp.sh) 4
warp相关命令(仅了解,请勿按行执行)
warp开机自启
systemctl enable wg-quick@wgcf
取消warp开机自启
systemctl disable wg-quick@wgcf
warp停止
systemctl stop wg-quick@wgcf
warp启动
systemctl start wg-quick@wgcf
warp重启
systemctl restart wg-quick@wgcf
warp状态
systemctl status wg-quick@wgcf

4.后台监控自动刷新ip,服务器每次重启后需要重复此步骤
先安装screen
yum install -y screen
获取后台监控脚本
wget https://github.com/luoxue-bot/warp_auto_change_ip/raw/main/warp_change_ip.sh && chmod +x warp_change_ip.sh
设置:每隔多长时间检测一下ip的解锁是否有效
脚本36行            echo -e "Region: ${region} Done, monitoring…"
脚本37行            sleep 6
第37行的sleep 6可以改成任意时间,单位是秒,一般来说,1分钟即sleep 60就行,ip基本都可以存活一整天以上,不需要那么频繁的检测
我是改了300秒,嫌麻烦,可以忽略

进入screen
screen
运行监控脚本
./warp_change_ip.sh
提示"Is warp installed? " ,我们已经安装warp,选择y,回车
接下来,"Input the region you want(e.g. HK,SG):"
这个地方输入 SG ,回车
注意:一定要大写字母,小写不行
当显示“Region: SG Done, monitoring…"的时候,就说明ok了
从screen退出
ctrl+a 再按d
5.运行流媒体检测脚本,建议检测前执行一下 yum update,不然可能会卡住。
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)
会看到“您的网络为: Cloudflare Warp”,ipv4已经可以解锁奈飞了
https://img.7shy.com/images/20211216122732.png

四、cf本地自选ip
项目地址
https://github.com/XIU2/CloudflareSpeedTest
最新版本v2.0.2 蓝奏云
https://pan.lanzouo.com/b0742hkxe
选择“CloudflareST_windows_amd64.zip”下载到本地电脑,新建文件夹将其解压至新建文件夹。这里只讲最简单的使用方法,更多使用方法和问题请详参项目地址

进入文件夹,双击运行 CloudflareST.exe 进行测试获得最优ip,将获得的IP填入代理软件节点的IP地址栏即可
运行测试时,请务必关闭代理
https://img.7shy.com/images/20211216180657_edit_103195371006127.png

五、配置客户端
打开代理软件(v2N为例),添加服务器,按图配置,如果需要导入其他设备,右键选中节点,批量导出分享URL
至剪切板 即可获得vmess:xxxxxxxxx 的链接,复制到其他设备导入即可
额外id请改为0
https://img.7shy.com/images/20211216172710.jpg

至此,本次教程结束。

卤蛋 大佬有话说 : 2021-12-16 19:29:25

c7J8 大佬有话说 : 2021-12-16 19:28
全部基于ipv6啊,v4是nat,v6不是,所有端口均可使用

明白了,学习

Amanda 大佬有话说 : 2021-12-16 19:18:06

教程挺详细,支持一下https://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif

Looper 大佬有话说 : 2021-12-16 19:18:11

先收藏,晚点看看:lolhttps://cdn.jsdelivr.net/gh/master-of-forums/master-of-forums/public/images/patch.gif

c7J8 大佬有话说 : 2021-12-16 19:18:21

写的我头疼

卤蛋 大佬有话说 : 2021-12-16 19:19:35

你这也太复杂了

c7J8 大佬有话说 : 2021-12-16 19:21:59

卤蛋 大佬有话说 : 2021-12-16 19:19
你这也太复杂了

熟悉步骤后挺简单的

卤蛋 大佬有话说 : 2021-12-16 19:22:46

c7J8 大佬有话说 : 2021-12-16 19:21
熟悉步骤后挺简单的

我们新手只用一键脚本

c7J8 大佬有话说 : 2021-12-16 19:23:50

卤蛋 大佬有话说 : 2021-12-16 19:22
我们新手只用一键脚本

一键那确实简单:lol

表妹 大佬有话说 : 2021-12-16 19:24:14

很详细,我看刑:lol

c7J8 大佬有话说 : 2021-12-16 19:25:41

表妹 大佬有话说 : 2021-12-16 19:24
很详细,我看刑

可刑,可铐:lol

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!