初始化操作步骤:
修改密码
ssh root@192.168.1.1
修改IP、添加网关、添加DNS vim /etc/config/network
关闭dhcp vim /etc/config/dhcp
修改时间
重启网络 service network restart
修改软件源 sed -i 's_https://downloads.openwrt.org_https://mirrors.zju.edu.cn/openwrt_g' /etc/opkg/distfeeds.conf
更新列表 opkg update
安装软件包 opkg install luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn luci-i18n-ksmbd-zh-cn block-mount blkid kmod-usb-storage kmod-usb-storage-extras kmod-fs-vfat kmod-fs-exfat ntfs-3g-utils lsblk cfdisk exfat-mkfs dosfstools e2fsprogs luci-i18n-ttyd-zh-cn mount-utils
创建挂载点 mkdir /mnt/sda1
挂载电脑磁盘 mount.ntfs-3g /dev/sda1 /mnt/sda1
备份U盘 dd if=/dev/sdc of=/mnt/sda1/ddifof-openwrt-20230912.img count=1 bs=128M
gzip压缩 gzip -k /mnt/sda1/ddifof-openwrt-20230912.img
备份与升级-刷写新的固件
使用dd和gzip备份U盘中的openwrt
dd if=/dev/sdd count=1 bs=128M | gzip >/mnt/sda1/ddifgzip-openwrt.img.gz
使用dd和gzip刷写openwrt到U盘(先用cfdisk删除U盘中所有分区)
gzip -dc /mnt/sda1/ddifgzip-openwrt.img.gz | dd of=/dev/sdd