OpenWrt 拥有强大的网络组件,可以实现 NAS、小型服务器、远程监控以及智能家居等功能。文章中介绍了如何在 VMware Workstation 15 Pro 环境下,安装 OpenWrt 官方原版镜像。

操作步骤
1、前往 OpenWrt 的官网 https://openwrt.org/zh/downloads 下载原版镜像,选择「稳定发行版」。在列表中找到最新的固件版本,选择「targets」,处理器架构选择「x86」>「64」,接着选择对应的固件进行下载。


2、OpenWrt 官方提供的是 img 格式的镜像文件,虚拟机无法直接使用,所以我们需要先利用「StarWind Converter」将镜像转换为 vmdk 格式的虚拟磁盘文件。
3、启动下载好的「StarWindConverter」虚拟磁盘格式转换工具,选择刚刚下载的 OpenWrt 镜像文件。


4、根据不同的虚拟环境选择不同的格式,我们测试环境使用的是「VMware Workstation」,所以列表选择「VMware growable image」,点击下一步,磁盘类型选择「SCSI」。


5、接着选择文件存储位置,保存默认即可,点击下一步,转换成功。


6、启动「VMware Workstation」,选择「创建新的虚拟机」。

7、选择「自定义」配置,点击下一步。

8、硬件兼容性和操作系统选项保持默认。


9、操作系统类型可选择「Linux」>「其他 Linux 3.x 内核」,并为虚拟机命名和选择保存位置。


10、处理器和内存配置保持默认。


11、网络类型选择「使用桥接网络」。

12、IO 类型和磁盘类型保持默认。


13、磁盘选择「使用现有磁盘文件」,选择刚才转换好的磁盘文件。


14、最后点击「完成」创建,并启动虚拟机。


在 VMware 环境下 OpenWrt 无法识别虚拟网卡的解决方法
1、将虚拟机关闭电源,并前往该虚拟机的保存位置,找到 vmx 格式的虚拟机配置文件,用记事本软件进行编辑。

2、在配置文件最后一行加上以下代码,保存退出。其作用将虚拟网卡类型设置为 Intel e1000,使 OpenWrt 能够识别出来。
ethernet0.virtualDev = "e1000"
在 VMware Workstation 上搭建 OpenWrt 软路由系统
https://blog.kobin.cn/blog/network/n2/1571.html