OpenWrt (from open wireless router) is an open-source project that is an OS for creating and building your own router/firewall. It is also used for being able to embed the OS on an already existing hardware router device to research and test. I will show you how to deploy OpenWRT into a Proxmox VM so you can have a Virtual router.

Let’s get the Network ready for the VM

1 -Select the Proxmox Host in the left navigation.
2 – Select the Network.
3 – Select your Lan nic > I use vmbr0
4 – Select your Wan nic > This one I use vmbr2 because it on the network with my actual router IP.

Let’s Create the actual VM

5 – Highlight the Proxmox Host again.
7 – Give the VM a name of “openwrt” for example.
8 – Under OS Select Do not use any media.
9 – Click Next on the Sysytem tab.
10 – On the disk tab:
11 – Click on the trash bin in the upper left, then click next.
12 – 1 cpu should be sufficient, click next.
13 – I would just leave memory at default I believe 2048 MiB or 2gb, Click the Balloon device check box, You don’t need ballooning, click next.
14 – On the network tab, Select your Nic for the lan. It should be the first one you defined. Uncheck the Firewall check box, then click next.
15 – On the confirm tab click Finish.

Let’s add the WAN nic to the VM

16 – Select openwrt VM in the left navigation area.
17 – Select hardware from the middle navigation; Select Add button at top > Select Network Device > Select the Bridge > Select > Uncheck the Firewall check box > click add.

Download OpenWRT image

18 – Select the Proxmox Host > then shell.
19 – wget https://downloads.openwrt.org/releases/23.05.4/targets/x86/64/openwrt-23.05.4-x86-64-generic-ext4-combined-efi.img.gz

uncompress the image for use on the system

20 – gunzip openwrt-23.05.4-x86-64-generic-ext4-combined-efi.img.gz

Rename the disk

21 – mv openwrt-23.05.4-x86-64-generic-ext4-combined-efi.img ./openwrt.raw

Resize the image/disk
22 – qemu-img resize -f raw ./openwrt.raw 10G <- This can be whatever size you need.

Import the disk into the VM

23 – qm importdisk <vm-id> openwrt-23.05.4-x86-64-generic-ext4-combined-efi.img local-lvm

Let’s attach the disk to the VM
24 – highlight the VM > then hardware > double click the Unused Disk 0 > Click add
25 – Select Options > boot order > check iscsi (uncheck all others) > move the iscsi to the top (drag and drop) > click ok
26 – right click the VM >_ Console > start
27 – OpenWRT installation
29 – passwd (enter a new password)

The System is Ready
30 – Press Enter

The System is Ready
31 – uci set network.lan.ipaddr=’Lan_IP_Here’ <- ie. 192.168.30.1

This is an alternative way to change the ip;
Edit the Lan IP address in vi /etc/config/network

Look for the lan interface press I to enter edit mode: change the ipaddr to your router IP.

and save the file with the esc key to exit edit mode, then wq! to write and save the file. Then restart the Network. Here is a guide for using vi cli editor
32 – service network restart

Update all Packages, & Install the GUI.
33 – opkg update
34 – opkg install luci

I really hoped you learn something in this article. I know I worked at it. I installed/deployed it about 0 times to make sure every step worked. If you need anything or help feel free to contact us at support@pihobby.org. Have a magnanimous day. Thank you for reading.


By Michael Cooper

30 Years in IT. The last 10 as a Senior Systems Engineer.

One thought on “Deploy an OpenWRT VM on Promox”

Leave a Reply

Your email address will not be published. Required fields are marked *