OSDN Git Service

README: update install instruction
[v2raya/v2raya-openwrt.git] / README.zh-cn.md
1 # v2raya-openwrt
2
3 适用于 OpenWrt 用户的 v2rayA opkg 软件源。
4
5 [English](README.md)
6
7 ## 安装方法
8
9 1. 导入 v2rayA 签名文件
10
11    > 请确认软件包 `wget-ssl` 已经正确地安装在您的设备上
12
13    ```sh
14    wget https://osdn.net/projects/v2raya/storage/openwrt/v2raya.pub -O /etc/opkg/keys/94cc2a834fb0aa03
15    ```
16
17 2. 添加 v2rayA 软件源
18
19    ```sh
20    echo "src/gz v2raya https://osdn.net/projects/v2raya/storage/openwrt/$(. /etc/openwrt_release && echo "$DISTRIB_ARCH")" | tee -a "/etc/opkg/customfeeds.conf"
21
22    # 日本镜像
23    # echo "src/gz v2raya https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/v/v2/v2raya/openwrt/$(. /etc/openwrt_release && echo "$DISTRIB_ARCH")" | tee -a "/etc/opkg/customfeeds.conf"
24    # 美国镜像
25    # echo "src/gz v2raya https://mirrors.gigenet.com/OSDN/storage/g/v/v2/v2raya/openwrt/$(. /etc/openwrt_release && echo "$DISTRIB_ARCH")" | tee -a "/etc/opkg/customfeeds.conf"
26    ```
27
28 3. 更新软件源
29
30    ```sh
31    opkg update
32    ```
33
34 4. 安装 v2rayA 及其依赖
35
36    ```sh
37    opkg install v2raya
38
39    # 检查你的防火墙实现
40    # 为基于 nftables 的 firewall4 (command -v fw4) 安装下列软件包
41    # 一般来说,在 OpenWrt 22.03 或更新版本中安装它们
42    opkg install kmod-nft-tproxy
43    # 为基于 iptables 的 firewall3 (command -v fw3) 安装下列软件包
44    # 一般来说,在 OpenWrt 21.02 或更早版本中安装它们
45    opkg install iptables-mod-conntrack-extra \
46      iptables-mod-extra \
47      iptables-mod-filter \
48      iptables-mod-tproxy \
49      kmod-ipt-nat6
50
51    # 选择一个你喜欢的内核,v2ray 或 Xray
52    # 如果两个内核被同时安装,默认使用后者
53    #
54    # 维护者注:由于目前 v2ray 的透明代理支持欠佳,因此更推荐使用 Xray
55    opkg install xray-core
56    # opkg install v2ray-core
57
58    # 可选
59    # opkg install v2fly-geoip v2fly-geosite
60    ```
61
62 ## 使用方法
63
64 - 方法一:通过 LuCI 界面配置(仅适用于 __OpenWrt 21.02 或更高版本__)
65
66    1. 安装 LuCI app
67       ```sh
68       opkg install luci-app-v2raya luci-i18n-v2raya-zh-cn
69       ```
70
71    2. 访问 `http://<your_router_ip>/cgi-bin/luci/admin/services/v2raya` 并完成配置。
72
73 - 方法二:通过命令行配置
74
75    1. 配置 v2rayA
76
77       ```sh
78       # 详细配置请参见 /etc/config/v2raya
79       uci set v2raya.config.enabled='1'
80       uci commit v2raya
81       ```
82
83    2. 启动 v2rayA
84
85       ```sh
86       /etc/init.d/v2raya start
87       ```
88
89    3. 访问 v2rayA webUI 面板并完成设置
90
91       `http://<your_router_ip>:2017`