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

  1. Source code/image from openwrt project page.

  2. Openwrt in docker: https://github.com/oofnikj/docker-openwrt and https://badgateway.qc.to/contain-your-router/.

  3. Openwrt/Lede project: https://github.com/coolsnowwolf/lede and some autobuilds are available at https://github.com/bigbugcc/OpenWrts.

  4. The Immortalwrt project: https://github.com/immortalwrt/immortalwrt and some autobuilds are available at https://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

  1. Your should always read the manual first before start the installation. At least you should find the following information:

    1. What’s the default management address of the openwrt in the image. For some images they are 192.168.1.1 or 192.168.10.1, etc.

    2. What’s the default user name and password for the system. For some images they are root and password.

    3. 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.

  2. 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.

  3. Set up the network interface.

    1. br-lan: The default LAN interface, it’s bridged network and connects eth0 and wlan0 together. Change the static IP address of this interface if it conflicts with your higher level router. For me, my main router is 192.168.0.1, so I change the IP address of this interface to 192.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.

    2. 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 -> Configure br-lan device -> General device options -> Bridge ports set to ‘unspecified’/remove eth0 from this ports)

    3. Add WAN interface: The protocal is DHCP client so it can acquire address from the higher level router. Also, add physical interface eth0(the one removed from br-lan) to this network interface.

  4. 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
See Also:
Making Some Donations
Rescue partition table after major update of Windows via parted
Change swap size in Ubuntu