全过程配置WARP+Xray+分流规则

测试环境前期准备:

服务器一台
系统:Debian 11
域名一个(事先解析到你的服务器IP)


一键模式

bash <(curl -fsSL git.io/warp.sh) menu

选择“4”

如果长时间卡住不动,建议安装手动模式


手动模式模式(一条条复制粘贴即可)

1: apt update
2: apt install curl sudo lsb-release -y
3: echo “deb http://deb.debian.org/debian $(lsb_release -sc)-backports main” | sudo tee /etc/apt/sources.list.d/backports.list
4: su root
5: sudo apt update
6: apt install net-tools iproute2 openresolv dnsutils -y
7: apt install wireguard-tools –no-install-recommends
8: apt -t $(lsb_release -sc)-backports install linux-image-$(dpkg –print-architecture) linux-headers-$(dpkg –print-architecture) –install-recommends -y
9: reboot
10: uname -r (查看版本,5.6 以上就可以了,Debian11 内核 好像是5.10 )
11: curl -fsSL git.io/wgcf.sh | sudo bash
12: wgcf register
13: wgcf generate
14: cp wgcf-profile.conf /etc/wireguard/wgcf.conf
15: 修改 /etc/wireguard/wgcf.conf , 将配置文件中的 engage.cloudflareclient.com 替换为 162.159.192.1,并删除 AllowedIPs = 0.0.0.0/0 , 保存并退出
16: wg-quick up wgcf
17: curl -6 ip.p3terx.com(测试是否连通)
18: wg-quick down wgcf
19: systemctl start wg-quick@wgcf
20: systemctl enable wg-quick@wgcf

(恭喜你已完成warp的配置)

———————————-以下为安装xray以及分流规则设置———————————–

21: 安装xray(根据自己需求,我选择第一个)

wget -N –no-check-certificate -q -O install.sh “https://raw.githubusercontent.com/wulabing/Xray_onekey/main/install.sh” && chmod +x install.sh && bash install.sh

22: 分流设置

(1)xray配置文件目录地址: /usr/local/etc/xray/
(2)编辑config.json , 把原来 “outbounds”替换为以下虚线内的“outbounds”,可以自行根据设置方法(已注明)来设置规则

————————————————————————

 "outbounds": [
    {
      "tag":"IP4_out",
      "protocol": "freedom",
      "settings": {}
    },
    {
      "tag":"IP6_out",
      "protocol": "freedom",
      "settings": {
        "domainStrategy": "UseIPv6" // 指定使用 IPv6
      }
    }
  ],
  "routing": {
    "rules": [
      {
        "type": "field",
        "outboundTag": "IP6_out",
        "domain": ["geosite:netflix"] // 设置方法: "domain": ["geosite:netflix","geosite:google","geosite:youtube"] // netflix google YouTube走 IPv6,自行更具需求替换即可
      },
      {
        "type": "field",
        "outboundTag": "IP4_out",
        "network": "udp,tcp"// 其余走 IPv4
      }
    ]
  }
}

——————————————————————

23: systemctl restart xray
24: systemctl status xray(检查xray是否正常运行)

 

参考内容:https://ybfl.xyz/111.html

你会甘心做一个平凡人、敢于平庸吗?

上一篇

Tiktok 免拔卡 (ios版本)国内使用方法 保姆级图文教程(2022-11-11更新)

下一篇
评论
发表评论 说点什么
还没有评论
1724
0