西维蜀黍

【OpenWrt】运行在ESXi中的OpenWrt增加硬盘容量

Knowledge

Partition layout

The x86 image is using the following partition layout (as seen from inside of the device):

  1. /dev/sda1 is a 16MB ext4 /boot partition where GRUB and the kernel are stored.
  2. /dev/sda2 is a 256MB partition containing the squashfs root filesystem and a read-write f2fs filesystem OR the ext4 root filesystem (depending on what image you have chosen).

Any additional space in the device is unallocated.

  ...


【OpenWrt】维护

Install

Ref

常用软件

$ opkg install vim curl git htop wget iperf3 tcpdump fdisk unzip git make gcc tar diffutils grep wget python3 bind-dig scapy losetup luci-app-hd-idle block-mount kmod-fs-ext4 kmod-usb-storage resize2fs cfdisk vim e2fsprogs fdisk kmod-usb-core block-mount kmod-fs-ext4 kmod-usb-storage-extras e2fsprogs blkid parted losetup

Golang

// TODO

  ...


【OpenWrt】包管理

# Install a package:
$ opkg install package

# Remove a package:
$ opkg remove package

# Update the list of available packages:
$ opkg update

# Upgrade all the installed packages:
$ opkg upgrade

# Upgrade one or more specific package(s):
$ opkg upgrade package(s)

# Display information for a specific package:
$ opkg info package

# List all the available packages:
$ opkg list
  ...


【OpenWrt】安全性设置

SSH

打开 系统 -> 管理权 -> SSH访问

  • 指定监听接口为 lan 仅可内网访问。
  • 修改默认端口为其他端口,如30001等非常用端口。
  • 不允许密码验证
  • 不允许 root 用户凭密码登录
  ...


【Linux】Debian

Packages

Below is an example of a /etc/apt/sources.list for Debian 11/Bullseye, which is the default source as well.

deb http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main

deb http://deb.debian.org/debian-security/ bullseye-security main
deb-src http://deb.debian.org/debian-security/ bullseye-security main

deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.debian.org/debian bullseye-updates main
  ...