This render was generated by the Kami API and may have typographical issues, for the best experience go to:https://www.miaoer.net/posts/network/pve-install-catwrt
This blog is a tutorial about installing CatWrt as a bypass gateway (bypass routing) on Proxmox VE(PVE).
This tutorial only takes into account the fact that you have a good home network and can connect to Github and download mirrors online, if you have other uses you can make your own variables on this blog.
- Soft routing (primary routing mode) to pass-through or virtualize the home network to be hosted by a PVE
- Offline installation, uploading the img via SFTP instead of downloading it online
This blog is based on the previously published PVE tutorials, optimized for the startup steps
Creating Virtual Machines
Let’s go to PVE first.Creating Virtual MachinesVM ID: I set it here104
Align with device IP
CatWrt default: 192.168.1.4 Take 4 as the VM ID; the name isCatWrt
And we check theboot-up (computing)Next.
operating system
Select hereDoes not use any mediaSelect Linux for the client’s operating system and the default version.
systems
The BIOS option here is either the default (SeaBIOS) or OVMF (UEFI), depending on your preference, which version you will choose when you add the image later.
Here at EFI we highly recommend all users to use EFI’s firmware, and this blog follows that principle.
If OVMF (UEFI) is selected, theUncheck Add EFI DiskBe sure not to add it or it won’t start
Graphics Card Recommendationsleave the defaults as they areor standard VGA, VMware compatible
Just leave the rest as default, next step
(computer) disk
Here, the default disk will be deleted, here does not delete any data please feel free to delete.
CPU
Here, set the number of CPU cores according to your computer, the category can be kept as default or you can choose according to your situation. In order to improve performance, host is selected here, and CPU weight is set to improve scheduling aggressiveness -> improve performance.
random access memory (RAM)
Memory settings: recommended settings are1024
If you need to run containers (docker), it is recommended that you set up the2048
or higher. Depends on your needs, but I don’t think anyone is running Docker inside PVE’s OpenWrt either!
Checking the Ballooning device will change the memory to dynamic allocation, which is not recommended if you need to use memory monitoring software (e.g. htop, pcdn memory detection). Some software will not be able to determine the size of memory and memory leakage will occur.
reticulation
Networking here we do not consider the WAN port, because we are bypassing this tutorial!
If you need to add a WAN port, you need to passthrough or add a virtual network port after the Create VM window operation is complete.
The first interface of CatWrt is set as LAN interface by default, and the second interface is set as WAN by default, so you should be careful here to avoid the difficulty of pre-configuration due to the wrong interface order setting!
recognize
Only after completing the creation of the virtual machine window can you add a second network port or perform other operations, such as: adding a new mount point hard disk, expanding the image hard disk
After completing the configuration, add a second network port.
Find the device you just created, click on it, select Hardware, Add->Network Devices->Select Another Interface (WAN)
Downloading and converting mirrors
Most OpenWrt x86’s provide either an .img format disk image or a corresponding packaged compressed file, which you will need to select during your setup by choosing BIOS or EFI to select the appropriate system.
For example, if I chose OVMF(EFI), I should download the efi image, and if I chose SeaBIOS, I should download the image without EFI.
OVMF (EFI) was created earlier in this blog. For this demo, EFI will be used.
Download Address:Releases · miaoermua/CatWrt (github.com)
Use SSH to connect to the PVE host, or in a web-based shell
Download the image and import it to a virtual disk.
wget https://github.com/miaoermua/CatWrt/releases/download/v24.9/CatWrt.v24.9.amd64-squashfs-combined.img
qm importdisk 104 ./CatWrt.v24.9.amd64-squashfs-combined.img local
qm importdisk is the command; 104 is the VM ID
. /CatWrt.v24.9.amd64-squashfs-combined.img is the image path.
The local here is your storage pool, if you like to store local-lvm you need to add your own, the blog is just to store in the local.
If it was uploaded through a browser, it is under /var/lib/vz/template/iso/xxx.img.
Successful import displays successful
Successfully imported disk as 'unused0:local-lvm:vm-104-disk-0'
root@pve:~#
The full output is shown below:
Linux pve 6.8.12-1-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-1 (2024-08-05T16:17Z) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Nov 8 17:15:52 CST 2024 from 10.0.0.211 on pts/1
root@pve:~# wget https://github.com/miaoermua/CatWrt/releases/download/v24.9/CatWrt.v24.9.amd64-squashfs-combined.img
--2024-11-22 17:09:46-- https://github.com/miaoermua/CatWrt/releases/download/v24.9/CatWrt.v24.9.amd64-squashfs-combined.img
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/565851215/f2fa1d74-ca84-4b62-b347-8c2b78e52f50?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241122%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241122T090947Z&X-Amz-Expires=300&X-Amz-Signature=50766fbb694eb204ac68049b402fdb7be1c5b8c42bc2e3606f18c693cbb79339&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3DCatWrt.v24.9.amd64-squashfs-combined.img&response-content-type=application%2Foctet-stream [following]
--2024-11-22 17:09:47-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/565851215/f2fa1d74-ca84-4b62-b347-8c2b78e52f50?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241122%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241122T090947Z&X-Amz-Expires=300&X-Amz-Signature=50766fbb694eb204ac68049b402fdb7be1c5b8c42bc2e3606f18c693cbb79339&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3DCatWrt.v24.9.amd64-squashfs-combined.img&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.110.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 839385088 (800M) [application/octet-stream]
Saving to: ‘CatWrt.v24.9.amd64-squashfs-combined.img’
CatWrt.v24.9.amd64-squashfs-com 100%[====================================================>] 800.50M 13.1MB/s in 70s
2024-11-22 17:10:58 (11.4 MB/s) - ‘CatWrt.v24.9.amd64-squashfs-combined.img’ saved [839385088/839385088]
root@pve:~# qm importdisk 104 ./CatWrt.v24.9.amd64-squashfs-combined.img local
importing disk './CatWrt.v24.9.amd64-squashfs-combined.img' to VM 104 ...
Formatting '/var/lib/vz/images/104/vm-104-disk-1.raw', fmt=raw size=839385088 preallocation=off
transferred 0.0 B of 800.5 MiB (0.00%)
transferred 10.0 MiB of 800.5 MiB (1.25%)
......
transferred 790.0 MiB of 800.5 MiB (98.69%)
transferred 800.0 MiB of 800.5 MiB (99.94%)
transferred 800.5 MiB of 800.5 MiB (100.00%)
transferred 800.5 MiB of 800.5 MiB (100.00%)
Successfully imported disk as 'unused0:local:104/vm-104-disk-1.raw'
Importing a hard disk
Next, import the disk as follows
Launch when finished.
Use a network cable to connect to the switch bridged to vmbr0 by typing 192.168.1.4 into your browser to configure subsequent dialup, DHCP, higher port information, and so on.
Note: This 10.0.0.4 is a screenshot of the completed CatWrt configuration, not the default 10.0.0.4 network configuration.
user IDroot
Passwordpassword
。
Modify IP
Go inside CatWrt in PVE.consolesThe VNC is now in place.
Enter a few more times inside VNC to bring up theroot@CatWrt:~#
At this point typecattools
If you are not connected to the Internet, you will not be able to update, so do not interrupt the update with ctrl+c and wait for the update to fail three times before entering Cattools.
digital term1
Modify IP
Operation method Enter an IP address you need, after execution will restart the network part does not need to restart CatWrt can enter the background to configure, for example:
Please enter the IP Addr and press Enter /// 请输入 IP (默认为 192.168.1.4): 10.0.0.4
Subsequent to enter will run the code again, here that because of the successful modification of the restart of the network interface, you can connect through your modified IP
Or you can use the
vi /etc/config/network
&nano /etc/config/network
The method of modification.
Configuring the CatWrt Network
Here you only need to do the following blog ? ##Change Password and ##Lan – DHCP can be done, after the change is completed restart CatWrt can be used!
Note that the IP address must be the same as the network segment of Qunhui, for example, Qunhui is192.168.1.2
CatWrt would have to be in 1.x for example:192.168.1.4
Setting the address in the
This blog is based on the CatWrt User Experience Program provided by the seniors of Jiangxi University of Science and Technology, original article.PVE部署CatWrt(OpenWrt) | Enjoy your life | AEnjoy’s Blog
Original text:https://www.miaoer.net/posts/network/pve-deplay-openwrt