If you want a highly customizable, low-power router that punches way above its weight class, an OpenWrt Raspberry Pi build is the benchmark. But choosing the right board and USB network interface in 2026 is a minefield of chipset compatibility and PCIe lane bottlenecks.

The direct answer: For 90% of home and small-office builds, the Raspberry Pi 4 Model B (4GB) paired with an AX88179-based USB 3.0 Gigabit adapter is the definitive pick. It offers the best balance of thermal stability, driver support, and cost. The code and configurations in this guide target this exact hardware combination.

The Verdict: Which Raspberry Pi for OpenWrt?

Before we flash an image, we need to terminate the "which board" debate. The Raspberry Pi 5 is faster, but its PCIe lane is dedicated to the HAT header, meaning you must buy a specific 2.5G Ethernet HAT to get dual-wire-speed routing. The Pi 4 routes both its onboard Gigabit Ethernet and USB 3.0 ports through a single PCIe Gen 2 x1 lane (maxing out around 4 Gbps shared). This means you cannot push 1 Gbps WAN and 1 Gbps LAN simultaneously at absolute wire speed, but for internet plans under 800 Mbps, it is imperceptible.

Use Case Board Pick Network Topology Verdict
Standard Home / Sub-Gigabit Fiber Pi 4 Model B (4GB) Onboard LAN + USB 3.0 WAN DEFAULT PICK (Best ROI)
Multi-Gigabit / Power User Pi 5 (8GB) Onboard LAN + PCIe 2.5G HAT WAN Choose if ISP > 1Gbps
Travel / Portable Firewall Pi Zero 2 W WiFi WAN + USB 2.0 Ethernet LAN Choose for hotel/road use

Parts List & Hardware Spec Sheet

Do not buy random USB Ethernet adapters. The Linux kernel includes different drivers for different chipsets, and OpenWrt requires you to manually install the exact kmod package for your silicon. Here is the exact bill of materials for the default pick.

  • Compute: Raspberry Pi 4 Model B (4GB RAM) — Do not use the 8GB variant; OpenWrt rarely exceeds 512MB RAM usage, and the 4GB runs cooler.
  • WAN NIC: UGREEN USB 3.0 Gigabit Ethernet Adapter (AX88179 Chipset). Avoid Realtek RTL8153 if possible; the ASIX AX88179 driver (kmod-usb-net-asix-ax88179) is vastly more stable under heavy NAT loads.
  • Storage: SanDisk Max Endurance 32GB microSD. Standard SD cards will die in 6 months from OpenWrt's frequent DHCP lease and syslog writes.
  • Power: Official Raspberry Pi 27W USB-C Power Supply (or the original 15W Pi 4 supply if not using power-hungry USB peripherals).
  • Enclosure: GeeekPi Aluminum Passive Cooling Router Case.
Bench Note: The ASIX AX88179 chipset gets warm. If you are placing the Pi in a sealed enclosure, ensure the USB dongle is either mounted outside the case via a short extension cable, or that the case has active airflow over the USB ports.

Network Interface & GPIO Pin Mapping

A router isn't just about network interfaces; physical feedback and recovery are critical when you lock yourself out of the web UI. We are mapping the onboard Ethernet to the LAN bridge, the USB Ethernet to WAN, and utilizing two GPIO pins for a physical status LED and a hard factory-reset button.

Function Interface / Pin OpenWrt Logical Name Notes
LAN (to Switch/AP) Onboard RJ45 (eth0) br-lan Handles DHCP server, Web UI, SSH
WAN (to Modem) USB AX88179 (eth1) wan / wan6 DHCP client, PPPoE, MAC cloning
Status LED GPIO 16 (Header Pin 36) sys_led Active High (3.3V to LED Anode)
Factory Reset GPIO 21 (Header Pin 40) reset_btn Active Low (Pull-up enabled, ground to trigger)

Flashing and Initial UCI Network Configuration

Download the official OpenWrt ext4 factory image for the Pi 4 from the OpenWrt Table of Hardware and flash it to your SanDisk microSD using BalenaEtcher. Boot the Pi, connect your PC to the onboard RJ45 port, and SSH into 192.168.1.1.

Below is the complete, compilable shell script to configure your network interfaces and set up the GPIO watchdog. This script targets the Raspberry Pi 4 Model B and assumes your USB adapter has enumerated as eth1.

#!/bin/sh
# OpenWrt Network & GPIO Setup Script
# Target: Raspberry Pi 4 Model B (4GB) + AX88179 USB NIC
# Requires: kmod-usb-net-asix-ax88179, kmod-gpio-button-hotplug

set -e

# 1. Verify USB WAN interface exists before proceeding
if ! ip link show eth1 > /dev/null 2>&1; then
    echo "ERROR: eth1 not found. Did you install kmod-usb-net-asix-ax88179?"
    echo "Run: opkg update && opkg install kmod-usb-net-asix-ax88179"
    exit 1
fi

# 2. Configure WAN (eth1) via UCI
uci delete network.wan.ifname 2>/dev/null || true
uci set network.wan=device='eth1'
uci set network.wan.proto='dhcp'
uci set network.wan.peerdns='0' # We will use AdGuard Home later

# 3. Configure WAN6 (IPv6)
uci delete network.wan6.ifname 2>/dev/null || true
uci set network.wan6=device='eth1'
uci set network.wan6.proto='dhcpv6'

# 4. Configure LAN (eth0) to bridge
uci delete network.lan.ifname 2>/dev/null || true
uci set network.lan.device='br-lan'
uci set network.lan.proto='static'
uci set network.lan.ipaddr='192.168.10.1' # Changed from default .1.1
uci set network.lan.netmask='255.255.255.0'

# 5. Define the bridge device for LAN
uci set network.br_lan=device
uci set network.br_lan.type='bridge'
uci set network.br_lan.name='br-lan'
uci add_list network.br_lan.ports='eth0'

# 6. Configure GPIO Reset Button (Pin 21)
# Requires: opkg install kmod-gpio-button-hotplug
uci set system.gpio_reset=button
uci set system.gpio_reset.button='reset'
uci set system.gpio_reset.action='released'
uci set system.gpio_reset.handler='logger -t reset-btn "Factory reset triggered via GPIO 21"; firstboot -y && reboot'
uci set system.gpio_reset.min='3' # Must hold for 3 seconds
uci set system.gpio_reset.max='10'

# 7. Commit and Restart
uci commit network
uci commit system
/etc/init.d/network restart
/etc/init.d/gpio-button-hotplug restart

echo "Configuration applied successfully. Web UI is now at 192.168.10.1"

Before running this, ensure you have installed the necessary kernel modules via opkg update && opkg install kmod-usb-net-asix-ax88179 kmod-gpio-button-hotplug.

Troubleshooting: WAN Enumeration & DHCP Failures

The most common failure mode in an OpenWrt Raspberry Pi build is the WAN interface failing to pull an IP address from your ISP modem. You will see this exact error string looping in your system log (logread -f):

netifd: Interface 'wan' is now down
udhcpc: sending discover
udhcpc: sending discover

If you encounter this, here are the first three things to check, ranked by probability:

  1. Missing Kernel Module (90% of cases): OpenWrt does not ship with every USB Ethernet driver to save flash space. If you bought an adapter with a Realtek RTL8153 chip but installed the ASIX driver (or vice versa), the interface will not enumerate. Run lsusb to identify the chipset, then install the exact matching kmod-usb-net-* package.
  2. ISP MAC Address Binding (8% of cases): Many cable ISPs (like Xfinity or Spectrum) bind your service to the MAC address of the first router you connected. The Pi's USB NIC has a new, unknown MAC. Fix: Clone your old router's MAC address in the LuCI Web UI under Network → Interfaces → WAN → Advanced Settings → Override MAC address.
  3. USB Power Brownout (2% of cases): The Pi 4 limits USB port power output. If the AX88179 adapter drops under heavy load, the kernel will reset the USB bus. Check dmesg | grep -i usb for "over-current" or "reset high-speed USB device" warnings. Use a powered USB 3.0 hub if this occurs.
Pro-Tip: If you are connecting directly to a fiber ONT (like Verizon Fios) that requires DHCP Option 60 or specific VLAN tagging, you must configure this in the /etc/config/network file under the WAN interface using option vendorid or by creating a wan.vid 802.1Q interface.

Extending the Build: VLANs and AdGuard Home

Once your base routing is stable, you have two distinct paths to level up this build: extending its features, or simplifying its hardware.

Path A: Extending with AdGuard Home

Running DNS filtering on the Pi itself is trivial given the 4GB of RAM. SSH into the Pi and run the official AdGuard Home installation script. Once installed, navigate to Network → DHCP and DNS in LuCI, and set the DNS forwardings to 127.0.0.1#5353 (AdGuard's default non-standard port to avoid conflicts with dnsmasq). This gives you network-wide ad-blocking without buying a Pi-hole dedicated device.

Path B: Simplifying via 802.1Q VLAN Trunking

The biggest physical weakness of the Pi router is relying on a USB dongle for WAN. USB connectors vibrate loose, and the AX88179 chip runs hot. You can eliminate the USB dongle entirely by using a managed switch (like a TP-Link TL-SG105E or Ubiquiti USW-Flex) and 802.1Q VLANs.

How it works: You create a VLAN (e.g., VLAN 10 for WAN) on the managed switch. The switch's uplink port connects to the Pi's onboard eth0. The Pi receives both LAN and WAN traffic on a single physical cable, separated by virtual tags. You then configure eth0.10 as your WAN interface in OpenWrt. This drops your power consumption, removes the USB bottleneck, and results in a vastly more reliable physical layer. For a deep dive on switch configuration, refer to the OpenWrt VLAN switch documentation.

Building an OpenWrt Raspberry Pi router forces you to understand networking at the silicon and protocol level. Stick to the Pi 4 and the AX88179 chipset, use high-endurance storage, and you will have a router that outperforms commercial $200 units while drawing less power than a standard LED lightbulb.