WAP.AC ipv6-only 配置分流
本文最后更新于 410 天前,其中的信息可能已经有所发展或是发生改变。

1、dd脚本

wget -qO OsMutation.sh https://raw.githubusercontent.com/LloydAsp/OsMutation/main/OsMutation.sh && chmod u+x OsMutation.sh && ./OsMutation.sh

2、lxc-warp

wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh 4

3、nezha

wget https://github.com/nezhahq/agent/releases/download/v0.16.2/nezha-agent_linux_amd64.zip
./nezha-agent -s nezha.343700.xyz:443 -p rOBDEpul7z0OGxYVj2--tls -d
./nezha-agent -s 198.2.254.147:5555 -p diMceRzNLCazqUdhkY --tls -d

有瑕疵,但是能做到根据入站端口分流ipv4(warp)和ipv6(直连)

0、思路

1、尝试x-ui面板配置,实际只能走ipv4(warp),无ipv6
2、尝试xrayL(不良林提供xray脚本)配置,实际只能走直连,无ipv4

将两个服务同时开启,监听不同端口,则可以实现不同端口分流

1、安装warp和proxychains4

apt update && apt install -y curl gnupg lsb-release proxychains4

curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg |  gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/cloudflare-client.list

apt update && apt install -y cloudflare-warp


# 注册设备和修改设置
warp-cli register # 看提示输入Y
warp-cli set-mode proxy
warp-cli set-proxy-port 1835 # 可以自己改本地监听端口
warp-cli connect

# 手!动!修!改!
nano /etc/proxychains4.conf
最后一行 socks4 开头的内容改成
socks5 127.0.0.1 1835 # 上面那个端口

2、x-ui安装

wget https://github.com/vaxilu/x-ui/releases/download/0.3.2/x-ui-linux-amd64.tar.gz
rm x-ui/ /usr/local/x-ui/ /usr/bin/x-ui -rf
tar zxvf x-ui-linux-amd64.tar.gz
chmod +x x-ui/x-ui x-ui/bin/xray-linux-* x-ui/x-ui.sh
cp x-ui/x-ui.sh /usr/bin/x-ui
cp -f x-ui/x-ui.service /etc/systemd/system/
mv x-ui/ /usr/local/
systemctl daemon-reload
systemctl enable x-ui
systemctl restart x-ui

3、x-ui配置

进入面板 [ipv6]:54321 -> 面板设置 -> xray相关设置 ->

{
  "api": {
    "services": [
      "HandlerService",
      "LoggerService",
      "StatsService"
    ],
    "tag": "api"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 62789,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.1"
      },
      "tag": "api"
    }
  ],
  "outbounds": [
    {
      "tag": "outbound-warp",
      "protocol": "socks",
      "settings": {
        "servers": [
          {
            "address": "127.0.0.1",
            "port": 1835
          }
        ]
      }
    },
    {
      "tag": "direct",
      "protocol": "freedom"
    },
    {
      "protocol": "freedom",
      "settings": {}
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "policy": {
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true
    }
  },
  "routing": {
    "rules": [
      {
        "type": "field",
        "ip": [ "0.0.0.0/0" ],
        "outboundTag": "outbound-warp"
      },
      {
        "type": "field",
        "ip": [ "::/0" ],
        "outboundTag": "direct"
      },
      {
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      }
    ]
  },
  "stats": {}
}

4、 xrayL安装

proxychains4 bash <(curl -fsSLk https://raw.githubusercontent.com/bulianglin/demo/main/xrayL.sh) vmess

5、 xrayL配置

nano /etc/xrayL/config.toml

[[inbounds]]
port = 20000
protocol = "vmess"
tag = "tag_0"
[inbounds.settings]
[[inbounds.settings.clients]]
id = "cec97416-12a4-4bc0-b1cd-92006383b123"
[inbounds.streamSettings]
network = "ws"
[inbounds.streamSettings.wsSettings]
path = "/wap"

[[outbonds]]
sendThrough = "127.0.0.1"
tag = "warp"
protocol = "socks"

[outbonds.settings]
[[outbonds.settings.servers]]
address = "127.0.0.1"
port = 1835

[[outbounds]]
sendThrough = "2400:8123:112:1::123"
protocol = "freedom"
tag = "direct"

[routing]
[[routing.rules]]
type = "field"
ip = [ "0.0.0.0/0" ]
inboundTag = "tag_0"
outboundTag = "warp"

[[routing.rules]]
type = "field"
ip = [ "::/0" ]
inboundTag = "tag_0"
outboundTag = "direct"



[[inbounds]]
port = 20001
protocol = "vmess"
tag = "tag_1"
[inbounds.settings]
[[inbounds.settings.clients]]
id = "cec97416-12a4-4bc0-b1cd-92006383b123"
[inbounds.streamSettings]
network = "ws"
[inbounds.streamSettings.wsSettings]
path = "/wap6"

[[outbounds]]
sendThrough = "2400:8a20:112:1::305"
protocol = "freedom"
tag = "tag_1"

[[routing.rules]]
type = "field"
inboundTag = "tag_1"
outboundTag = "tag_1"

6、效果

在x-ui中添加一个入站,添加节点,即可通过warp

根据xrayL的配置,手动添加节点,即可通过直连ipv6访问

暂无评论

发送评论 编辑评论


				
上一篇
下一篇