以下、<Version> は、適宜読み替えてください。 ※ここでは、 OpenWrt 23.05 以降のバージョンでの設定を記載しております。
"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" convertfromraw --format VDI openwrt-<version>-x86-64-generic-ext4-combined.img openwrt.vdi
+----------------------------+ | Host | | | | +-------------------------+| | |OpenWrt || | | || | | +------------+ +------+ || | | |eth0 | |eth1 | || | | |192.168.56.2| |(DHCP)| || | +-+------------+-+------+-+| | |HostOnly | |NAT | | | |192.168.56.1| | | | +---+------------+-+------+-++
uci batch <<EOF set network.mng=interface set network.mng.device='br-lan' set network.mng.proto='static' set network.mng.ipaddr='192.168.56.2' set network.mng.netmask='255.255.255.0' set firewall.@zone[0].network='mng' set firewall.@zone[0].name='mng' delete network.lan delete network.wan6 set network.wan=interface set network.wan.device='eth1' set network.wan.proto='dhcp' EOF
uci changes
uci commit reboot
opkg update