0%

梯子工具-v2ray安装配置

服务器端v2ray安装脚本(速度优先)

v2ray 官网:https://www.v2ray.com
脚本开源地址: https://github.com/233boy/v2ray

安装
1
2
3
4
wget https://install.direct/go.sh
#因为centos不支持apt-get,我们需要安装unzip,
yum install -y zip unzip
sudo bash go.sh
升级
1
v2ray update
服务启动
1
2
3
4
5
6
7
8
## 启动
sudo systemctl start v2ray

## 停止
sudo systemctl stop v2ray

## 重启
sudo systemctl restart v2ray
解决 v2ray invalid user: VMessAEAD

修改文件:

1
vi /etc/systemd/system/v2ray.service

将 Execstart 这一行改为:

1
ExecStart=/usr/bin/env v2ray.vmess.aead.forced=false /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json

然后重启

1
2
systemctl daemon-reload
systemctl restart v2ray
服务的配置文件
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
vim /etc/v2ray/config.json
{
#服务的配置
"inbounds": [
{
"port": 1758,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e1dd0ae3-9f42-4375-a6b9-35c71b817c89",
"level": 1,
"alterId": 64
}
]
}
},
{
"port": 444,
"protocol": "shadowsocks",
"settings": {
"method": "aes-256-cfb",
"password": "ss密码"
}
}
],
"outbounds": [{
"protocol": "freedom",
"settings": {}
},{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}],
"routing": {
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "blocked"
}
]
}

客户端命令行配置
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
48
49
50
51
52
53
54
vim /etc/v2ray/config.json
{
"log": {
"loglevel": "debug",
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log"
},
"inbounds": [{
"port": 1081,
"protocol": "http",
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"settings": {
"auth": "noauth",
"udp": false
}
},{
"port": 1080,
"listen": "127.0.0.1",
"tag": "socks-inbound",
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": false,
"ip": "127.0.0.1"
},
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
}
}],
"outbounds": [{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "144.34.187.61", // 服务器的 IP
"port": 17584, // 服务器的端口
"users": [
{
// id 就是 UUID,相当于用户密码
"id": "e1dd0ae3-9f42-4375-a6b9-35c71b817c89",
"alterId": 64
}
]
}
]
},
"tag": "vmess"
}
]
}