V2Ray 配置ss & vmess

V2Ray 配置文件设置

满足VMESS & SS协议

安装步骤

1 (以搬瓦工的Center OS 7 bbr)先用ssh登录

1
ssh root@162.219.121.23x -p 27530

2 Bash命令安装

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

3 编辑服务端配置文件满足VMESS & SS协议

1
vi /etc/v2ray/config.json
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
"log" : {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 21059,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "7ce007bc-47ea-45c1-9294-e37168186c4e",
"level": 1,
"alterId": 64
}
]
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"inboundDetour": [
{
"protocol": "shadowsocks",
"port": 21058,
"settings": {
"method": "aes-256-cfb",
"password": "v2ray",
"udp": false
}
}
],
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "blocked"
}
]
}
}
}

配置文件设置好后,可以用命令测试

1
./v2ray --test --config v2ray-client.json

启动相关命令

  1. 编辑 /etc/v2ray/config.json 文件来配置你需要的代理方式;

  2. 运行 service v2ray start 来启动 V2Ray 进程;

  3. 之后可以使用 service v2ray start|stop|status|reload|restart|force-reload 控制 V2Ray 的运行

1
service v2ray status | start ...

注意事项:

以上配置适用于root权限下操作,若由于权限不足请自行搜索解决

如果遇到ssh无法登录的情况,可以先rm ~/.ssh/xxx 对应的文件然后再重新连接

uuid生成网站

路由追踪

配置生成器

这个配置生成只有一种协议,如果要支持多种协议,请参考上面贴出的code,分别为 inbound inboundDetour