Installing and Configuring OpenWrt on ESXi

This article is about installing OpenWrt on an ESXi system.

Preparation

OpenWrt Firmware

You can choose to download the firmware yourself, which can generally be divided into two categories: one is the custom firmware compiled by various experts, which integrates many pre-installed applications for immediate use; the other is the official original firmware, which only contains the basic functionalities, and additional features need to be installed manually.

It is important to note that the expert-compiled firmware is generally based on the LEDE source code, making it relatively simple and convenient to use, while the official version requires adding various functions, which can be quite challenging.

This guide uses the official original firmware as a baseline.

Official website: https://downloads.openwrt.org/releases/

Installing and Configuring OpenWrt on ESXi

  • combined-ext4.img.gz: rootfs working area storage format is ext4.

  • combined-squashfs.img.gz: squashfs acts as firmware that can restore factory settings; if there is a configuration error during use, default settings can be restored directly.

  • generic-rootfs.tar.gz: rootfs image, no bootloader, can be defined to boot using grub or syslinux.

  • rootfs-ext4.img.gz: rootfs image, no bootloader, can be defined to boot using grub or syslinux, requires storage area to be ext4.

  • rootfs-squashfs.img.gz: rootfs image, no bootloader, can be defined to boot using grub or syslinux; if there is a configuration error during use, default settings can be restored directly.

Other Tools

StarWind V2V Image Converter

Download from: https://www.starwindsoftware.com/tmplink/starwindconverter.exe

Creating OpenWrt Virtual Machine

Refer to the previous article on installing iKuai.

The specific configuration is as follows:

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

After completion, do not start the virtual machine as the image has not yet been written, so it cannot boot.

Open the StarWind V2V Converter program and follow these steps to write the OpenWrt image file into the virtual machine:

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

Installing and Configuring OpenWrt on ESXi

Once done, power on the OpenWrt virtual machine.

After the code runs, press Enter a few times to check; when the following interface appears, it indicates that it has loaded successfully.

Installing and Configuring OpenWrt on ESXi

To be honest, the official version of OpenWrt loads particularly fast.

Enter the following code in the command line and press Enter:

1
vim /etc/config/network # vim is the editor, /etc/config/network is the path to the network configuration file

Move the cursor to 192.168.1.1, press i to enter edit mode, delete 192.168.1.1, and re-enter our OpenWrt address: 10.0.0.2. Then press Esc to exit edit mode, in English writing mode, type :wq and press Enter (this saves and exits, which will be displayed in the lower left corner).

Due to some version issues, you may not be able to input :wq, in which case you can also press Z twice in uppercase mode.

Then enter reboot to restart.

Configuring OpenWrt

Enter http://10.0.0.2 in the browser to open the OpenWrt management interface. The initial login password is empty.

Network Settings

Click on the top 【Network】-【Interfaces】, find the 【lan】 interface on the right side and click Edit to edit:

In the 【General Settings】 interface, set IPv4 Gateway to 10.0.0.1 (the gateway for iKuai);

In the 【Advanced Settings】 interface:

Use custom DNS servers add any public DNS, here we fill in Tencent’s 119.29.29.29

IPv6 assignment length specify 64 bits, IPv6 suffix fill in ::1

In the 【DHCP Server】’s 【General Setup】 interface, check Ignore interface (ignore this interface, do not provide DHCP service); in the 【Advanced Settings】 interface, uncheck Dynamic DHCP; in the 【IPv6 Settings】 interface, check Designated master and set RA-Service and DHCPv6-Service to disabled.

Installing and Configuring OpenWrt on ESXi

Click the 【Save】 button below, return to the 【Interfaces】 interface, and click 【Save & Apply】 below.

Click on the top 【Network】-【Diagnostics】 (network diagnostics), click any button to test the network:

Installing and Configuring OpenWrt on ESXi

Great job!

Software Source Settings

Accessing OpenWrt’s servers in China is relatively slow, and sometimes they may be unavailable or unconnectable due to regional issues. Switching to domestic software sources can help access and download faster.

Click on 【System】-【Software】 at the top, and click the 【Configure opkg…】 button.

Installing and Configuring OpenWrt on ESXi

Change the address in /etc/opkg/distfeeds.conf to any of the following domestic source addresses.

Installing and Configuring OpenWrt on ESXi

Aliyun

1
2
3
4
5
6
src/gz openwrt_core https://mirrors.aliyun.com/openwrt/releases/22.03.5/targets/x86/64/packages
src/gz openwrt_base https://mirrors.aliyun.com/openwrt/releases/22.03.5/packages/x86_64/base
src/gz openwrt_luci https://mirrors.aliyun.com/openwrt/releases/22.03.5/packages/x86_64/luci
src/gz openwrt_packages https://mirrors.aliyun.com/openwrt/releases/22.03.5/packages/x86_64/packages
src/gz openwrt_routing https://mirrors.aliyun.com/openwrt/releases/22.03.5/packages/x86_64/routing
src/gz openwrt_telephony https://mirrors.aliyun.com/openwrt/releases/22.03.5/packages/x86_64/telephony

Tencent Cloud

1
2
3
4
5
6
src/gz openwrt_core https://mirrors.cloud.tencent.com/openwrt/releases/22.03.5/targets/x86/64/packages
src/gz openwrt_base https://mirrors.cloud.tencent.com/openwrt/releases/22.03.5/packages/x86_64/base
src/gz openwrt_luci https://mirrors.cloud.tencent.com/openwrt/releases/22.03.5/packages/x86_64/luci
src/gz openwrt_packages https://mirrors.cloud.tencent.com/openwrt/releases/22.03.5/packages/x86_64/packages
src/gz openwrt_routing https://mirrors.cloud.tencent.com/openwrt/releases/22.03.5/packages/x86_64/routing
src/gz openwrt_telephony https://mirrors.cloud.tencent.com/openwrt/releases/22.03.5/packages/x86_64/telephony

Tsinghua University

1
2
3
4
5
6
src/gz openwrt_core https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/22.03.5/targets/x86/64/packages
src/gz openwrt_base https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/22.03.5/packages/x86_64/base
src/gz openwrt_luci https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/22.03.5/packages/x86_64/luci
src/gz openwrt_packages https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/22.03.5/packages/x86_64/packages
src/gz openwrt_routing https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/22.03.5/packages/x86_64/routing
src/gz openwrt_telephony https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/22.03.5/packages/x86_64/telephony

University of Science and Technology of China

1
2
3
4
5
6
src/gz openwrt_core http://mirrors.ustc.edu.cn/openwrt/releases/22.03.5/targets/x86/64/packages
src/gz openwrt_base http://mirrors.ustc.edu.cn/openwrt/releases/22.03.5/packages/x86_64/base
src/gz openwrt_luci http://mirrors.ustc.edu.cn/openwrt/releases/22.03.5/packages/x86_64/luci
src/gz openwrt_packages http://mirrors.ustc.edu.cn/openwrt/releases/22.03.5/packages/x86_64/packages
src/gz openwrt_routing http://mirrors.ustc.edu.cn/openwrt/releases/22.03.5/packages/x86_64/routing
src/gz openwrt_telephony http://mirrors.ustc.edu.cn/openwrt/releases/22.03.5/packages/x86_64/telephony

Before changing the source, ensure your system version and CPU architecture are consistent with the above. The above shows the OpenWrt 22.03.5 x86_64 architecture software sources.

Click 【Update lists…】 on the page:

Displaying Signature check passed. indicates that the signature check has passed.

Chinese Language Settings

Following the above steps, after clicking 【Update lists…】, enter zh-cn in the 【Filter:】 column, and you will get a result:

Installing and Configuring OpenWrt on ESXi

Click 【Install…】 to install:

Installing and Configuring OpenWrt on ESXi

Generally, it is recommended to check Allow overwriting conflicting package files, which allows overwriting conflicting package files.

After successful installation, refresh the page to switch to the Chinese page.

Other Settings

In the 【System】-【System Properties】 page, general settings, select timezone Asia/Shanghai;

In the 【System】-【Management Rights】 page, set the router password yourself.

IPv6 Settings

In the 【Network】-【Interfaces】 interface, there is a ready-made 【wan6】 interface, click 【Edit】:

Installing and Configuring OpenWrt on ESXi

In the 【General Settings】, select @lan for the Device:

Installing and Configuring OpenWrt on ESXi

In the 【Advanced Settings】, set IPv6 assignment length to 64; fill in IPv6 suffix as ::1:

Installing and Configuring OpenWrt on ESXi

In the 【Firewall Settings】, for Create/Assign Firewall Zone, select lan:

Installing and Configuring OpenWrt on ESXi

Save and apply.

Installing and Configuring OpenWrt on ESXi

You have been assigned an IPv6 address; in the 【Network】-【Network Diagnostics】 interface, use 【IPv6 Ping】 to test!

Installing and Configuring OpenWrt on ESXi

Installation Complete

Thus, the installation and configuration of OpenWrt is complete.

Some configurations are not very good, such as the DNS settings, where only a Tencent public DNS address is filled in, as the following scheme will optimize this part, so for now, just ensure that internet access works.

Leave a Comment