Introduction
OpenWRT is a popular open-source firmware for routers and embedded devices. This guide will walk you through setting up OpenWRT on a virtual machine using Proxmox, a powerful virtualization platform. We’ll cover downloading the OpenWRT image, creating the VM, and configuring a LAN bridge.
Step 1: Download the OpenWRT Image
First, you need to download the latest OpenWRT image. You can get the image from the following URL:
https://images.linuxcontainers.org/images/openwrt/23.05/amd64/default/
OR
https://downloads.openwrt.org/releases/23.05.2/targets/x86/64/
This link points to the root filesystem in tar.xz format for OpenWRT 22.05 on an AMD64 architecture.
Step 2: Create the Virtual Machine
After downloading the image, the next step is to create a new VM in Proxmox. Use the following command to create a VM with the necessary specifications:
pct create 202 /var/lib/vz/template/cache/OpenWRT.tar.xz --arch amd64 --hostname OpenWrt-21.02 --rootfs local-lvm:20 --memory 1024 --cores 2 --ostype unmanaged --unprivileged 1
This command creates a VM with ID 202, sets the hostname to ‘OpenWrt-21.02’, allocates 20GB of root filesystem space, sets the memory to 1024MB, and assigns 2 CPU cores.
Step 3: Configure the LAN Bridge
The final step is to configure the LAN bridge. This will allow your VM to communicate with your network. Edit the network configuration file using vim
:
vim /etc/config/network
Then, add the following configuration for the LAN interface:
config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.1.*'
Replace 192.168.1.*
with the desired static IP address for your VM.
Conclusion
With these steps, you have successfully set up OpenWRT on a VM using Proxmox. This setup allows for a flexible and powerful network management solution. Feel free to explore more advanced configurations and enjoy the benefits of OpenWRT on your virtualized environment.