Lede运行v2ray

LEDE 运行v2ray不完美的解决办法

从官网下载v2ray的运行文件放在/usr/bin/v2ray 目录下
v2ray release 下载

将config.json(或者你直接改名为v2ray.json)文件放在/etc/v2ray.json
将 /usr/bin/v2ray 和 /etc/v2ray.json 文件赋予权限 直接猛点的权限赋值方法 chomd 777 path

1
/usr/bin/v2ray --config /etc/v2ray.json

对应修改config.json文件后传到自己的lede的对应的目录中去
然后在网络设置中–代理—网页代理,安全网络代理中添加 你的路由器ip e.g. 192.168.1.111 加上对应的端口 1080;socks的代理配置同理

如果inbound 中的protocol: socks,需要在settings中增加 “auth”: “noauth”

1
2
3
4
5
6
"inbound": {
"port": 1080,
"protocol": "socks",
"settings": {
"auth": "noauth"
}
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"log": {
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 1080,
"protocol": "http",
"settings": {}
},
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "v2ray.cool",
"port": 10086,
"users": [
{
"id": "a3482e88-686a-4a58-8126-99c9df64b7bf",
"alterId": 64,
"security": "auto"
}
]
}
]
},
"mux": {
"enabled": true
}
},
"outboundDetour": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}
],
"dns": {
"servers": [
"8.8.8.8",
"8.8.4.4",
"localhost"
]
},
"routing": {
"strategy": "rules",
"settings": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"port": "1-52",
"outboundTag": "direct"
},
{
"type": "field",
"port": "54-79",
"outboundTag": "direct"
},
{
"type": "field",
"port": "81-442",
"outboundTag": "direct"
},
{
"type": "field",
"port": "444-65535",
"outboundTag": "direct"
},
{
"type": "chinasites",
"outboundTag": "direct"
},
{
"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": "direct"
},
{
"type": "chinaip",
"outboundTag": "direct"
}
]
}
}
}

最新更新2017 8.16

https://github.com/v2ray/v2ray-core/issues/483
用otaku的一段代码实现了v2ray的进程守护

还是放在 /etc/init.d/v2ray

1
2
3
4
5
6
7
8
9
10
11
12
13
14
START=90
USE_PROCD=1
start_service() {
mkdir /var/log/v2ray > /dev/null 2>&1
procd_open_instance
procd_set_param respawn
procd_set_param command /usr/bin/v2ray -config /etc/v2ray/config.json
procd_set_param file /etc/v2ray/config.json
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param pidfile /var/run/v2ray.pid
procd_close_instance
}