How to install V2ray on OpenWrt and install luci-v2ray on V2ray

Configuration method of V2Ray for OpenWrt soft router. V2ray is currently a relatively safe Internet proxy tool. Sometimes, the application scenario of V2ray is no longer satisfied with installing it on the computer, especially for some international online games. A simple Internet access proxy can no longer meet the game needs.

V2Ray for OpenWrtConfiguration method, V2ray is currently a relatively safe way to surf the InternetSometimes, the application scenario of V2ray is not satisfied with installing it in the computer. V2ray is built into the router, especially for some international online games. The simple Internet access proxy can no longer meet the game needs. The following introduces how to use the proxy IP to access the Internet from the physical layer of the computer network card.

AR300M flash Openwrt system install V2ray self-built game accelerator

The router used in this test is The methods for flashing the OpenWrt system on the AR300M router are similar. As long as your router supports the OpenWrt system and the router's memory is greater than 64MB, you canServe.

Preparations before V2ray builds its own overseas game accelerator:

  • A router with openwrt system installed, such as GL.iNet's AR300M router, or the higher-performance GL.iNet MT1300.
  • An overseas computer with V2ray server installedOr a VPS cloud host. Or you have a VMess server or Shadowsocks server that can be connected normally. For details, please see:V2ray server configuration tutorial: Install V2ray using Linux+Nginx+TLS+WS+CDN
  • The computer, network cable, and basic network knowledge used for installation and debugging may be a little difficult during the operation.

GL-AR300M Router

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

GL-AR300M is a wireless broadband router that complies with IEEE802.11b/g/n standards, providing a wireless transmission rate of up to 300Mbps. The router is based on the OpenWRT open source platform, integrating the functions of router and wireless access point, and can be flexibly expanded.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

  • Interfaces: 1 WAN, 1 LAN, 1 USB2.0, 1 micro USB (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 indicator
  • Power consumption:<2W
  • Operating temperature: 0 ~ 40°C
  • Storage temperature: -20 ~ 70°C
  • Dimensions/Weight: 58 x 58 x 25mm / 40g

GL-AR300M has dual memory, namely 128MB DDR2 flash memory and 16MB FLASH flash memory. Although it has dual memory, the dual memory cannot be used at the same time. The two memories can install two different openwrt systems. Use the switch button on the side of the router to switch between different openwrt systems. The 16MB FLASH flash memory cannot be installed with v2ray because the memory is too small. You can install Shadowsocks, or Plus+, specificYou can refer to:Install ShadowsocksR's SSR plus+ plugin on GL-AR150/GL-MT300N-V2/GL-AR300M router

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

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

Install OpenWrt on your router

The OpenWrt community is proud to present the OpenWrt 19.07 stable release series, which is the successor to the previous 18.06 stable major release.
The OpenWrt 19.07 series aims to bring all supported targets toKernel version 4.14, and introduces ath79 support based on the initial device tree.

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

Do not buy a device with 4MB Flash / 32MB RAM if you intend to flash the latest and secure OpenWrt version (18.06 or later) onto it! For more information,See 4/32 Warning4/32 devices do not have sufficient resources (flash and/or RAM) to provide safe and reliable operation. See what you can do with OpenWrt on 4/32 devices now. 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 boots from NAND flash by default, and the previous OpenWrt 19.07 does not support NAND booting. NAND flash is only supported after 19.07.x. If you want to use 16MB NOR flash to install Shadowsocks, you must force it to boot from NOR flash. Switch between different memory systems through the switch on the side of the router.

Further reading: What are NOR Flash and NAND Flash?

NOR Flash is similar to ordinary memory in that they both 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 BIOS and other codes that need to be executed when the computer is turned on. Now almost all BIOS and some set-top boxes use NOR Flash, which is generally between 1MB and 32MB in size and expensive.

NAND Flash is widely used in various memory cards., 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 bits stored in each storage unit. Among them, in a storage unit, SLC can store 1 bit, MLC can store 2 bits, and TLC can store 3 bits. The more bits a single storage unit of NAND Flash stores, the worse the read and write performance will be, the shorter the life will be, but the cost will be lower.

1. How to install OpenWrt on 16MB NOR memory

Setting NOR flash boot

Prepare a PC, connect the computer's network card to the router's LAN port via 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.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray
Enter the following command:

fw_printenv fw_setenv boot_dev on reboot

After entering the command, use reboot to restart the router.
How to install V2ray on OpenWrt and install luci-v2ray on V2ray
Unplug the power cord of the router, and then flip the switch next to the reset button on the side of the router. Switch to the other side, and then press and hold the reset button without releasing it. After the red light flashes 5 times, 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
How to install V2ray on OpenWrt and install luci-v2ray on 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 previously downloaded openwrt system version firmware. Upload the firmware to the router and start flashing!
How to install V2ray on OpenWrt and install luci-v2ray on V2ray
After waiting for a few minutes, the flash was successful. After entering 192.168.1.1 in the browser, I entered the luci interface of OpenWrt 19.07.2.
Powered by LuCI openwrt-19.07 branch (git-20.057.55219-13dd17f) / OpenWrt 19.07.2 r10947-65030d81f3
How to install V2ray on OpenWrt and install luci-v2ray on V2ray
At this point, the flashing process has been completed. Now let's install ShadowsocksR Plus+. For specific installation methods, please refer to:Install ShadowsocksR's SSR plus+ plugin on GL-AR150/GL-MT300N-V2/GL-AR300M router

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

2. How to upgrade Openwrt on 128MB NAND flash

First, you need to upgrade the Openwrt version of the GL-AR300M system. The current default version of the system 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.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

Entering the backend looks like this. This is the default management backend of GL-iNet's AR300M. In this backend, there are only regular router operations. First, we need to upgrade the router backend system version.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

Click Upgrade and upgrade the version to the latest one in the online upgrade. The latest version is 3.201, compiled on 2021-04-02.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

After upgrading to the latest router system version, click Advanced Features under More Settings.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

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

Unplug the router, then press and hold the Reset button on the side. Note that you should press and hold the Reset button after disconnecting the power, then connect the power. After the red indicator on the right flashes 5 times, release the Reset button immediately, and then the green indicator in the middle will flash, and you will enter the flashing interface. Connect the network cable, set the network card IP, and start flashing!

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

Note: At this time, the IP address of the flashing machine has become 192.168.1.1

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

How to install V2ray on OpenWrt and install luci-v2ray on 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 for the GL_AR300M router, and log in to the openwrt background.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

The openwrt system has been updated successfully and I am currently logged into the backend. Now 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.
How to install V2ray on OpenWrt and install luci-v2ray on V2ray

Enter the following command to view:

opkg print-architecture

How to install V2ray on OpenWrt and install luci-v2ray on 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 required 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 wget package and.

opkg update opkg install wget

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

opkg update opkg install ca-certificates

Uninstall dnsmasq, 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 installing it.

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

You can also use the SFTP tool to connect to the router and then perform the deletion operation. However, you need to install the SFTP server openssh-sftp-server.

opkg update opkg install openssh-sftp-server

After removing dnsmasq, proceed to 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 performed in the Software of the OpenWrt 21.02.1 background system.

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

Install V2ray client in OpenWrt 21.02.1

Before installing v2ray, understand the difference between v2ray and xray.

Xray: Completely similar to V2Ray, Xray is the core module of Project X. Since rprx, the author of Xray and XTLS, was once an important member of the V2fly community, Xray directly forked all V2Ray functions, optimized performance, and added new functions, making Xray a superset of V2Ray in terms of functions 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-2However, the corresponding LUCI version has not been updated yet. The V2ray version currently supported by LUCI 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.v2ray-core_4.41.1-1_mips_24kc.ipkorv2ray-core_4.40.1-1_mips_24kc.ipk,Download address:https://github.com/kuoruan/openwrt-v2ray/releases
We already know that the CPU architecture of the router ismips_24kc, find the mips_24kc version of the v2ray package on the download page. Note that you need to downloadmips_24kcThe full package, do not download the mini version.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray
Willv2ray-core_4.40.1-1_mips_24kc.ipkDownload it to the hard disk of the 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 in the background of the router for installation. The other way is to upload the software package to the router system through SFTP and install it through commands.

Install v2ray-core in the router backend:

Open the router backend page, click Software under System, and enter the software package installation page.

How to install V2ray on OpenWrt and install luci-v2ray on V2rayAfter clicking Upload Package, the upload window will pop up.

How to install V2ray on OpenWrt and install luci-v2ray on V2rayAfter clicking Browse, select the software package you downloaded, then click Upload, then click Install, and wait for the automatic installation.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

SFTP upload router to install v2ray-core

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

opkg update opkg install openssh-sftp-server

existCreate a new SFTP connection and select the software package to be uploaded.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray
After uploading, use ssh to log in to the router and manually install the ipk file.

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 V2ray's luci interface

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

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

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

V2 and later versions are only applicable to OpenWrt 19.07 and later versions, and V1 is applicable to OpenWrt 18.06 and earlier. Install after downloading.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

Install V2ray Chinese interface

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, then enter the password again to log in to the router. After logging in, you will see a service navigation menu in the navigation bar above. ClickServeAfter that, the v2ray menu will pop up below, click v2ray to enter.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

How to install V2ray on OpenWrt and install luci-v2ray on 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 using 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, which is equivalent to the main console, contains some default items that we don't need to worry about, mainly selectInbound connectionsandOutbound connections.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

Setting up inbound connections

In the global settings, basically no changes are needed. You only need to change the inbound and outbound options. In the inbound, select "dokodemo_door", and in the outbound, select your customized v2ray server name. Let's look at the inbound settings first.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

After clicking inbound, click Edit next to dokodemo_door.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

Setting up outbound connections

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

How to install V2ray on OpenWrt and install luci-v2ray on 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 as the connection you just set up.

V2ray sets up transparent proxy

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

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

 

 

If you select default in Proxy mode, it is the global mode, no matter what website you visit,For transit, if you choose GFWList, the forwarding traffic will be separated, and domestic websites will use domestic routes.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

After the settings are completed, return to the global settings, click Reload Service, and then save the settings. The settings of v2ray 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 1081 port used before.

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

V2ray Load Balancing

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

First set the tag for each outbound connection

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

Then go to the routing settings page and check balancers.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

Fill in the balancer at the bottom, paying attention to uppercase and lowercase letters. Click Save after filling in.

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

How to install V2ray on OpenWrt and install luci-v2ray on V2ray

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

AR300M router, NAND Flash, NOR Flash, openwrt, OpenWrt 21.02, openwrt install V2ray, V2ray installation and configuration, flash openwrt, upgrade Openwrt, install OpenWrt, self-built game acceleration

 

score

One comment

Leave a Reply

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