在ESXI中安装OpenWrt虚拟机

先贴出OpenWrt地址↗

官网↗下载X86/64虚拟机映像,为兼容起见选择openwrt-23.05.4-x86-64-generic-ext4-combined.img,不使用EFI。

接下来对镜像进行转换,安装StarWind V2V Converter

此处可直接将转换完成的vmdk文件远程推送至ESXI中。

成功运行虚拟机后首先修改网络配置,位置在/etc/config/network

注意,OpenWrt中默认安装的文本编辑器为vim而非nano

本次安装目的是配置旁路由,所以并未配置Wan接口,修改后Lan口应有配置如下所示:

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '10.0.0.2'
        option netmask '255.255.255.0'
        option gateway '10.0.0.1'
        list dns '10.0.0.1'

下一步换软件源到清华源↗,自动换源命令如下:

sed -i 's_downloads.openwrt.org_mirrors.tuna.tsinghua.edu.cn/openwrt_' /etc/opkg/distfeeds.conf

禁用Lan口上默认配置的DHCP和IPv6,修改DNS为当前网关以连通网络,否则会出现报错如下:

Failed to send request: Operation not permitted

安装汉化和虚拟机探头:

opkg install open-vm-tools luci-i18n-base-zh-cn

在23.05.4中,luci-i18n-opkg-zh-cnluci-i18n-firewall-zh-cn已经被依赖于luci-i18n-base-zh-cn,无需另外安装。

至此基础安装完成,可以进行下一步配置。