There are many tutorials online about installing OpenWrt on Raspberry Pi. Here, I will share my personal installation experience and the pitfalls I encountered đź•ł. I hope this article can provide some small help to you who found it.
Preparation:
1 | Raspberry Pi 3B |
2 | TF card |
3 | Network cable |
4 | Laptop |
5 | Router connected to the Internet |
1. Prepare OpenWrt firmware
The OpenWrt I have here is compiled by a guru, pre-installed with the Luci management interface, AdBlock global ad blocking, and SSR global routing level real internet plugins.
The reason it is super is that there are many plugins available in OpenWrt for you to choose from. After customizing, it is not inferior to routers worth thousands of yuan on the market.
And our Raspberry Pi plus TF card costs only about 300.
Old firmware: It will prompt SSR+ not running, but it has been recompiled and includes v2xxx.
OneDrive link: https://1drv.ms/u/s!AlDziSRQfAcSw7l_eKFjouF2hXBNcw?e=nEszKd
LanZou Cloud link: https://www.lanzous.com/i9x8nqj
New firmware: SSR+ works normally, additional plugins added.
OneDrive link: https://1drv.ms/u/s!AlDziSRQfAcSw7oJkjwPn8JnQMUrRA?e=GxSUZd
LanZou Cloud link: https://www.lanzous.com/ia0jtfi
The downloaded file is a gz compressed package, and extracting it gives you openwrt-bcm27xx-bcm2709-rpi-2-squashfs-factory.img.
If you do not want to use our firmware, you can go to the OpenWrt official website https://openwrt.org/ to download the firmware suitable for you. Note to download firmware with the word Factory.
2. Write OpenWrt firmware to TF card
Under Windows, I used Win32DiskImager, the latest official download is https://win32diskimager.download/
Select the downloaded img image, the device will automatically recognize your TF card. If not, change it manually. Then click write.
If you get a prompt saying “Error writing data to this handle, error 5: Access denied?” while writing,
Don’t worry, this is a Windows 10 security policy issue. Enter the system settings interface, search for “Folder Access Restrictions“, click in, and add the Win32DiskImager path.
3. Insert the card and start to enter the background
Insert the TF card into the Raspberry Pi and power it on. After about 30 seconds, enter the background Luci management interface.
â‘ If your computer has an Ethernet port, connect it to the Raspberry Pi with a network cable, then you can access the default 192.168.1.1.
② If your computer does not have an Ethernet port, you will see an open OpenWrt SSID in the wireless network list, enter the default 192.168.1.1.
If you see the image below, congratulations. The firmware has been successfully written to the Raspberry Pi and is running successfully.
The default username is root, and the default password is password.
After logging in, you will see the hostname, model, system architecture, firmware version, kernel version, CPU, memory, and other information.
4. Change the LAN management address
Click on Network – Interfaces, you will see only one LAN wireless network. Click modify.
Change the IPv4 address to one that is different from your existing router’s backend address, format 192.168.X.1, where X ranges from 0-255.
For example, if your router’s backend address is 192.168.1.1, you can only change it to 192.168.2.1 or another.
Special Reminder: Do not click “Save & Apply” for future operations, only click “Save”.
After completing all steps, you can click the “Unsaved Configuration” in the upper right corner to apply all modifications, otherwise, you may lose connection to the Raspberry Pi during the setup process.
5. Create a WAN input connection
Since we want to create a router, it needs a network to enter and a network to be emitted. Our terminal devices connect to the network it emits to access the internet.
However, the Raspberry Pi Zero cannot do this, while other versions can.
Because the Raspberry Pi Zero only has one network port, which is only a wireless network card, it can either receive or emit. The unfortunate Raspberry Pi Zero.
But the strength of the Zero lies in its mini size, ultra-low power consumption, and zero noise, which is unmatched by other versions.
However, the Raspberry Pi Zero also has a built-in 40-pin header. I don’t know if this expansion can allow Zero to have both input and output, looking forward to comments from hardware experts.
Other versions of the Raspberry Pi are all equipped with a limited Ethernet port and a wireless network card, plus multiple USB expansions, allowing you to connect more wireless network cards, etc.
Here, I will simply use the wired network card Ethernet as the input network interface and the wireless network card Broadcom as the output wireless network interface.
Now, go to the background management interface, which is the 192.168.x.1 you just modified, Network – Interfaces – Add new interface.
We will configure the input wired network card here.
Name it Wan, and I choose DHCP client as the protocol.
“The protocol for the new interface” depends on the specific situation. If you want to use the Raspberry Pi for dialing, choose PPPOE. If you want to connect to the LAN port of the previous device (such as a router) with a network cable, choose DHCP client.
In the interface options, select the Ethernet adapter “eth0”, and after selection, click the “Submit” button.
Click the save button, do not click the other one.
6. Configure the LAN output network
Go to Network – Interfaces, modify the existing LAN parameters that were there from the beginning.
In the physical configuration, uncheck the “Ethernet adapter wan”, and save.
7. Apply all modified parameters.
Click the “Unsaved Configuration” in the upper right corner, and click apply.
8. Raspberry Pi connects to the router to access the internet
Connect the Raspberry Pi to the router that can access the internet with a network cable. At this point, use a new terminal, such as a mobile phone, to connect to the OpenWrt wireless network and find that you can access the internet.
If you cannot access the internet, check the previous steps. If everything is correct, restart the Raspberry Pi and try again.
9. Set a password for your OpenWrt wireless network to prevent unauthorized access
Since the default OpenWrt network is open, anyone can connect…
Click Network – Wireless – Interface Configuration – Wireless Security
I choose WPS2-PSK as the encryption method, and set a password.
Click save & apply.
You may need to restart the router. Now, when you connect to the OpenWrt wireless network with a terminal, you will need to enter a password to connect, preventing unauthorized access.
10. More Fun
You can download more plugins in System – Packages to configure your super router.
I have provided hundreds of plugins already. Click the Read Original below to go directly to the Raspberry Pi purchase page.