A free cross-platform tool that helps you encrypt network traffic and bypass interference from network providers.
I. Features
The V2Ray project, as software, is permanently free;
Cross-platform, currently supports Windows, Mac OS X, and Linux, with support for iOS and Android to be added in the future;
No installation required; the release package contains only one application and one configuration file, and can run immediately after download without relying on third-party tools;
Flexible configuration; the client and server share the same application, and different effects can be achieved by using different configuration files.
II. How it works
It works basically the same as SS, using an encrypted protocol to connect to a remote server and bypass the firewall, so both the server and client need to be configured.

III. Server configuration
Debian / Ubuntu
1. Install unzip and curl
apt-get update
apt-get install unzip
apt-get install curl
For centos6 and centos7, you need to open the port you want to set before it can be used
centos 6
iptables centos6 firewall
Start/stop/restart the firewall
If you do not want anything too complicated, you can simply disable the firewall directly
Enable firewall (takes permanent effect after reboot):chkconfig iptables on
Disable firewall (takes permanent effect after reboot):chkconfig iptables off
Enable firewall (takes effect immediately, invalid after reboot):service iptables start
Disable firewall (takes effect immediately, invalid after reboot):service iptables stop
Restart firewall:service iptables restartd
.View open ports
/etc/init.d/iptables status Open a port (using 8080 as an example) Open port iptables -A INPUT -p tcp --dport 8080 -j ACCEPT Save and restart the firewall /etc/rc.d/init.d/iptables save /etc/init.d/iptables restart To open ports between 49152 and 65534, you can enter iptables -A INPUT -p tcp --dport 49152:65534 -j ACCEPT
Likewise, you need to save the settings here and restart the firewall.
centos7
# firewall-cmd –zone=public
–add-port=65443/tcp –permanent
//permanently add port 65443 to the allowed rules
# firewall-cmd –zone=public –list-ports
//display the list of open ports
65442/tcp 65443/tcp
# firewall-cmd –reload
2. Then run the following command to download and install V2Ray:
curl -L -s https://raw.githubusercontent.com/v2ray/v2ray-core/master/release/install-release.sh | bash
This will install it automatically and configure the auto-start script.
V2Ray installation directory: /usr/bin/v2ray/
Configuration file path: /etc/v2ray/config.json
Open the V2Ray configuration file vi
/etc/v2ray/config.json
Here you mainly need to change “port” and “id”; the script will generate them automatically.
Of course, you can also set your own port and ID.
PS: PROT is the port number.
The ID is like the Shadowsocks password; vmess is where v2RAY differs from SHADOWSOCKS.
Log file: /var/log/v2ray/access.log
Commands: service v2ray
start|stop|status|reload|restart|force-reload
For example, after the system is installed service v2ray start
Start
If you changed the configuration yourself service v2ray restart
Restart
3. Edit the configuration file vi /etc/v2ray/config.json
{
"port": 12286, #Port, set it yourself
"log" : {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "d41f12d9-6d69-4f8c-8fa7-13c5e1a7c2f7", #User ID
"level": 1
}
]
}
}
The password-like line after the user ID is the UUID, which functions the same as an SS password.
You can generate it through the website; to configure multiple users, just add multiple lines.
{
"id": "d41f12d9-6d69-4f8c-8fa7-13c5e1a7c2f7",
"id": "5c84ab74-111a-450a-94c8-78a9c6113fe3",
"id": "a0a4f9ad-2149-4e28-9fe8-498017406c9f",
"level": 1
}
4. Start the server
service v2ray start
Afterward, you can use service v2ray
start|stop|status|reload|restart|force-reload to control V2Ray
operation
2. Client Configuration
First, you need to download the client software: https://github.com/v2ray/v2ray-core/releases
For example, I use Windows 64-bit, so I can download v2ray-windows-64.zip
Then download the client launcher software: https://www.v2ray.com/chapter_01/3rd_party.html
For Windows, you can download v2ray-taskbar:
https://github.com/kxjhlele/v2ray-taskbar/releases/download/0.2/v2ray-taskbar.zip
Extract the above two compressed files into the same folder:
Open config.json to start configuring the client:
|
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
33
|
{
“log”:
{
“loglevel”:
“warning”
},
“inbound”:
{
“port”:
2000, // Local proxy port
“listen”:
“127.0.0.1”, // Local IP
“protocol”:
“socks”, // Local proxy protocol
“settings”:
{
“auth”:
“noauth”, // No authentication
“udp”:
false,
“ip”:
“127.0.0.1”
}
},
“outbound”:
{
“protocol”:
“vmess”, // Primary outbound protocol, must match the server’s inbound protocol
“settings”:
{
“vnext”:
[
{
“address”:
“10.10.10.10”, // The server’s IP address
“port”:
38154, // The server port
“users”:
[
{
“id”:
“bccc0885-048a-4d5f-ae90-5fa3117fe30d”, // ID, same as the server
“alterId”:
64 // Same as the server
}
]
}
]
}
},
......
}
|
By default, the SOCKS protocol is used. You can find its documentation here: https://www.v2ray.com/chapter_02/protocols/socks.html
After the configuration is complete, double-click v2ray-taskbar.exe to start it. The following is the log:
|
1
2
3
|
V2Ray v2.0
(One for all) 20160820
A unified platform for
anti–censorship.
2016/09/15
22:11:58 [Warning]Point: started on port 2000 |
Then you can configure the proxy, for example, I configured SwitchyOmega in Chrome:
If you need automatic switching, please configure it yourself. Then switch the proxy to
v2ray and try accessing it. Configuration complete!
Using the Shadowsocks Protocol
v2ray is compatible with the Shadowsocks
protocol. After configuring it, it is equivalent to having an additional Shadowsocks server.
1. Server-side Configuration
Open the configuration file again:
|
1
|
vi
/etc/v2ray/config.json |
You can keep the file’s default protocol section, then add the extended configuration after inbound
( Note: please delete the explanatory comments yourself ):
|
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
{
“log”
: {
“access”:
“/var/log/v2ray/access.log”,
“error”:
“/var/log/v2ray/error.log”,
“loglevel”:
“warning”
},
“inbound”:
{
“port”:
38154,
“protocol”:
“vmess”,
“settings”:
{
“clients”:
[
{
“id”:
“bccc0885-048a-4d5f-ae90-5fa3117fe30d”,
“level”:
1,
“alterId”:
64
}
]
}
},
// The following content is added
“inboundDetour”:
[ // Extended inbound connections
{
“protocol”:
“shadowsocks”, // Enable the Shadowsocks protocol
“port”:
30001, // Listen on port 30001
“settings”:
{
“method”:
“aes-256-cfb”, // Encryption method, supports aes-256-cfb, aes-128-cfb, chacha20, chacha20-ietf
“password”:
“v2ray”, // Password, must be the same as the client
“udp”:
false // Whether to enable UDP forwarding
}
},
{
“protocol”:
“shadowsocks”, // Enable the Shadowsocks protocol
“port”:
30002, // Listen on port 30002. Due to Shadowsocks limitations, with multiple users you can only open multiple ports
“settings”:
{ // The configuration is similar to the above
“method”:
“aes-256-cfb”,
“password”:
“v2ray-2”,
“udp”:
false
}
}
],
// The above is the added content
“outbound”:
{
“protocol”:
“freedom”,
“settings”:
{}
},
......
}
|
In the configuration file, I enabled two Shadowsocks-compatible ports:
30001 and 30002. For other details, see this page:
https://www.v2ray.com/chapter_02/protocols/shadowsocks.html
Restart the v2ray server:
|
1
|
service v2ray restart
|
2. Client Configuration
The client can directly use a Shadowsocks or ShadowsocksR client.
Once everything is configured, switch the Shadowsocks proxy to this server and test it.
5. Firefox Settings
The machine’s time is very important, so please keep the time synchronized
If you cannot connect, use the sudo dpkg-reconfigure
tzdata command to change the time zone from the United States to Hong Kong
Of course, v2ray supports one-click BBR acceleration, which can reduce and prevent packet loss. This site has a one-click BBR tutorial.


