更新时间: 2024-01-17 07:28:11#PVE下 openwrt 软路由安装、扩容、镜像下载 安装参考图文 https://optimus-xs.github.io/posts/install-openwrt-in-pve/ 下载: 直接搜x86 软路由 推荐:https://downloads.immortalwrt.org/releases/24.10.6/targets/x86/64/ 官方[不推荐xx]: https://firmware-selector.openwrt.org,后边都得自己配置,麻烦 替换国内源:immortalwrt不需要 https://mirrors.tuna.tsinghua.edu.cn/help/openwrt/ 再执行apk update【官方包时使用】 其他包下载【官方包时使用】 https://fantastic-packages.github.io/releases/25.12/packages/x86_64/packages/ 别修改/etc/resolv.conf ,会被覆盖 改 /etc/config/network . 生效重启 service network restart config interface 'lan' option device 'br-lan' option proto 'static' list ipaddr '192.168.31.100/24' option netmask '255.255.255.0' option gateway '192.168.31.1' list dns '223.5.5.5' list dns '119.29.29.29' option ip6assign '60' op页面打开 ,搜索安装 uci-i18n-base-zh- 中午语言,刷新可见中文页面 终端ssh进入, apk add fdisk e2fsprogs lsblk 扩容:装diskman . 1. pve页面扩容原有硬盘,新加也行 2. op web页面 diskman 点击新建,格式化为ext4 3. 挂载点页面,挂载为根目录,记住命令 /dev/sda3[替换为自己的], 可命令行 fdisk -l 查看 mkdir -p /tmp/introot mkdir -p /tmp/extroot mount --bind / /tmp/introot mount /dev/sda3[替换为自己的] /tmp/extroot tar -C /tmp/introot -cvf - . | tar -C /tmp/extroot -xf - umount /tmp/introot umount /tmp/extroot 一下全粘贴到终端就可以。 reboot df -h 查看已扩容 扩容参考视频,这个是麻烦的,diskman 网页操作简单 https://www.youtube.com/watch?v=g6fEcavnDCo 无密码登录 ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.31.100 OpenWrt 使用了 Dropbear 作为 SSH 服务器(而不是标准的 OpenSSH) 你的公钥在这 cat /etc/dropbear/authorized_keys