Post

Note for V2ray

Note for V2ray

Server installation

Install on the server.

1
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

Check the status and the config.json file path.

1
sudo systemctl status v2ray

Update /usr/local/etc/v2ray/config.json content, you can change the port and id settings. id could be regenerated at https://www.uuidgenerator.net/ with version 4.

1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "inbounds": [{
    "port": 10086,
    "protocol": "vmess",
    "settings": {
      "clients": [{ "id": "56a4a6c0-b60e-4225-9738-da0a9eb37bd7" }]
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  }]
}

Restart v2ray.

1
sudo systemctl restart v2ray

Client installation

Download client at https://github.com/v2ray/v2ray-core/releases.

Update config.json content.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "inbounds": [{
    "port": 1080,  // local proxy port
    "listen": "127.0.0.1",
    "protocol": "socks",
    "settings": {
      "udp": true
    }
  }],
  "outbounds": [{
    "protocol": "vmess",
    "settings": {
      "vnext": [{
        "address": "server", // server address
        "port": 10086,  // remote server port
        "users": [{ "id": "56a4a6c0-b60e-4225-9738-da0a9eb37bd7" }]
      }]
    }
  },{
    "protocol": "freedom",
    "tag": "direct",
    "settings": {}
  }],
  "routing": {
    "domainStrategy": "IPOnDemand",
    "rules": [{
      "type": "field",
      "ip": ["geoip:private"],
      "outboundTag": "direct"
    }]
  }
}

Start the v2ray client.

1
./v2ray

Tips

  • Change the firewall policy if the port is not reachable with command sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT.
This post is licensed under CC BY 4.0 by the author.