Skip to content

Commit a12450f

Browse files
committed
openwrt.md: update install instructions
Signed-off-by: Tianling Shen <i@cnsztl.eu.org>
1 parent 2acbdb4 commit a12450f

2 files changed

Lines changed: 101 additions & 86 deletions

File tree

content/en/docs/prologue/installation/openwrt.md

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: OpenWrt
33
description: Install V2Ray core and v2rayA
4-
lead: The function of v2rayA depends on V2Ray core, so it needs to be installed.
4+
lead: The function of v2rayA depends on V2Ray core, so it needs to be installed firstly.
55
date: '2020-11-16 13:59:39 +0100'
66
lastmod: '2020-11-16 13:59:39 +0100'
77
draft: 'false'
@@ -13,57 +13,74 @@ weight: '15'
1313
toc: 'true'
1414
---
1515

16-
## Install from v2rayA self-built software source
16+
## Install v2rayA via our self-hosted opkg feed (recommended)
1717

18-
refer to:
18+
Please move to [v2raya/v2raya-openwrt](https://github.com/v2raya/v2raya-openwrt).
1919

20-
1. [v2rayA for OpenWrt repository Homepage](https://github.com/v2raya/v2raya-openwrt)
20+
## Install v2rayA via official OpenWrt feed
2121

22-
2. [OSDN Homepage](https://osdn.net/projects/v2raya/)
23-
24-
You can use open source mirror sites that reverse proxy OSDN to speed up downloads.
25-
26-
## Install from OpenWrt official repositories
27-
28-
{{% notice info %}} Currently only the latest snapshot version of openWrt contains v2rayA in the software source. Users of this version can install it directly from the software source. {{% /notice %}}
22+
{{% notice info %}}
23+
v2rayA has been merged into official OpenWrt since OpenWrt 21.02 stable release.
24+
{{% /notice %}}
2925

3026
```bash
3127
opkg update
3228
opkg install v2raya
3329
```
3430

35-
{{% notice note %}} Since there is no `v2ray-core` in the `xray-core` will be installed as a dependency. If you plan to use v2ray then you need to install it manually. In the presence of both v2ray and xray, v2rayA will take precedence over the former. {{% /notice %}}
31+
{{% notice note %}}
32+
Due to poor dependencies management provided by opkg, v2rayA depends to Xray by default.
33+
34+
If you like V2Ray, you may install v2rayA with addtional argument `--nodeps` (Do not follow dependencies) and install all other necessary dependencies by yourself.
35+
36+
If you have both V2Ray and Xray installed, v2rayA will use the latter by default.
37+
{{% /notice %}}
38+
39+
## Install v2rayA manually
40+
41+
### Install V2Ray / Xray core
3642

37-
## Manual installation
43+
{{% notice info %}}
44+
Package `xray-core` has been available since OpenWrt 21.02 stable release.
3845

39-
### Install V2Ray Kernel / Xray Kernel
46+
Package `v2ray-core` has been available since OpenWrt 22.03 stable release.
47+
{{% /notice %}}
4048

41-
First install the packages `unzip` and `wget` , then download the v2ray kernel from [Github Releases](https://github.com/v2fly/v2ray-core/releases) and save it to `/usr/bin` , and finally give the binary executable permission.
49+
First install packages `unzip` and `wget-ssl`, then download v2ray-core and move it to `/usr/bin/` \(precompiled builds can be found in [v2ray-core/releases](https://github.com/v2fly/v2ray-core/releases)\), and finally give the binary file executable permission.
4250

4351
E.g:
4452

4553
```bash
4654
opkg update; opkg install unzip wget-ssl
47-
wget https://github.com/v2fly/v2ray-core/releases/download/v4.40.1/v2ray-linux-64.zip
48-
unzip -d v2ray-core v2ray-linux-64.zip
49-
cp v2ray-core/v2ray v2ray-core/v2ctl /usr/bin
50-
chmod +x /usr/bin/v2ray; chmod +x /usr/bin/v2ctl
55+
wget https://github.com/v2fly/v2ray-core/releases/download/v4.40.1/v2ray-linux-64.zip -P /tmp
56+
unzip -d /tmp/v2ray-core /tmp/v2ray-linux-64.zip
57+
cp /tmp/v2ray-core/v2ray /usr/bin/
58+
chmod +x /usr/bin/v2ray
59+
rm -rf /tmp/v2ray-linux-64.zip /tmp/v2ray-core
5160
```
5261

53-
{{% notice note %}} **keep** your eyes open Pay extra attention to the architecture of your OpenWrt device, don't download a version that doesn't work for your device, or the kernel won't work. {{% /notice %}}
62+
Xray-core can be installed in a similar way.
63+
64+
{{% notice note %}} **Be careful**
65+
66+
Pay special attention to the architecture of your device: do not download a binary which is incompatible with it, otherwise the binary will not work.
67+
{{% /notice %}}
5468

5569
### Install v2rayA
5670

57-
{{% notice info %}} For users who do not have v2rayA in the software source, you can find the ipk file suitable for your architecture from [here](https://downloads.openwrt.org/snapshots/packages) to install, or you can install it manually as follows. {{% /notice %}}
71+
#### Install required dependencies:
5872

59-
Download the latest version of the binaries for the processor architecture from [Github Releases](https://github.com/v2rayA/v2rayA/releases) , then move to `/usr/bin` and give execute permissions:
73+
For OpenWrt 22.03 and higher version:
6074

6175
```bash
62-
wget https://github.com/v2rayA/v2rayA/releases/download/v$version/v2raya_linux_$arch_$version --output-document v2raya
63-
mv v2raya /usr/bin/v2raya && chmod +x /usr/bin/v2raya
76+
opkg update
77+
opkg install \
78+
ca-bundle \
79+
ip-full \
80+
kmod-nft-tproxy
6481
```
6582

66-
### Install dependencies and kernel modules
83+
For OpenWrt 21.02 and lower version:
6784

6885
```bash
6986
opkg update
@@ -77,43 +94,30 @@ opkg install \
7794
kmod-ipt-nat6
7895
```
7996

80-
### Create configuration and service files
81-
82-
`/etc/config/v2raya` reference [here](https://raw.githubusercontent.com/openwrt/packages/master/net/v2raya/files/v2raya.config) .
97+
#### Download v2rayA binary
8398

84-
`/etc/init.d/v2raya` reference [here](https://raw.githubusercontent.com/openwrt/packages/master/net/v2raya/files/v2raya.init) .
99+
Download the precompiled binary file corresponding to the processor architecture from [Github Releases](https://github.com/v2rayA/v2rayA/releases), and give it executable permission.
85100

86-
Give this file executable permissions:
101+
E.g.:
87102

88103
```bash
89-
chmod +x /etc/init.d/v2raya
104+
wget https://github.com/v2rayA/v2rayA/releases/download/v2.0.5/v2raya_linux_x64_2.0.5 -O /usr/bin/v2raya
105+
chmod +x /usr/bin/v2raya
90106
```
91107

92-
## run v2rayA
93-
94-
### Enable v2rayA service
108+
#### Download v2rayA service files
95109

96110
```bash
97-
uci set v2raya.config.enabled='1'
98-
uci commit v2raya
111+
wget https://raw.githubusercontent.com/openwrt/packages/master/net/v2raya/files/v2raya.config -O /etc/config/v2raya
112+
wget https://raw.githubusercontent.com/openwrt/packages/master/net/v2raya/files/v2raya.init -O /etc/init.d/v2raya
113+
chmod +x /etc/init.d/v2raya
99114
```
100115

101-
### start v2rayA
116+
#### Enable and start the service
102117

103118
```bash
119+
uci set v2raya.config.enabled='1'
120+
uci commit v2raya
121+
/etc/init.d/v2raya enable
104122
/etc/init.d/v2raya start
105123
```
106-
107-
## Some tips
108-
109-
### PPPoE dial-up problem
110-
111-
If you are dial-up via PPPoE, then you may experience the failure of v2rayA's transparent proxy to have no network connection after a period of time. As a workaround, when using v2rayA, do not delete or replace the "Network &gt; Interface" default WAN connection (which uses the DHCP protocol), but instead create a new interface for dialing. **The newly created PPPoE dial-up interface needs to be added to the firewall zone named wan.**
112-
113-
### Some devices do not work
114-
115-
The [database module](https://github.com/boltdb/bolt) used by ~~v2rayA currently does not support MIPS-based chips. These devices (such as some cheap WiFi routers, domestic Loongson computers, etc.) may not be able to properly initialize the database, resulting in unusable use. ~~ This issue has been resolved in v1.5.9.1698.1 version.
116-
117-
Also, v2rayA cannot be enabled if the device flash space is too small. if you are in need, you can use `upx` to compress v2rayA and the core and try again.
118-
119-
Operating systems with incomplete kernel modules cannot enable transparent proxy. It is recommended to use the official OpenWrt distribution, or a third-party flavor called ImmortalWrt.
Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "OpenWrt"
3-
description: "安装内核和 v2rayA"
4-
lead: "v2rayA 的功能依赖于 V2Ray 内核,因此需要安装内核"
3+
description: "安装核心和 v2rayA"
4+
lead: "v2rayA 的功能依赖于 V2Ray 核心,需要安装后才能正常使用"
55
date: 2020-11-16T13:59:39+01:00
66
lastmod: 2020-11-16T13:59:39+01:00
77
draft: false
@@ -19,14 +19,12 @@ toc: true
1919

2020
1. [v2rayA for OpenWrt 仓库主页](https://github.com/v2raya/v2raya-openwrt)
2121

22-
2. [OSDN 主页](https://osdn.net/projects/v2raya/)
23-
24-
可以使用反向代理了 OSDN 的开源镜像站来加速下载。
22+
2. [v2rayA OSDN 主页](https://osdn.net/projects/v2raya/)
2523

2624
## 通过 OpenWrt 官方软件源安装
2725

2826
{{% notice info %}}
29-
目前只有 openWrt 最新的 snapshot 版本软件源中含有 v2rayA,使用此版本的用户可以直接从软件源安装
27+
v2rayA 软件包已被上游合并,使用 OpenWrt 21.02 或更高版本的用户可以直接从软件源安装
3028
{{% /notice %}}
3129

3230
```bash
@@ -35,15 +33,24 @@ opkg install v2raya
3533
```
3634

3735
{{% notice note %}}
38-
由于目前 openWrt 的软件源中没有 `v2ray-core`, `xray-core` 会作为依赖被安装。
39-
如果你打算使用 v2ray,那么你需要手动安装它。在同时存在 v2ray 与 xray 的情况下,v2rayA 将优先使用前者。
36+
由于包管理器 opkg 对依赖的处理方式欠佳,目前 v2rayA 默认依赖于 Xray-core。
37+
38+
如果你打算使用 V2Ray,可以在安装时加入 `--nodeps` 参数,并自行安装对应的依赖。
39+
40+
在同时存在 V2Ray 与 Xray 的情况下,v2rayA 将优先使用后者。
4041
{{% /notice %}}
4142

4243
## 手动安装
4344

44-
### 安装 V2Ray 内核 / Xray 内核
45+
### 安装 V2Ray / Xray 内核
46+
47+
{{% notice info %}}
48+
软件包 `xray-core`已在 OpenWrt 21.02 及之后的版本中可用。
49+
50+
软件包 `v2ray-core` 已在 OpenWrt 22.03 及之后的版本中可用。
51+
{{% /notice %}}
4552

46-
首先安装软件包 `unzip``wget`,然后从 [Github Releases](https://github.com/v2fly/v2ray-core/releases) 下载 v2ray 内核然后将其保存到 `/usr/bin`,最后给予二进制文件可执行权限
53+
首先安装软件包 `unzip``wget`,然后从 [Github Releases](https://github.com/v2fly/v2ray-core/releases) 下载 V2Ray 核心并将其保存到 `/usr/bin/`,最后赋予二进制文件可执行权限
4754

4855
例如:
4956

@@ -55,24 +62,28 @@ cp v2ray-core/v2ray v2ray-core/v2ctl /usr/bin
5562
chmod +x /usr/bin/v2ray; chmod +x /usr/bin/v2ctl
5663
```
5764

65+
Xray 核心可以用类似的方法安装。
66+
5867
{{% notice note %}} **擦亮眼睛**
59-
格外注意你的 OpenWrt 设备的架构,不要下载到不适用于你设备的版本,否则内核将无法运行。
68+
69+
格外注意你的 OpenWrt 设备的架构,不要下载到不适用于你设备的版本,否则核心将无法运行。
6070
{{% /notice %}}
6171

6272
### 安装 v2rayA
6373

64-
{{% notice info %}}
65-
对于软件源中没有 v2rayA 的用户,可以从 [此处](https://downloads.openwrt.org/snapshots/packages) 中寻找适合你架构的 ipk 文件进行安装,也可以直接按如下方式手动安装。
66-
{{% /notice %}}
74+
#### 安装依赖包与内核模块
6775

68-
[Github Releases](https://github.com/v2rayA/v2rayA/releases) 下载最新版本对应处理器架构的二进制文件,然后移动到 `/usr/bin` 并给予执行权限
76+
OpenWrt 22.03 或更新版本
6977

7078
```bash
71-
wget https://github.com/v2rayA/v2rayA/releases/download/v$version/v2raya_linux_$arch_$version --output-document v2raya
72-
mv v2raya /usr/bin/v2raya && chmod +x /usr/bin/v2raya
79+
opkg update
80+
opkg install \
81+
ca-bundle \
82+
ip-full \
83+
kmod-nft-tproxy
7384
```
7485

75-
### 安装依赖包与内核模块
86+
OpenWrt 21.02 或更早版本:
7687

7788
```bash
7889
opkg update
@@ -86,48 +97,48 @@ opkg install \
8697
kmod-ipt-nat6
8798
```
8899

89-
### 创建配置文件和服务文件
100+
#### 下载 v2rayA 二进制文件
90101

91-
`/etc/config/v2raya` 参考[此处](https://raw.githubusercontent.com/openwrt/packages/master/net/v2raya/files/v2raya.config)
102+
[Github Releases](https://github.com/v2rayA/v2rayA/releases) 下载最新版本对应处理器架构的二进制文件,然后移动到 `/usr/bin/` 并赋予可执行权限:
92103

93-
`/etc/init.d/v2raya` 参考[此处](https://raw.githubusercontent.com/openwrt/packages/master/net/v2raya/files/v2raya.init)
104+
```bash
105+
wget https://github.com/v2rayA/v2rayA/releases/download/v2.0.5/v2raya_linux_x64_2.0.5 -O v2raya
106+
mv v2raya /usr/bin/v2raya && chmod +x /usr/bin/v2raya
107+
```
94108

95-
给予此文件可执行权限:
109+
#### 下载配置文件和服务文件
96110

97111
```bash
112+
wget https://raw.githubusercontent.com/openwrt/packages/master/net/v2raya/files/v2raya.config -O /etc/config/v2raya
113+
wget https://raw.githubusercontent.com/openwrt/packages/master/net/v2raya/files/v2raya.init -O /etc/init.d/v2raya
98114
chmod +x /etc/init.d/v2raya
99115
```
100116

101-
## 运行
102-
103-
### 开启 v2rayA 服务
117+
#### 启用并运行 v2rayA
104118

105119
```bash
106120
uci set v2raya.config.enabled='1'
107121
uci commit v2raya
108-
```
109-
110-
### 启动 v2rayA
111-
112-
```bash
122+
/etc/init.d/v2raya enable
113123
/etc/init.d/v2raya start
114124
```
115125

116126
## 常见故障
117127

118128
### PPPoE 拨号问题
119129

120-
如果你通过 PPPoE 拨号上网,那么你可能会遇到 v2rayA 的透明代理开启一段时间后没有网络连接的故障。解决方法是,使用 v2rayA 的时候不要删除或替换“网络 > 接口”默认的 WAN 连接(该连接使用 DHCP 协议),而应该新建一个接口来进行拨号。**新建的 PPPoE 拨号接口需要添加到名为 wan 的防火墙区域。**
130+
~~如果你通过 PPPoE 拨号上网,那么你可能会遇到 v2rayA 的透明代理开启一段时间后没有网络连接的故障。解决方法是,使用 v2rayA 的时候不要删除或替换“网络 > 接口”默认的 WAN 连接(该连接使用 DHCP 协议),而应该新建一个接口来进行拨号。**新建的 PPPoE 拨号接口需要添加到名为 wan 的防火墙区域。**~~
131+
132+
该问题已经于 v2.0.2 及之后的版本中修复。
121133

122134
### 防止DNS污染对局域网设备不生效
123135

124136
编辑 "接口 -> LAN -> 使用自定义的 DNS 服务器" 为 "127.2.0.17" 即可让局域网内的其他设备也享受到 "防止DNS污染" 的效果
125137

126138
### 部分设备无法运行
127139

128-
~~v2rayA 所用的[数据库模块](https://github.com/boltdb/bolt)目前不支持基于 MIPS 的芯片,这部分设备(比如一些便宜的 WiFi 路由器、国产龙芯电脑等)可能无法正确初始化数据库,从而导致无法使用。~~
129-
该问题已经于 v1.5.9.1698.1 版本得到解决。
140+
~~v2rayA 所用的[数据库模块](https://github.com/boltdb/bolt)目前不支持基于 MIPS 的芯片,这部分设备(比如一些便宜的 Wi-Fi 路由器、国产龙芯电脑等)可能无法正确初始化数据库,从而导致无法使用。~~
130141

131-
另外,如果设备闪存空间太小,v2rayA 也会无法启用。有需要的朋友可以用 `upx` 压缩 v2rayA 与核心再试试
142+
该问题已经于 v1.5.9.1698.1 及之后的版本中修复
132143

133-
内核模块不全的操作系统无法开启透明代理,建议使用 OpenWrt 官方发行分支或者 ImmortalWrt 第三方分支
144+
内核模块不全的操作系统将无法按预期工作,建议使用官方 OpenWrt 或者第三方发行分支 ImmortalWrt。

0 commit comments

Comments
 (0)