Ubuntu 18.04 安装配置VaRay客户端

安装脚本

bash <(curl -L -s https://install.direct/go.sh)

脚本安装完毕后未自动启动,需要配置相关文件
相关配置文件如下:

/usr/bin/v2ray/v2ctl:V2Ray 工具,用于给程序自身调用
/usr/bin/v2ray/v2ray:V2Ray 核心程序
/etc/v2ray/config.json:配置文件
/usr/bin/v2ray/geoip.dat:IP 数据文件,V2Ray 路由功能时有用,下同
/usr/bin/v2ray/geosite.dat:域名数据文件

作为客户端,只需配置/etc/v2ray/config.json文件即可。

配置文件

{
  "log": {
    "loglevel": "info"
  },
  "inbounds": [
    {
      "port": 1080,
      "protocol": "socks",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "settings": {
        "udp": true // 开启 UDP 协议支持
      }
    },
    {
      "port": 8080,
      "protocol": "http",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      }
    }
  ],
  "outbounds": [
    {
      "tag": "proxy-vmess",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "8.8.8.8", // 服务器的 IP
            "port": 443, // 服务器的端口
            "users": [
              {
                // id 就是 UUID,相当于用户密码
                "id": "7d4c4078-e129-416b-a483-cf5713a96a66",
                "alterId": 4
              }
            ]
          }
        ]
      }
    },
    {
      "tag": "direct",
      "settings": {},
      "protocol": "freedom"
    }
  ],
  "dns": {
    "server": [
      "8.8.8.8",
      "1.1.1.1"
    ],
    // 你的 IP 地址,用于 DNS 解析离你最快的 CDN
    "clientIp": "203.208.40.63"
  },
  // 配置路由功能,绕过局域网和中国大陆地址
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [
      {
        "type": "field",
        "domain": [
          // 默认跳过国内网站,如果想要代理某个国内网站可以添加到下列列表中
          "cnblogs.com"
        ],
        "outboundTag": "proxy-vmess"
      },
      {
        "type": "field",
        "domain": [
          "geosite:cn"
        ],
        "outboundTag": "direct"
      },
      {
        "type": "field",
        "outboundTag": "direct",
        "ip": [
          "geoip:cn",
          "geoip:private"
        ]
      }
    ]
  }
}

参考资料

V2Ray完全使用教程

作者:Seeker  创建时间:2019-04-21 16:39
 更新时间:2019-04-22 12:14