☕ Buy a Coffee
Home / Coding & Productivity

How to Build a Gigabit OpenWrt Router on Raspberry Pi 4 & CM4

Transform a Raspberry Pi 4 (or Compute Module 4 with dual NIC baseboard) into a high-throughput 1Gbps OpenWrt router capable of running AdGuard Home, WireGuard, and Docker.

Sachin Siju
Sachin Siju
Lead Systems Engineer & Tech Blogger
Aug 18, 2026 7 min read
How to Build a Gigabit OpenWrt Router on Raspberry Pi 4 & CM4

The Quad-Core ARM Cortex-A72 Powerhouse

A Raspberry Pi 4 offers massive CPU throughput compared to traditional $150 consumer routers. Paired with a secondary USB 3.0 Gigabit Ethernet adapter (RTL8153 or ASIX AX88179) or a dual-NIC CM4 carrier board, it handles symmetric gigabit NAT with zero CPU sweat.

1. Flashing OpenWrt to MicroSD / USB SSD

# Download Raspberry Pi 4 64-bit ext4 factory image
gunzip openwrt-23.05.x-bcm27xx-bcm2711-rpi-4-ext4-factory.img.gz
# Flash via dd or Raspberry Pi Imager
sudo dd if=openwrt-rpi-4.img of=/dev/sdX bs=4M status=progress

2. Configuring Dual Ethernet (eth0 as LAN, eth1 as WAN)

Edit /etc/config/network on your Pi to map physical interfaces:

config interface 'lan'
    option device 'eth0'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'

config interface 'wan'
    option device 'eth1'
    option proto 'dhcp'
Featured Infrastructure Partner

Deploy on High-Performance Hostinger Cloud

Get up to 75% OFF + free domain & SSL. Powering xube.me's sub-second response times.

Claim Discount ↗

Discussion & Insights

Related Technical Essays