banner
miaoer

miaoer

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

Cattools Toolbox, Function Introduction and User Guide

Background#

Cattools is a powerful toolbox based on BASH, designed for CatWrt, helping users easily achieve various practical functions. It is used to solve some inconvenient modifications and is deeply adapted to CatWrt configurations while being compatible with older versions. Some functions may have bugs; if you encounter issues, please contact me for resolution!

User Guide#

  • [Step 1] Indicates steps/progress
  • ([Enter] Confirm / [0] Exit) Indicates operation keys *
  • INFO Indicates content
  • UPDATE Indicates update
  • Warning Indicates warning

* Note: After entering the numeric key [1], you need to press [Enter] to confirm


Usage Method#

If you don't know how to use SSH, refer to this blog 👇

1

Virtual Machine/Physical Machine#

When running the code, you need to wait until [40.xxx] or more to press Enter and input cattools for use. During use, Chinese characters cannot be read, so they display as square boxes. If it prompts that it is not installed and the command is correct, it means it is not installed. You cannot install it using this method unless you can accurately input the installation command.

image

SSH#

For Windows 10 and above, use the system's default OpenSSH to execute [email protected] and enter the password (the password is not visible when typing).

Input cattools for use; if not installed, use the method below to install.

::: gallery
1
2
:::

If you are using Windows 10 or above and it prompts that SSH is not available, please follow Microsoft's official documentation to install Getting Started with OpenSSH for Windows.

Alternatively, use third-party SSH clients to connect, such as Putty (simple, English, easy to understand), Termius (feature-rich, English, more user-friendly), Finalshell (Chinese, easy to use, not recommended).

TTYD#

Open CatWrt Backend, enter the password, and press Enter. Find System - TTYD Terminal, enter account root, default password password (the password is not visible when typing), and input cattools for use; if not installed, use the method below to install.

image

Installing Cattools#

In the v24.9.amd64 version, we have pre-installed Cattools. We welcome older versions as well, but the software packages may be a bit outdated, and some configurations in the enhanced settings may not work.

curl https://service.miaoer.xyz/cattools/install.sh | bash

After installation, input cattools to use and display the following content.

root@CatWrt:~# cattools 
Please wait for the script to be updated.
cattools update downloaded from the second URL.
cattools updated successfully.


----------------------------------------------------------
                         CatTools                         
           https://github.com/miaoermua/cattools          
----------------------------------------------------------
1. SetIP                                  -  Set IP
2. Network_Wizard                         -  Network Wizard
3. Apply_repo                             -  Software Source Configuration
4. Diagnostics                            -  Network Diagnostics
5. Debug                                  -  Capture Logs
6. Catwrt_update                          -  Check for Updates
7. Sysupgrade                             -  System Update
8. Restore                                -  Restore Packages
9. Utilities(more)                        -  Utilities
0. Exit                                   -  Exit
----------------------------------------------------------
Please enter a number and press Enter (Please enter your choice): _

SetIP - Set IP#

Numeric item 1

You can manually configure the IP address to your desired subnet segment when creating the virtual machine, without fancy settings, making it more suitable for advanced users. It is a compromise solution compared to the network wizard below.

To operate, input the desired IP address; after execution, the network part will restart without needing to restart CatWrt to configure in the backend.

This method is suitable for traditional users; after manually configuring the network, you need to restart CatWrt to obtain normal network functionality.

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

Network_Wizard - Network Wizard (Bypass Gateway)#

Numeric item 2

The network wizard is a basic configuration that requires minimal user intervention to obtain recommended configurations, saving time and effort, including the following content:

  • [Step2] Bypass Gateway (Bypass Router)
  • [Step3] Set IP
  • [Step4] IPv6
  • [Step5] Dial-up Internet (PPPoE) / Automatic Acquisition (DHCP)
  • [Step6] DNS
  • [Step7] IP Segment
  • [Step8] Force DHCP
  • [Step9] UPNP
  • [Step10] Port Binding

Note: The bypass gateway setting currently only supports a single network port; the script will recognize single-port devices, and the bypass gateway setting will only pop up if you have a single network port. If you have multiple network ports, you will not see this.

Port binding makes eth0 the WAN port and eth1 the LAN port, which is the opposite of the default situation.

It is recommended for hosts with more than 3 network ports to perform this operation.


Bypass_gateway - Bypass Gateway#

Included in network_wizard - Network Wizard, cannot be directly called by numeric keys.

The design logic is to allow users to input the specified main router IP, automatically changing the IP to .4 of that subnet, and enabling or disabling the following functions:

  • [Step3] Obtain Main Router IP
  • [Step4] Set Bypass Gateway IP
  • [Step5] Set DNS

For example: If the user inputs the main router IP 192.168.31.1, the script automatically generates IP 192.168.31.4 for use as a bypass gateway.

Note: Once the device is changed, it cannot be restored to router mode through the network wizard; it is not recommended to use the main router as a DNS server, although it works, it is not standard.


Apply_repo - Software Source Configuration#

Numeric item 3

Allows users to automatically detect versions without selecting version numbers, selecting specified software source mirrors or main sites to obtain a rich set of software packages provided by CatWrt, compatible with old versions up to v22.12 of CatWrt.

Q: Why not integrate software source configuration and instead use the default Tencent Cloud? A: Because there is no money to operate; if integrated, it may lead to some scenarios being overloaded, causing the server to be overwhelmed.

Choose a non-main site; if you have little hope for your network environment, choose the main site. I hope non-sponsoring users can choose the free mirrors provided; if you are willing to support us, you can choose the main site.

  • The main site repo.miaoer.xyz is a software source built in Alibaba Cloud's Guangzhou data center. For the post-Cattools era, we adopt a sponsorship model.

  • Github Pages is a free project hosting mirror site.

  • Cloudflare provides free CDN acceleration; the suffix above may not be friendly to some regions, but it works.

  • Vercel provides a free serverless hosting mirror site.

  • Netlify provides a free serverless hosting mirror site.

Choose the corresponding service number, or do nothing and wait 5 seconds to default to using the Vercel mirror. After applying, you can use opkg install to install applications.


Diagnostics - Network Diagnostics#

Numeric item 4

Automated checks of known suspicious locations to prevent disconnections or network failures caused by misoperations.

  • PING
  • DNS
  • LSLOOKUP
  • IPv4
  • IPv6
  • Preferred IPv6
  • WAN (Bypass Gateway)
  • PPPoE (DHCP)
  • WAN6
  • Tcping

Debug - Capture Logs#

Numeric item 5

Captures all issues related to plugin configuration and can be accessed via a browser, useful for reporting bugs.

Users need to execute and use [CTRL] + [Left Mouse Click] to open the logs, [CTRL] + [C] to copy all text, and create a file named logs.txt to submit the issue.

  • Distribution
  • Online Time
  • Memory Usage Status
  • Disk Usage Status
  • Installed Application List
  • System Logs
  • Kernel Logs
  • Some Plugin Logs
  • All Running Tasks
  • Network Card Information
  • Network Configuration (including dial-up information; if it offends, please erase it or send it directly via email)
  • Firewall
  • Routing Table

Submit Issue or email [email protected] with the subject catwrt logs: + issue description.

TG Group: t.me/miaoergroup // QQ Group: 669190476


CatWrt_update - Check for Updates#

Numeric item 6

The design logic is to check whether the checksum values of local files and the blog backend server are the same to implement update checks.

Current version on this machine:

LOCAL  =================================================
Current Version: v24.9
Current Architecture: amd64
Current Channel: Beta
========================================================

Latest version: Your CatWrt is the latest version!

Non-latest version: `New CatWrt updates found! Preview blog to learn more."!"

UPDATE  ================================================
New version found: v23.8 > v24.9 (Beta)
Version: CatWrt.v24.9.amd64
Blog: https://www.miaoer.xyz
========================================================

Sysupgrade - System Update#

Numeric item 7

The design logic is to automatically detect whether the upgrade conditions are met and automatically obtain the download link without the hassle of going to the website to download.

Detection items:

  • EFI
  • Total Space Size
  • Is it x86_64 (AMD64)?

Upgrading the system will cause all software installed via the software source to be overwritten by the new firmware.

The ROOT account password may be restored to the default password: (password).

During the upgrade process, plugin configurations and pre-installed plugins will be retained for the upgrade.

It will erase plugins installed via opkg or manually, which can be obtained later from the software source!

This update will also download the latest version; it is recommended to check for updates using catwrt_update in Cattools before updating.

Download items:

Whether to choose the accelerated download provided by ghproxy, originally downloaded directly from Github release.


Restore - Restore Packages#

Numeric item 8

This function is used to restore packages after a system upgrade. As is well known, CatWrt (LEDE) loses manually installed plugins after an upgrade.

Used in conjunction with Sysupgrade - System Update, this function backs up the list of already installed packages before the system update. After the update is complete, use the Configure Software Source function to obtain the latest software source.

After operating, use this function to read the package list; Cattools will automatically install the software and plugins that were present before the upgrade.


Utilities(more) - Utilities#

Numeric item 9

The design logic is to implement support and configuration for some applications, providing one-stop configuration.

  • 1 Kernel Download: After downloading the kernel, the functionality of plugins can be enabled, provided by user configuration files.

  • 2 Tailscale Configuration: Can automatically configure Tailscale for remote networking and intranet penetration.

  • 3 Leigod Configuration: Can install the Thunder Accelerator plugin to accelerate gaming consoles, PCs, and mobile phones.

  • 4 TTYD Passwordless: Suitable for SSH terminal debugging in non-networked environments or convenient operation during new environment configuration; it is dangerous, so it is not recommended for beginners to enable.

  • 5 SSL/TLS Upload: Configures the manually downloaded certificate package for Tencent Cloud and Alibaba Cloud, needs to be paired with DDNS domain resolution.

  • 6 Reset Root Password: Restores the password to password, suitable for operations after connecting x86_64, or simply when the SSH software saved the password but you forgot it.

  • 7 Reset System: Restores the system to factory settings (the original state of CatWrt firmware), abandoning all configurations and plugins to start over.

  • 0 Return to Cattools Main Menu

This article is synchronized and updated to xLog by Mix Space. The original link is https://www.miaoer.xyz/posts/blog/cattools

Footnotes#

  1. https://www.miaoer.xyz/posts/blog/ssh-connection-to-openwrt

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