
Introduction
OpenWrt is a powerful and lightweight Linux distribution designed for embedded devices. By installing it on a Raspberry Pi 5, you can transform your device into a high-performance router, firewall, VPN server, or a custom network gateway.
This guide walks you through a complete OpenWrt installation and basic configuration.
🛠 Requirements
Raspberry Pi 5 (preferably with 4 GB or 8 GB RAM)
microSD Card (minimum 8 GB, Class 10 recommended)
USB Ethernet adapter (optional, for dual Ethernet setup)
Power adapter
Ethernet cable
A computer (Windows, macOS, or Linux)
📥 Step 1: Download OpenWrt Image
Visit the OpenWrt Official Downloads Page.
Navigate to:
Example:
openwrt-23.05.3-bcm27xx-bcm2712-rpi-5-ext4-factory.img.gz
💾 Step 2: Prepare the SD Card
Insert the SD card into your computer.
Use balenaEtcher or Raspberry Pi Imager to flash the downloaded .img.gz file onto the SD card.
Once flashing is complete, safely eject the SD card.
⚡ Step 3: Boot OpenWrt on Raspberry Pi 5
Insert the SD card into your Raspberry Pi 5.
Connect the Pi to your router or computer using an Ethernet cable.
Power on the Raspberry Pi and wait for it to boot.
By default, OpenWrt will assign itself the IP address 192.168.1.1 and start a DHCP server.
🔌 Step 4: First Connection
If your computer is directly connected to the Raspberry Pi:
Set your computer’s Ethernet adapter to obtain an IP address automatically (via DHCP).
Open a browser and navigate to http://192.168.1.1.
You should see the OpenWrt web interface, LuCI.
⚠️ Important: There is no root password set initially. You must set one immediately!
🛡 Step 5: Set the Root Password
In LuCI, go to System > Administration.
Create and save a new root password.
Note: Without setting a password, SSH access is disabled by default for security.
🌐 Step 6: Configure Internet (WAN) Connection
If you plan to use your Pi as a router:
Navigate to Network > Interfaces.
Edit the WAN interface:
Edit the LAN interface:
Save the changes and reboot the device.
🌟 Step 7: Essential OpenWrt Settings
1. Set Timezone and Date
Go to System > System and adjust the timezone settings.
2. Update Software Packages
In System > Software, refresh the package lists.
Install useful packages such as:
3. Enable SSH Access
You can enable SSH access for advanced configurations.
⚙️ Step 8: Dual Ethernet Setup (Optional)
If you added a USB Ethernet adapter:
Go to Network > Interfaces and create a new interface.
Assign the USB Ethernet port as WAN and the onboard Ethernet port as LAN.
Result:
eth0 → WAN (Internet)
eth1 → LAN (Local network)
This setup is ideal for a proper router deployment!
🛡️ Step 9: Firewall and Security
Go to Firewall > Traffic Rules to configure custom access rules.
You can restrict or allow management access based on IP addresses.
🚀 Bonus: Install AdGuard Home on OpenWrt (Optional)
You can install AdGuard Home (or Pi-hole) directly on OpenWrt to block ads and trackers across your entire network.
🎯 Conclusion
By following these steps, you’ve successfully turned your Raspberry Pi 5 into a fully functional OpenWrt router!
From here, you can set up a VPN server, implement QoS settings, enhance your firewall, or even run network-wide ad blocking.
