colynn / colynn.github.io

Colynn's Blog
https://colynn.github.io
2 stars 0 forks source link

v2ray 配置安装归档 #13

Open colynn opened 4 years ago

colynn commented 4 years ago

脚本安装

服务端

  1. 下载脚本
    $ wget https://install.direct/go.sh

注意: 该脚本仅可以在 Debian 系列或者支持 Systemd 的 Linux 操作系统使用。

  1. 执行脚本安装 V2Ray

    $ sudo bash go.sh

    注意归档显示的 PORTUUID也可在 /etc/v2ray/config.json内查看。

  2. 启动V2Ray

$ sudo systemctl start v2ray

客户端

在你的 PC (或手机)中,你需要运行 V2Ray 并使用下面的配置:

{
  "inbounds": [{
    "port": 1080,  // SOCKS 代理端口,在浏览器中需配置代理并指向这个端口
    "listen": "127.0.0.1",
    "protocol": "socks",
    "settings": {
      "udp": true
    }
  }],
  "outbounds": [{
    "protocol": "vmess",
    "settings": {
      "vnext": [{
        "address": "server", // 服务器地址,请修改为你自己的服务器 ip 或域名
        "port": 10086,  // 服务器端口
        "users": [{ "id": "b831381d-6324-4d53-ad4f-8cda48b30811" }]
      }]
    }
  },{
    "protocol": "freedom",
    "tag": "direct",
    "settings": {}
  }],
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [{
      "type": "field",
      "ip": ["geoip:private"],
      "outboundTag": "direct"
    }]
  }
}

上述配置唯一要改的地方就是你的服务器 IP,配置中已注明。上述配置会把除了局域网(比如访问路由器)之外的所有流量转发到你的服务器。

最后 配置浏览器

推荐使用 Proxy SwitchyOmega

: 设置时Protocol 选择SocketV5 , ServerPort也就是你的客户端 inbounds内的配置。

Refer to

  1. https://www.v2ray.com/chapter_00/start.html
  2. https://toutyrater.github.io/prep/install.html