banner
miaoer

miaoer

喵二の小博客 https://www.miaoer.net xLog 分站
tg_channel
telegram
bilibili

PVE Install CatWrt Virtual Machine OpenWrt Bypass Gateway (Bypass Router)

This blog is about the tutorial for installing CatWrt on Proxmox VE (PVE) as a bypass gateway (bypass router).

This tutorial only considers a smooth home network that can connect to GitHub and download images online. If you have other uses, you can make adjustments on this blog.

  • Soft routing (main routing mode), directly passing through or virtualizing the home network hosted by PVE.
  • Offline installation, uploading the img via SFTP instead of downloading online.

This blog is modified from the previously published PVE tutorial, optimizing the startup steps.

1

Create Virtual Machine#

First, enter PVE and Create Virtual Machine. VM ID: I set 104 to match the device IP.

CatWrt default: 192.168.1.4, taking 4 as the VM ID; name it CatWrt.

We also check Start at boot, then proceed to the next step.

image

Operating System#

Here, select Do not use any media, choose Linux for the guest operating system, and keep the version as default, then proceed to the next step.

image

System#

For the BIOS options here, choose either the default (SeaBIOS) or OVMF (UEFI) based on your preference, as it relates to the version selected when adding the image later.

We strongly recommend all users to use EFI firmware, and this blog follows that principle.

If you choose OVMF (UEFI), do not check Add EFI Disk. Be careful not to add it, or it will not boot.

For the graphics card, it is recommended to keep default or standard VGA, VMware compatible.

Keep the rest as default, then proceed to the next step.

image

Disk#

Here, delete the default disk. This will not delete any data, so feel free to delete it.

image

CPU#

Here, set the number of CPU cores based on your computer's situation. The category can remain default or be chosen based on your situation. To improve performance, select host and set the CPU weight to enhance scheduling responsiveness -> improve performance.

image

Memory#

Memory setting: It is recommended to set it to 1024.

If you need to run containers (docker), it is recommended to set it to 2048 or higher, depending on your needs. However, it is unlikely anyone runs Docker inside PVE's OpenWrt.

Checking the Ballooning device will make memory changes dynamically allocated. If you need to use memory monitoring software (like htop, pcdn memory detection), it is not recommended to check this. Some software may experience memory leaks because they cannot determine the memory size.

image

Network#

Here we do not consider the WAN port, as this is a bypass tutorial.

If you need to add a WAN port, you need to perform passthrough or add a virtual network port after completing the creation of the virtual machine window.

The first interface of CatWrt is set to LAN by default, and the second interface is set to WAN by default. Therefore, you should be cautious here to avoid configuration difficulties caused by incorrect interface order!

Confirmation#

After completing the creation of the virtual machine window, you can add a second network port or perform other operations, such as adding a mounted hard disk or expanding the image hard disk.

After completing the configuration, add the second network port.

image

Find the device you just created, click on it, select hardware, add -> network device -> select another interface (WAN).

image

Download and Convert Image#

Most OpenWrt x86 provide .img format disk images or corresponding packaged compressed files. You need to choose BIOS or EFI when setting to select the corresponding system.

For example, if I previously chose OVMF (EFI), I should download the EFI image. If I choose SeaBIOS, I should download the image without EFI.

This blog previously created OVMF (EFI), so this demonstration will use EFI.

Download link: Releases · miaoermua/CatWrt (github.com)

image

Use SSH to connect to the PVE host, or in the Shell of the web interface.

Download the image and import it into the 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 virtual machine ID.

./CatWrt.v24.9.amd64-squashfs-combined.img is the image path.

Here, local is your storage pool. If you prefer to store it in local-lvm, you need to add that yourself; this blog just stores it in local.

If uploaded via the browser, it will be under /var/lib/vz/template/iso/xxx.img.

After successful import, it will show successful.

Successfully imported disk as 'unused0:local-lvm:vm-104-disk-0'
root@pve:~#

The complete output is as follows:

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'

Import Hard Disk#

Next, follow the steps below to import the disk.

image

After completion, start it.

Connect via a network cable to the switch bridged with vmbr0, and enter 192.168.1.4 in the browser to proceed with subsequent dialing, DHCP, and higher network port information configurations.

image

Note: This 10.0.0.4 is a screenshot after CatWrt configuration is completed, not the default 10.0.0.4 network configuration.

Username root, password password.

::: warning
If your network is not 192.168.1.0/24, for example, 192.168.1.4, please continue to complete the steps!
:::

Modify IP#

Enter the Console of CatWrt in PVE, and you will successfully enter VNC.

Press Enter a few times in VNC until you see root@CatWrt:~#, at this point, enter cattools. Since there is no internet connection, it will fail to connect and cannot update. Do not interrupt the update with ctrl+c; wait for the update to fail three times to enter Cattools.

Select option 1 to modify the IP.

To operate, enter the desired IP address, and after executing, it will restart the network part without needing to restart CatWrt to configure it in the background, for example:

Please enter the IP Addr and press Enter /// 请输入 IP (默认为 192.168.1.4): 10.0.0.4

Then press Enter, and it will run the code again. This indicates that the modification was successful and the network port has restarted, allowing you to connect using the modified IP.

2

Alternatively, you can modify it using vi /etc/config/network & nano /etc/config/network.

Configure CatWrt Network#

Here, you only need to complete the ##Modify Password and ##Lan - DHCP sections of the blog below, and after modification, restart CatWrt to use it.

Note that the IP address must be consistent with the Synology's subnet. For example, if Synology is 192.168.1.2, CatWrt should be set to an address in 1.x, such as 192.168.1.4.

3

This blog is based on the user experience plan of CatWrt provided by a senior from Jiangxi University of Science and Technology. The original text: PVE Deployment of CatWrt (OpenWrt) | Enjoy your life | AEnjoy’s Blog

Original text: https://www.miaoer.net/posts/network/pve-deplay-openwrt

This article is synchronized and updated to xLog by Mix Space. The original link is https://www.miaoer.net/posts/network/pve-install-catwrt

Footnotes#

  1. https://www.miaoer.net/posts/network/pve-deplay-openwrt

  2. https://www.miaoer.net/posts/blog/cattools

  3. https://www.miaoer.net/posts/network/quickstart-catwrt

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.