Preface
Actually, I used lede a long time ago, but the main purpose back then was for multi-dialing. Later, after using iKuai, I found that iKuai was unbeatable in terms of multi-dialing, so I abandoned lede (partly because I didn't really like the lede interface). Now my home internet setup is a physical iKuai + ac86u Merlin system. iKuai has 3 wan ports: wan port 1 has single-line 3-dialing; wan port 2 connects to the lan port of the ac86u (the wan port of the ac86u connects back to the lan port of iKuai); wan port 3 connects to the itv port of the optical modem to achieve multi-terminal use of IPTV. Using it this way works flawlessly and is stable, so I haven't had much motivation to research openwrt.
However, recently, because I have been researching inbound and outbound traffic optimization and security solutions around IPv6 public IP addresses for future home data centers (see:Home Data Center Series: Home Data Center v4/v6 Dual-Stack Network Architecture and Application Access Flow Optimization), I have been investigating related technologies in various aspects, including v6-to-v4 technologies like lucky and socat, which can run directly as software packages on OpenWrt. In addition, I always feel that nowadays, with virtualization technology available, using a standalone AC86U as a proxy gateway is a bit low-end (and what if it breaks and I have to buy a new one??), so I also wanted to prepare a backup plan. This gave me the motivation to specifically study OpenWrt.
Note: This article is just a record of the installation process, with not much technical depth.
Install OpenWrt
Download the image and decompress it
Note: The official OpenWrt is a clean version with nothing but basic functions. All needed software must be installed by yourself (I prefer this kind, just like I always download official Windows images to install myself and refuse to use other modified versions). If you prefer pre-customized, full-featured versions, you will need to find those images yourself.
Download the latest img version suitable for PVE. At the time of writing this article, the latest version is 23.05.2. The official download link is as follows:
OpenWrt 23.05.2 official download link。
Download the .gz package directly to the /root folder on PVE:
wget https://downloads.openwrt.org/releases/23.05.2/targets/x86/64/openwrt-23.05.2-x86-64-generic-squashfs-combined-efi.img.gz
Decompress the package with the .gz extension. You can use gzip. If it is not installed, use apt to install it first, as follows:
apt install gzip #安装gzip
cd /root #进入下载目录
gunzip openwrt-23.05.2-x86-64-generic-squashfs-combined-efi.img.gz #进行解压缩,得到扩展名为.img的文件
Create a new virtual machine in PVE
cd /root #Enter download directory









gunzip openwrt-23.05.2-x86-64-generic-squashfs-combined-efi.img.gz #Decompress to get the file with .img extension
cd /root #进入下载文件夹
qm importdisk 107 openwrt-23.05.2-x86-64-generic-squashfs-combined-efi.img local-lvm #将.img文件作为硬盘导入VM id为107的虚拟机
Import the previously decompressed .img file directly as a disk into the virtual machine with VM ID 107:

cd /root #Enter download folder


qm importdisk 107 openwrt-23.05.2-x86-64-generic-squashfs-combined-efi.img local-lvm #Import the .img file as a hard disk into the virtual machine with VM ID 107


Imported successfully:

Initialize OpenWrt
An unused disk 0 will appear in the hardware settings of VM 107:


Modify boot order:
ip address

After entering the system, the first step is to use the "passwd" command to set a password for the root user:
http://192.168.1.1Use the command to view the default interface IP address of OpenWrt:

Basic configuration of OpenWrt
Configure IP address
ip address

The default address is 192.168.1.1, and SSH is also enabled. If you need to change the IP address, you can actually SSH into OpenWrt now and modify the IP address via the command line, but it's not really necessary as it can also be changed in the web interface. Simply change your computer's IP to the 192.168.1.0 subnet, and then log in directly using a browser

, username "root", and the password is the one set earlier using the passwd command:



Go to "Network" - "Interfaces":


Click "Edit" in the red box:
Modify the IP information of OpenWrt according to your actual environment. Generally speaking, installing OpenWrt with PVE is highly likely for a bypass router setup, so you need to configure OpenWrt based on the main router's configuration. Assuming the LAN port IP address of the main router is 192.168.100.254, then the OpenWrt interface also needs to be configured in the 192.168.100.x subnet (assuming 192.168.100.1), and the gateway needs to point to 192.168.100.254:
Finally, return to the interfaces page and click "Save & Apply" to take effect:
Add Chinese language pack
Log in again using the newly configured IP address.

Note: I am only using the simplest OpenWrt single-network-card deployment method to demonstrate the installation and configuration, which is generally sufficient for a bypass router. Afterwards, you only need to have all clients point their default gateway to the bypass router via DHCP allocation (or just have the clients that need proxy access point their default gateway directly to the bypass router). However, in reality, this method is actually quite troublesome and inefficient, and carries a very large risk (for example, if the bypass router crashes, all clients pointing their default gateway to it will lose internet access).

Actually, the most scientific and efficient way is for OpenWrt to use a dual virtual network card setup (one LAN port and one WAN port), with all clients' default gateways pointing to the main router. The main router, through multi-WAN policy routing, sends requests destined for target domains requiring proxy access or requests from specified source IP addresses to the LAN port of the bypass router via a separate WAN port. Then, the WAN port of the bypass router points back to the LAN port of the main router for normal internet access. Using this method, first, if the bypass router crashes, it won't affect most normal clients; second, the flexibility is high: if configured based on target domains, it can achieve the effect of accessing special domains without affecting the normal internet access of all clients on the network, which is truly the best solution... I will write a dedicated article about this in the future.

First, you need to update the OpenWrt package list:
luci-i18n-base-zh-cn


Updated successfully (may require proxy or magic):

Search for the Chinese language pack name and install it:

luci-i18n-base-zh-cn

Afterword
Installed successfully: