OpenWrt in Proxmox on Raspberry Pi 4 - Internet Access
Run OpenWrt in Proxmox on Raspberry Pi 4 and share the Pi's Wi-Fi with a LAN PC. VM import, bridge setup, NAT/masquerade, DHCP and troubleshooting tips.
Is it possible to set up internet access with OpenWrt running in a Proxmox virtual machine on a Raspberry Pi 4?
Details: I have one computer connected via LAN to a Raspberry Pi 4 with OpenWrt installed. From this Pi, I get internet via Wi-Fi. If I install Proxmox on the Raspberry Pi 4 and then create a virtual machine with OpenWrt inside it, will I be able to configure network forwarding to provide internet access from the main computer?
Yes, it’s entirely possible to run OpenWrt in a Proxmox VM on your Raspberry Pi 4 and forward internet from the Pi’s Wi-Fi to your LAN-connected computer. You’ll bridge the host’s Wi-Fi as the WAN side for the OpenWrt VM, create a separate LAN bridge for the Ethernet port and host, then enable NAT in OpenWrt to route traffic. This setup turns your Pi into a virtualized router powerhouse without losing the single-NIC limitation.
Contents
- Requirements for OpenWrt Proxmox on Raspberry Pi 4
- Proxmox Networking Basics
- Creating the OpenWrt VM
- Configuring Networking in the VM
- Enabling Internet Forwarding with NAT
- Testing and Troubleshooting
- Sources
- Conclusion
Requirements for OpenWrt Proxmox on Raspberry Pi 4
Your setup sounds spot on: Raspberry Pi 4 with Ethernet to one PC and Wi-Fi pulling internet. But Proxmox on Pi isn’t official—grab a community build like those from the Proxmox forums or GitHub repos tailored for ARM64. You’ll need at least 4GB RAM on the Pi 4 (8GB ideal for smooth VM performance), a microSD or NVMe for storage, and an OpenWrt ARM64 image (UEFI-compatible for best results).
Why bother virtualizing OpenWrt? It lets you snapshot configs, run other VMs alongside, and tweak without bricking the host. Just note: the Pi’s onboard Wi-Fi can’t be directly passed through to the VM (no PCIe passthrough there). Instead, we’ll bridge it on the host. Download an OpenWrt snapshot like the ext4-combined-efi.img.gz from downloads.openwrt.org and unzip it.
Got Proxmox installed? SSH in as root. If not, flash a Pi-compatible ISO via Raspberry Pi Imager and boot.
Proxmox Networking Basics
Proxmox shines with Linux bridges—think vmbr0 for everything. With one Ethernet and Wi-Fi, create two bridges: one for WAN (host Wi-Fi internet) and one for LAN (Ethernet to your PC, plus Proxmox host access).
Edit /etc/network/interfaces:
auto lo
iface lo inet loopback
iface eth0 inet manual # Your LAN Ethernet
auto wlan0
iface wlan0 inet dhcp # Wi-Fi grabs upstream IP
auto vmbr-wan
iface vmbr-wan inet manual
bridge-ports wlan0
bridge-stp off
bridge-fd 0
auto vmbr-lan
iface vmbr-lan inet static
address 192.168.1.1/24 # Proxmox host IP
bridge-ports eth0
bridge-stp off
bridge-fd 0
Restart networking: ifreload -a. Now vmbr-wan feeds internet, vmbr-lan serves your LAN. Your PC plugs into eth0 (now bridged), gets DHCP later from OpenWrt. This mirrors advice from Proxmox forum threads.
Ever wonder why bridges over VLANs here? Simpler for single-NIC Pi setups—no trunking headaches.
Creating the OpenWrt VM
Time to spin up the VM. First, import the OpenWrt disk. Create a directory: mkdir /var/lib/vz/images/100 (VM ID 100). Then:
qm importdisk 100 /path/to/openwrt-arm64-efi-combined.img local-lvm --format raw
Attach it: qm set 100 -virtio0 local-lvm:vm-100-disk-0
Basic VM config via web UI or CLI:
qm set 100 -cores 2 -memory 512 -net0 virtio=52:54:00:12:34:56,bridge=vmbr-wan -net1 virtio=52:54:00:12:34:57,bridge=vmbr-lan -machine q35 -bios seabios -scsi0 virtio-scsi-pci -args '-device usb-kbd -device usb-mouse'
Start it: qm start 100. Console in via qm monitor 100 or noVNC. This pulls straight from the detailed GitHub gist that’s nailed Pi4 specifics.
Pro tip: Virtio drivers speed things up—OpenWrt supports them out of the box in recent builds.
Configuring Networking in the VM
Boot into OpenWrt (default no password). First-run wizard? Skip or set root password. Update: opkg update && opkg install luci.
Interfaces show net0 (WAN from vmbr-wan) and net1 (LAN to vmbr-lan). UCI magic:
uci set network.wan=interface
uci set network.wan.device='net0'
uci set network.wan.proto='dhcp' # Grabs from host Wi-Fi bridge
uci set network.lan.ipaddr='192.168.1.254/24'
uci set network.lan.device='net1'
uci commit network
/etc/init.d/network restart
Access LuCI at 192.168.1.254. Your PC (on vmbr-lan/eth0) should ping the Proxmox host at 192.168.1.1, but no internet yet. Snippets from i12bretro tutorial confirm this UCI flow works.
Set Proxmox host gateway to OpenWrt LAN: ip route replace default via 192.168.1.254 dev vmbr-lan.
Enabling Internet Forwarding with NAT
Here’s the gateway magic. In OpenWrt firewall:
uci -q delete firewall.@zone[1].masq
uci -q delete firewall.@zone[1].mtu_fix
uci add firewall masq
uci add firewall rule
uci set firewall.@rule[-1].name='Masquerade'
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].target='masq'
uci set firewall.@rule[-1].proto='all'
uci commit firewall
/etc/init.d/firewall restart
Enable forwarding: echo 1 > /proc/sys/net/ipv4/ip_forward. Make permanent via sysctl.
Your PC requests DHCP from OpenWrt (install dnsmasq if needed), gets 192.168.1.x IP, gateway 192.168.1.254. Boom—internet via Pi Wi-Fi. The Medium guide echoes this NAT step.
One NIC? No sweat—virtual bridges handle it.
Testing and Troubleshooting
Ping google.com from PC. From Proxmox: ping -I vmbr-lan 8.8.8.8. Check routes: ip route on all.
Common snags? Interface names mismatch (net0/net1 vs eth0/eth1)—ip link inside VM. Wi-Fi bridge drops? Restart host networking. Low throughput? Bump VM cores/memory. OpenWrt forum threads like this one cover driver quirks.
If USB Ethernet for WAN: passthrough via qm set 100 -hostpci0 0000:01:00.0 (check lspci). Works great for dedicated WAN.
Sources
- How to set up an OpenWRT VM in Proxmox
- OpenWrt on Proxmox VE: Turn Your Raspberry Pi into a Networking Powerhouse
- rpi4 openwrt converting to proxmox opnsense
- Run an OpenWRT VM on Proxmox VE
- Proxmox and Raspberry Pi
Conclusion
Running OpenWrt Proxmox on Raspberry Pi 4 absolutely delivers internet to your LAN PC—bridges, virtio NICs, and NAT make it reliable. You’ve got a flexible router setup now, scalable for more VMs. Tweak as needed, but test incrementally to avoid blackouts. Questions on your exact hardware? Dive into the sources or forums.