Setting up ImmortalWRT
By Fenguoerbian in Linux OpenWRT ImmortalWRT
March 7, 2025
Introduction
This blog post is about setting up my Raspberry Pi4B as a second rounter using ImmortalWRT.
I have some old devices with limited network setting capabilities. I want to configure the network proxy etc on the back up router and use those pre-said devices to connect to the back up router. So these old devices have better network connectivity.
So for this simple router, it should have:
-
LAN: local network, managing the devices connect to it.
-
WAN: world network, connect to the world(router at higher level).
Installation methods
-
Source code/image from openwrt project page.
-
Openwrt in docker:
https://github.com/oofnikj/docker-openwrt
andhttps://badgateway.qc.to/contain-your-router/
. -
Openwrt/Lede project:
https://github.com/coolsnowwolf/lede
and some autobuilds are available athttps://github.com/bigbugcc/OpenWrts
. -
The Immortalwrt project:
https://github.com/immortalwrt/immortalwrt
and some autobuilds are available athttps://github.com/SuLingGG/OpenWrt-Rpi
.
Initially when I start this, I chose the pre-built image of Immortalwrt for its pre-configuration of many plugins. But that auto-builds do not update to newer versions of ImmortalWRT so nowadays I’m using a vanilla ImmortalWRT image.
First installation and basic configuration
-
Your should always read the manual first before start the installation. At least you should find the following information:
-
What’s the default management address of the openwrt in the image. For some images they are
192.168.1.1
or192.168.10.1
, etc. -
What’s the default user name and password for the system. For some images they are
root
andpassword
. -
Will it support wifi at boot or ssh connection? Otherwise you should prepare a cable to connect your pc to the openwrt box in order to configure it.
-
-
Just flash the image to a boot device and start the system. For me, I’m using it in a raspberry pi 4B, so I flashed it to the microSD card.
NOTE: Do NOT connect the openwrt device to a normal router yet via ethernet cable since there’s a high probability the management address will conflict.
-
Set up the network interface.
-
br-lan
: The defaultLAN
interface, it’s bridged network and connectseth0
andwlan0
together. Change the static IP address of this interface if it conflicts with your higher level router. For me, my main router is192.168.0.1
, so I change the IP address of this interface to192.168.10.1
.NOTE: The wifi will now assign address in
192.168.10.x
, you should disconnect and re-connect to obtain the new address. -
There’s only one ethernet port on my Pi4B, I have to use it as WAN port. So REMOVE it from
br-lan
. (Network -> Interfaces ->Devices
tab -> Configurebr-lan
device -> General device options ->Bridge ports
set to ‘unspecified’/removeeth0
from this ports) -
Add
WAN
interface: The protocal isDHCP client
so it can acquire address from the higher level router. Also, add physical interfaceeth0
(the one removed frombr-lan
) to this network interface.
-
-
For vanilla ImmortalWRT, you can install
-
luci-theme-argon
for a better theme -
luci-app-openclash
for a better network connection
-
Thoughts
Now the configuration is done, this Pi is a simple router. The ethenet port is the WAN
port (connect to the internet) and other devices should connect to it via wifi.
-
There are obvious other ways to set up this network, but I find this one working and simple.
-
Currently, it’s not easy for devices under different subnet to connect to each other, eg one computer under main router, the other one under this back up router. More settings are necessary for this to work.
Reference
Openwrt on Rsapberry Pi, set up LAN, WAN and WIFI: https://blog.csdn.net/u010307522/article/details/106990268
and https://www.codenong.com/cs106964619/
.
Notes about build openwrt from source: https://www.bilibili.com/read/cv9714518
- Posted on:
- March 7, 2025
- Length:
- 3 minute read, 576 words
- Categories:
- Linux OpenWRT ImmortalWRT
- Tags:
- Linux OpenWRT ImmortalWRT