Linux使用V2Ray 原生客户端

jupiter
2021-10-26 / 16 评论 / 8,552 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2021年12月07日,已超过1432天没有更新,若内容或图片失效,请留言反馈。

Linux使用V2Ray 原生客户端

1、下载二进制文件

官方下载链接:https://github.com/v2fly/v2ray-core/releases

2、配置客户端

cd ~
wget https://github.com/v2fly/v2ray-core/releases/download/v4.31.0/v2ray-linux-64.zip
unzip -d v2ray-cli v2ray-linux-64.zip
cd v2ray-cli/
chmod +x v2ray v2ctl
vim config.json

config.json 客户端配置

{
  "log": {
    "loglevel": "info"
  },
  "inbounds": [
    {
      "port": 1080,
      "protocol": "socks",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "settings": {
        "udp": true // 开启 UDP 协议支持
      }
    },
    {
      "port": 10809,
      "protocol": "http",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      }
    }
  ],
  "outbounds": [
    {
      "tag": "proxy-vmess",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "nas.inat.top", // 服务器的 IP
            "port": 53689, // 服务器的端口
            "users": [
              {
                // id 就是 UUID,相当于用户密码
                "id": "77ba2a7d-3e1d-486c-a2f5-c8718d3d1560",
                "alterId": 10
              }
            ]
          }
        ]
      }
    },
    {
      "tag": "direct",
      "settings": {},
      "protocol": "freedom"
    }
  ],
  "dns": {
    "server": [
      "8.8.8.8",
      "1.1.1.1"
    ],
    // 你的 IP 地址,用于 DNS 解析离你最快的 CDN
    "clientIp": "202.113.37.69"
  },
  // 配置路由功能
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [
      {
        "type": "field",
        "domain": [
          "cnblogs.com"
        ],
        "outboundTag": "proxy-vmess"
      },
      {
        "type": "field",
        "domain": [
          "domain:inat.top"
        ],
        "outboundTag": "direct"
      }
    ]
  }
}

测试配置文件

./v2ray -test config.json

3. 启动客户端

screen -S v2ray
./v2ray -v2ray config.json

4. 测试代理

curl -x http://127.0.0.1:10809 www.baidu.com

参考资料

  1. 记录:Linux下 V2Ray 原生客户端配置
  2. 在 v2ray 中同时开启 socks 和 http 代理
0

评论 (16)

打卡
取消
  1. 头像
    xiyynaqdrf
    Windows 10 · Google Chrome

    真棒!

    回复
  2. 头像
    ycadlmsdfv
    Windows 10 · Google Chrome

    作者以简洁明了的语言,传达了深刻的思想和情感。

    回复
  3. 头像
    lhzlaoabti
    Windows 10 · Google Chrome

    代码示例规范,注释详细,便于复现。

    回复
  4. 头像
    setdpbfxbc
    Windows 10 · Google Chrome

    建议补充性能优化方案,增强实用性。

    回复
  5. 头像
    kchvivjjbp
    Windows 10 · Google Chrome

    立意高远,以小见大,引发读者对社会/人性的深层共鸣。

    回复
  6. 头像
    chfbjjwwjd
    Windows 10 · Google Chrome

    ?励志类评语?

    回复
  7. 头像
    jxfmzxkqyr
    Windows 10 · Google Chrome

    作者以简洁明了的语言,传达了深刻的思想和情感。

    回复
  8. 头像
    lrghhuttuh
    Windows 10 · Google Chrome

    独特的构思和新颖的观点,让这篇文章在众多作品中脱颖而出。

    回复
  9. 头像
    jeuvvvjwkd
    Windows 10 · Google Chrome

    选材新颖独特,通过细节描写赋予主题鲜活生命力。

    回复
  10. 头像
    tmvjckxiic
    Windows 10 · Google Chrome

    理论深度可再挖掘,以提升文章厚重感。

    回复
  11. 头像
    fdyxltcqah
    Windows 10 · Google Chrome

    文字流畅如丝,语言优美动人,读来令人心旷神怡。

    回复
  12. 头像
    qvwxtumcus
    Windows 10 · Google Chrome

    这篇文章不错!

    回复
  13. 头像
    efymjwyjxp
    Windows 10 · Google Chrome

    2025年10月新盘 做第一批吃螃蟹的人coinsrore.com

    回复
  14. 头像
    uutlpkbfxf
    Windows 10 · Google Chrome

    新车上路,只带前10个人

    回复
  15. 头像
    rucruwdahv
    Windows 10 · Google Chrome

    2025年10月新盘 做第一批吃螃蟹的人coinsrore.com
    新车新盘 嘎嘎稳 嘎嘎靠谱coinsrore.com
    新车首发,新的一年,只带想赚米的人coinsrore.com
    新盘 上车集合 留下 我要发发 立马进裙coinsrore.com
    做了几十年的项目 我总结了最好的一个盘(纯干货)coinsrore.com
    新车上路,只带前10个人coinsrore.com
    新盘首开 新盘首开 征召客户!!!coinsrore.com
    新项目准备上线,寻找志同道合 的合作伙伴coinsrore.com
    新车即将上线 真正的项目,期待你的参与coinsrore.com
    新盘新项目,不再等待,现在就是最佳上车机会!coinsrore.com
    新盘新盘 这个月刚上新盘 新车第一个吃螃蟹!coinsrore.com

    回复
  16. 头像

    果博东方客服开户联系方式【182-8836-2750—】?薇- cxs20250806】
    果博东方公司客服电话联系方式【182-8836-2750—】?薇- cxs20250806】
    果博东方开户流程【182-8836-2750—】?薇- cxs20250806】
    果博东方客服怎么联系【182-8836-2750—】?薇- cxs20250806】

    回复