OpenWrt soft router series PVE deployment OpenWrt (23.05.2) detailed tutorial
本文最后更新于 290 天前,其中的信息可能已经有所发展或是发生改变,如有失效可到评论区留言。

Preface

Actually, I used lede a long time ago, but the main purpose was to multi-dial. After using Akuai, I found that Akuai was invincible in multi-dial, so I abandoned lede (one reason is that I don't like the interface of lede). Now my home Internet access is a physical Akuai + ac86u Merlin system. Akuai has 3 wan ports: wan port 1 single line 3 dial; wan port 2 connected to ac86u lan port (ac86u wan port connected back to Akuai lan port); wan port 3 connected to the itv port of the optical modem to realize the multi-terminal use of IPTV. It is no problem to use it this way, and it is stable, so I have not been very motivated to study openwrt.

However, recently I have been studying the optimization and security solutions for inbound and outbound traffic around IPv6 public network addresses in future home data centers (see:Home Data Center Series Home Data Center v4v6 dual-stack network architecture and application access process optimization), so I studied related technologies in many aspects, including lucky, socat and other v6 to v4 technologies, which can be directly run on openwrt in the form of software packages. In addition, I always feel that it is a bit low to use an ac86u as a scientific gateway under the current virtualization technology (and if it breaks, I have to buy a new one??), so I also want to prepare a backup plan, so I have the motivation to study openwrt.

In addition: This article is just a record of the installation process and has no technical content.

Install openwrt

Download the image and unzip it

Note: The official openwrt is a pure version, which has nothing except the basic functions. All the required software needs to be installed by yourself (I like this. For example, I download the official image of win and install it myself. I will never use other versions). If you like the customized full-featured one, you need to find the image yourself.

Download the latest img version suitable for PVE. When I wrote this article, the latest version was 23.05.2. The official website 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

To decompress the package with the .gz extension, you can use gzip. If it is not installed, install it using apt first, as follows:

apt install gzip #Install gzip cd /root #Enter the download directory gunzip openwrt-23.05.2-x86-64-generic-squashfs-combined-efi.img.gz #Unzip it and get a file with the extension .img

Create a new virtual machine in PVE

Just follow the subsequent graphic process:

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

Import the previously decompressed .img file as a disk directly into the virtual machine with VM ID 107:

cd /root # Enter the 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

Import successful:

image.png

There will be an unused disk 0 in the hardware of the 107 virtual machine:
image.png

image.png

Modify the boot order:
image.png

image.png

Click "Start Now" in the console to start the virtual machine:
image.png

Initialize openwrt

The first step after entering the system is to set a password for the root user using the "passwd" command:

image.png

image.png

Use the command to view the default interface IP address of openwrt:

ip address

image.png

The default address is 192.168.1.1, and ssh is also open. If you need to change the IP address, you can actually ssh to openwrt and then change the IP address in the command line, but it is not necessary, the web interface can also be changed. Simply change the computer IP to 192.168.1.0, and then log in directly using the browserhttp://192.168.1.1, username "root", password is the password set by the passwd command above:
image.png

image.png

Openwrt basic configuration

Configuring IP Addresses

Enter "Network"-"interfaces":

image.png

Click "Edit" in the red box:
image.png

Modify the IP information of openwrt according to your actual environment. Generally speaking, using PVE to install openwrt is most likely to be a bypass router, so you need to set up openwrt according to the configuration information of the main router. Assuming that the IP address of the LAN port of the main router is 192.168.100.254, then the interface of openwrt also needs to be configured to the network segment 192.168.100.x (assuming it is 192.168.100.1), and the gateway needs to point to 192.168.100.254:
image.png

image.png

image.png

Finally, return to the interface and click "Save&Apply" to take effect:
image.png

image.png

Log in again using the new IP address you set.


Note: I am only using the simplest deployment method of OpenWRT single network card to demonstrate the installation and configuration. Generally, it is sufficient as a bypass router. Then, you only need to let all clients point the default gateway to the bypass router through DHCP allocation (or just need scientific clients to point the default gateway directly to the bypass router). But in fact, this method is very troublesome and inefficient, and there are very big hidden dangers (for example, if the bypass router crashes, all clients with the default gateway pointing to the bypass router cannot access the Internet).

In fact, the most scientific and efficient way is to use dual virtual network cards (one LAN port and one WAN port) in OpenWRT, and then the default gateway of all clients points to the main router; the main router uses multiple WAN ports to divert the requests from the target domain name or the specified source IP address that need to be scientifically accessed, and sends them to the LAN port of the bypass router through a separate WAN port, and then the WAN port of the bypass router points to the LAN port of the main router for normal Internet access. In this way, if the bypass router crashes, it will not affect most of the normal clients, and secondly, it is highly flexible: if it is set based on the target domain name, it can not affect the normal Internet access of all clients in the network, but can achieve the effect of accessing some special domain names, which is the best solution. . . I will talk about this in a special article later.


Add Chinese language pack

First you need to update the openwrt package list:

image.png

Update the package list:
image.png

Update successful (may require science or magic):
image.png

Search for the Chinese language pack name and install it:

luci-i18n-base-zh-cn

image.png

image.png

Successful installation:
image.png

Change the language to Simplified Chinese in "System"-"Language and Style":
image.png

The interface has become Chinese:
image.png

Afterword

I will just write an article like this today. Although it does not have much technical content, as the saying goes, a towering building starts from the ground, and there can only be two if there is one.

The content of the blog is original. Please indicate the source when reprinting! For more blog articles, you can go toSitemapUnderstand. The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if necessary, you can joinTelegram GroupDiscuss the problem together.
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠(ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ°Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Emoticons
Emoji
Little Dinosaur
flower!
Previous
Next
       

This site has disabled the right mouse button and various shortcut keys. The code block content can be copied directly by clicking the copy button in the upper right corner

en_US