OpenWrt How to install V2ray and V2ray installation luci-v2ray configuration detailed explanation

for How to configure V2Ray for OpenWrt soft router. V2ray is currently a relatively safe Internet proxy tool. Sometimes the application scenarios of V2ray are no longer satisfied with installing it on the computer. V2ray is built into the router, especially for some international online games. , a simple Internet access proxy can no longer meet the needs of games. The following describes how to use the proxy IP to access the Internet from the physical layer of the computer network card.

AR300M flash Openwrt system and install V2ray self-built game accelerator

The router used in this article's test is GL.iNet's AR300M router. The method of flashing the OpenWrt system on the router is similar. As long as your router supports the OpenWrt system and the router's memory is greater than 64MB, you can install the V2ray service.Serve.

Preparatory work before V2ray builds its own overseas game accelerator:

GL-AR300M router

Please note: This is not an advertisement, it is just a random introduction to a router with the openwrt system. Of course, you can choose any router that supports the openwrt system. Any router hardware that supports the openwrt system can perform the following operations.

It is a wireless broadband router suitable for IEEE802.11b /g /n standard, providing wireless transmission rate up to 300Mbps. This router is based on the OpenWRT open source platform, integrates router, wireless access point and other functions into one, and can be flexibly expanded.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

  • Interface: 1 WAN, 1 LAN, 1 USB2.0, 1 micro (Power), 1 Reset button, Mini PCIe, UART
  • CPU: QCA9531, @650MHz SoC
  • Storage: 128MB Nand DDR2 /16MB Nor FLASH
  • Protocol: 802.11 b/g/n
  • Wi-Fi speed: 300Mbps (2.4GHz)
  • Ethernet port: 10/100M
  • LED: Wi-Fi/power status indication
  • Working temperature: 0 ~ 40°C
  • Storage temperature: -20 ~ 70°C
  • Dimensions/weight: 58 x 58 x 25mm / 40g

GL-AR300M has dual memory, namely 128MB of DDR2 flash memory and 16MB of FLASH flash memory. Although it has dual memory, the dual memory cannot be used at the same time. Two different memories can install two different openwrt systems. Switch between different openwrt systems through the switch button on the side of the router. The 16MB FLASH flash memory cannot install v2ray because the memory is too small. You can install Shadowsocks, or,For specific installation methods, please refer to:GL-AR150/GL-MT300N-V2/GL-AR300M router installs ShadowsocksR’s SSR plus+ plug-in

The 128MB Nand memory is integrated with GL.iNet's router web management background by default. GL.iNet's router web management background is developed on the basis of OpenWrt, and its core is still OpenWrt. You can enter the original openwrt system in the router web management background of GL.iNet!

Let’s take a look at how to install the latest version of V2ray on GL-AR300M.

Router installation OpenWrt

Stable version of OpenWrt: OpenWrt 19.07, the OpenWrt community is proud to present the OpenWrt 19.07 stable version series. It is the successor to the previous stable major version 18.06.
The OpenWrt 19.07 series is committed to bringing all supported targets to Linux kernel version 4.14 and introducing ath79 support based on the initial device tree.

In November 2021, the OpenWrt version of GL-AR300M has been upgraded to 21.02.1. If you want to convert the routerFor version upgrade, please download the latest GL-AR300M firmware version. For download address, please visit:https://openwrt.org/toh/views/toh_fwdownload

Don't buy a device with 4MB flash / 32MB RAM if you plan to flash the latest and secure OpenWrt version (18.06 or higher) onto it! For more information,See 4/32 Warning. 4/32 The device does not have sufficient resources (flash and/or RAM) to provide safe and reliable operation. Check out what you can do now with OpenWrt on 4/32 devices. OpenWrt support for 4/32 devices will end after 2019. After 19.07, OpenWrt images will no longer be built for 4/32 devices.

The router defaults to NAND flash boot, and the previous OpenWrt 19.07 currently does not support NAND boot. NAND flash memory is only supported after 19.07.x. If you want to use 16MB NOR flash memory to install Shadowsocks, you must set it to force it to boot from NOR flash memory. Switch between different memory systems through the switch on the side of the router.

Extended reading: What are NOR Flash and NAND Flash?

One thing that is similar to ordinary memory is that NOR Flash can support random access, which makes it also support XIP (eXecute In Place) and can execute programs like ordinary ROM. This makes it an excellent carrier for code that needs to be executed at boot, such as BIOS. Nowadays, almost all BIOS and some set-top boxes use NOR Flash. Its size is generally between 1MB and 32MB, and it is expensive.

NAND Flash is widely used in various memory cards, USB flash drives, SSD, eMMC and other large-capacity devices. Its particles can be divided into three categories: SLC (Single-Level Cell), MLC (Multi-Level Cell) and TLC (Triple-Level Cell) according to the number of storage bits in each storage unit. Among them, in one storage unit, SLC can store 1 bit, MLC can store 2 bits, and TLC can store 3 bits. The more bits a single memory cell of NAND Flash stores, the worse the read and write performance will be, and the lifespan will be shorter, but the cost will be lower.

1. How to install OpenWrt on 16MB NOR memory

Set up NOR flash boot

Prepare a PC, connect the computer's network card to the router's LAN port through a network cable, then set the PC's network card to 192.168.8.2, mask 255.255.255.0, and confirm that the network cable is connected to the router's LAN port. Enter 192.168.8.1 in the browser, log in to the router backend, and set a 6-digit management password. Then use the SSH tool to log in to the router., log in to the router.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解
Enter the following command:

fw_printenv fw_setenv boot_dev on reboot

After entering the command, use reboot to restart the router.
OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解
Power off the router, unplug it from the power source, and then toggle the reset switch on the side of the router. Switch to the other side, then press and hold the reset button without releasing it. Turn on the power and wait until the red light flashes 5 times, then release the reset button.
Now it has entered the 16MB NOR flash boot mode. At this time, change the network card on the computer to 192.168.1.2
OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Download GL-AR300M router firmware OpenWrt

Firmware download address:glinet_gl-ar300m-nand-squashfs-sysupgrade.bin

Original firmware:openwrt-ar300m-3.203-0701.img

Note: If you flash back to the original firmware, please change the IP address of the local network to 192.168.8.2, and the access router address is 192.168.8.1

Open the browser, enter 192.168.1.1, and select the openwrt system version firmware you downloaded previously. Upload the firmware to the router and start flashing!
OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解
After waiting for a few minutes, the flashing was successful. After entering 192.168.1.1 in the browser, the luci interface of OpenWrt 19.07.2 was entered.
Powered by LuCI openwrt-19.07 branch (git-20.057.55219-13dd17f) / OpenWrt 19.07.2 r10947-65030d81f3
OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解
The flashing has been completed here. Let’s install ShadowsocksR Plus+. Please refer to the specific installation method:GL-AR150/GL-MT300N-V2/GL-AR300M router installs ShadowsocksR’s SSR plus+ plug-in

The above is about installing ShadowsocksR’s SSR plus+ on 16MB of memory., let’s return to the topic and talk about how to install V2RAY on 128MB NAND flash memory.

2. How to upgrade Openwrt on 128MB NAND flash memory

First, you need to upgrade the Openwrt version of the GL-AR300M system. The current system default version is 18.06. Set the network card to 192.168.8.2, then enter the router management background, set the password, and log in to the background.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

This is what it looks like when you enter the background. This is the default management background of GL-iNet's AR300M. In this background only regular router operations occur. First we need to upgrade the router’s background system version.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Click Upgrade to upgrade the version to the latest version in the online upgrade. The latest current version is 3.201, and the compilation time is 2021-04-02.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

After upgrading to the latest router system version, click on the advanced features under More Settings.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Then click 192.168.8.1/cgi-bin/luci to enter the default Web interface of OpenWrt.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

If you don’t want the management background that comes with the GL_AR300M router, you can clear the system and re-flash into the new openwrt system!

The operation method of GL_AR300M upgrading the original OpenWrt system is as follows:

Unplug the power supply of the router, and then press and hold the Reset button on the side. Note that you press and hold the Reset button after turning off the power, and then turn on the power. After turning on the power, the red indicator light on the right side flashes 5 times. Release the Reset button, then the green indicator light in the middle will flash, and you will enter the flashing interface. After connecting the network cable and setting the network card IP, start flashing!

.0 firmware address:glinet_gl-ar300m-nand-squashfs-sysupgrade.bin

Note: At this time, the IP address of the flash machine has changed to 192.168.1.1

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

If you don’t want to flash the latest version of openwrt, you can follow the previous background settings, enter the background administrator password set previously on the GL_AR300M router, and log in to the openwrt background.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

The openwrt system has been updated successfully, and I am now logged in to the backend. Let’s start installing v2ray.

V2ray installation and configuration in OpenWrt

After logging in to the openwrt 19.07.7 system background, use ssh to connect to the router and check the CPU architecture of the router.
OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Enter the following command to view:

opkg print-architecture

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解
Through the command, we know that the CPU architecture of the router is mips_24kc. Next, we need to go to the V2ray project page to download the mips_24kc version of v2ray.

Before downloading v2ray, install some necessary software packages.First, plug the external network cable into the WAN port of the router to ensure that the router can connect to the network normally.After the network connection is normal, install the Chinese interface of LUCI first.

opkg update opkg install luci-i18n-base-zh-cn

Install the wget package and .

opkg update opkg install wget

In OpenWrt 21.02.1 wget changed to wget-, the installation method is the same as installing wget. Be careful not to install wget-nossl.
Install the ca-certificates package

opkg update opkg install ca-certificates

Uninstall dnsmasq and install dnsmasq-full and some necessary packages.
Delete the dnsmasq software package. When installing dnsmasq-full, you need to delete the dhcp file in the /etc/config/ directory before installation. Then install:

opkg update opkg remove dnsmasq rm -rf /etc/config/dhcp

In this step, you can also use the SFTP tool to connect to the router and then delete it. However, you need to install the SFTP server openssh-sftp-server.

opkg update opkg install openssh-sftp-server

After deleting dnsmasq, install the dnsmasq-full package.

opkg update opkg install dnsmasq-full

Finally, install some dependency packages to run V2ray:

opkg update opkg install ipset iptables-mod-nat-extra iptables-mod-tproxy kmod-ipt-tproxy coreutils coreutils-base64 coreutils-nohup

The installation of the above software packages can also be installed and deleted in the Software of the OpenWrt 21.02.1 background system.

Before installing v2ray, set the time zone of the router in the system, select Asia/shanghai as the time zone, and then synchronize the local time.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

After completing the above operations, restart the router. After the startup is complete, start downloading and installing the v2ray client.

Install V2ray client in OpenWrt 21.02.1

Before installing v2ray, learn about the difference between v2ray and xray.

Xray: Completely similar to V2Ray, Xray is the core module of Project X project. Because rprx, the author of Xray and Fully compatible with V2Ray.

Let’s start installing the V2ray client.

In OpenWrt 21.02.1, V2ray is divided into three parts, v2ray's core software package v2ray-core, v2ray's luci interface software package luci-app-v2ray and v2ray's luci Chinese language software package.

As of November 14, 2021, the latest version of v2ray isv4.43.0-2. However, the corresponding LUCI version has not been updated for a long time. The V2ray version currently supported by the LUCI version isv2ray-core_4.41.1-1_mips_24kc.ipkorv2ray-core_4.40.1-1_mips_24kc.ipk

Next, download the core software package of v2ray first.v2ray-core_4.41.1-1_mips_24kc.ipkorv2ray-core_4.40.1-1_mips_24kc.ipk,download link:https://github.com/kuoruan/openwrt-v2ray/releases
It is already known above that the CPU architecture of the router ismips_24kc, find the mips_24kc version of the v2ray software package on the download page. Pay attention to downloadmips_24kcFull package, do not download the mini version.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解
Willv2ray-core_4.40.1-1_mips_24kc.ipkDownload it to the hard drive of your local computer and then install it. There are two ways to install the software package on the router. One way is to directly upload the software package to the router's background for installation, and the other is to upload the software package to the router through SFTP. In the system, install it through commands.

Install v2ray-core in the background of the router:

Open the router's background page, click Software under System, and enter the software package installation page.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解After clicking Upload Package, the upload window will pop up.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解After clicking Browse, select the software package you downloaded, then click Upload, then click Install and wait for automatic installation.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

After the installation is complete, search for v2ray in the installation list to see if it was successfully installed.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

SFTP upload router installs v2ray-core

When using sftp to upload, please make sure you have installed the sftp server software. If not, please install it first.

opkg update opkg install openssh-sftp-server

Create a new SFTP connection in Xftp and select the software package to be uploaded.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解
After the upload is completed, use ssh to log in to the router and install the ipk file manually.

opkg install v2ray-core_4.40.1-1_mips_24kc.ipk

After the installation is complete, delete the v2ray-core_4.40.1-1_mips_24kc.ipk file. The core files of v2ray are installed in the /usr/bin directory.
If you want to uninstall v2ray installation, you can run the following command.

opkg remove v2ray-core

Install the luci interface of V2ray

Next, install v2ray’s luci interface software package luci-app-v2ray and v2ray’s luci Chinese language software package.

luci-app-v2ray project address:https://github.com/kuoruan/luci-app-v2ray/releases

Download luci-app-v2ray and luci Chinese language software package

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

V2 and higher are only available for OpenWrt 19.07 and higher, V1 is available for OpenWrt 18.06 and earlier. Install after downloading.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Install the Chinese interface of V2ray

After installing luci-app-v2ray_2.0.0-1_all.ipk, install it in the same wayluci-i18n-package-zh-cn_2.0.0-1_all.ipk.

After the installation is complete, restart the router, and then enter the password again to log in to the router. After logging in, you will see an additional service navigation menu in the navigation bar above. ClickServeAfter that, the v2ray menu will pop up below, click v2ray to enter.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Before clicking Enable, the v2ray service is deactivated by default. Here you need to check the box after enable and choose to enable the v2ray service.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

The v2ray service has been successfully installed on your router. If you want to install it using SFTP, upload the downloaded file to the router, and then install it through the following command!

opkg install luci-app-v2ray_2.0.0-1_all.ipk opkg install luci-i18n-package-zh-cn_2.0.0-1_all.ipk

After the installation is complete, update luci, otherwise the v2ray page will report an error!

opkg install luci luci-base luci-compat

Configure V2ray service

V2Ray-Global settings interface, this is equivalent to the main console, there are some default items, we don’t need to worry about it, the main thing is to chooseInbound connectionandOutbound connection.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Set up inbound connection

In the global settings, there is basically no need to change. You only need to change the two options of inbound and outbound. Here in the inbound, select "dokodemo_door", and the outbound is your customized v2ray server name. Let’s first look at the inbound settings here.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

After clicking on the inbound connection (inbound), click Edit behind dokodemo_door.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Change the listening address to "0.0.0.0", check UDP in the dokodemo_door network, and click Save. The dokodemo_door for the inbound connection has been set up, and then the outbound connection is set up.

Set up outbound connections

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Enter the "Outbound Connection" option, and you can click Import to directly import a v2ray connection in the vmess://xxxxx format, or add a client connection of the vmess protocol.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

After importing the vmess connection, there are several places that need to be modified manually. Click Edit after the imported name to enter the editing page.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Fill in the disguised domain name (host) after the vmess-address. The IP address is imported by default. In the VMess – Security encryption method option, select Auto.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

If there is no setting on your v2ray serverFor domain name certificates, check TLS – Allow insecure. Skip certificate verification!

Many reasons why v2ray cannot run are basically due to the outbound connection settings.

Then in the global settings interface, select the outbound connection to the connection you just set.

V2ray sets transparent proxy

After setting up the outbound and inbound connections, there is one more thing that needs to be set. Click on the transparent proxy (Transparent proxy). ) to enter the transparent proxy settings page.

Select the transparent proxy "dokodemo_door-1081" for the Redirect port, and select lan for the LAN interface (interfaces).

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

 

 

If you select default in the Proxy mode, it is the global mode. No matter what website you visit, it will be forwarded from the proxy server. If you select GFWList, the forwarding traffic will be separated, and domestic websites will take the domestic route.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

After the settings are completed, return to the global settings, click Reload Service, and then save the settings. The settings of v2ray come to an end here!

V2ray firewall settings

After configuring the content in v2ray, you also need to set the firewall port rules of the router and open the previously used port 1081.

Click on the firewall in the network, find the Traffic Rules option, and add a rule to allow port 1081.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

V2ray load balancing

If you have multiple v2ray servers, you can perform load balancing on the router.

First set the identification TAG for each outbound connection

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

For example, there are currently three outbound connections, and the identification tags are set to A/B/C respectively.

Then enter the routing settings page and check Balancers.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

After checking Balancers, add a rule "proxy" in the routing rules

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Fill in balancer as the bottom mark, paying attention to capitalization. After filling in, click Save.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Fill in the load balancing identification name, save and apply it after filling in. In the routing options, check the newly added "proxy" and add it, then save the application.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

Then return to the global settings and check all outbound servers.

OpenWrt 如何安装 V2ray 和 V2ray安装luci-v2ray配置详解

The configuration method of V2Ray for OpenWrt soft router has been introduced. V2ray is currently a relatively secure Internet proxy tool that protects personal privacy. With V2ray built into the router, you can browse the Internet at any time at home.

AR300M router, NAND Flash, NOR Flash, openwrt, OpenWrt 21.02, openwrt installation V2ray, V2ray installation and configuration,,,Install OpenWrt,

 

score

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Very useful and successful. The v2ray client is installed on AR300M16, and the overlay space is expanded by inserting a USB flash drive. There are a few problems that I don’t know if the poster has encountered and how to solve them.

    1. The routing function of v2ray cannot be turned on after transparent proxying. As long as the CPU load is turned on, the CPU load will be very high and it will stop responding. Turn off the rule function and it will work normally.
    2. I don’t know if the rule function is related to the number of connected terminals. One computer can be used normally after being connected wirelessly, but when another computer is connected, it crashes again.

    If the webmaster sees it, please help to answer it, thank you.