What you need:
- Raspberry Pi 4B
- 8GB TF or higher density
- TF card reader
- Up-to 2A usb-c power adapter
The soft needs to be pre-install:
- BalenaEcther
- Putty
- Vmware Ubuntu(or other linux OS)
- Download the OpenWrt
OpenWrt Firmware SelectorOpenWrt Firmware SelectorOpenWrt Firmware SelectorOpenWrt Firmware SelectorOpenWrt Firmware SelectorOpenWrt Firmware SelectorOpenWrt Firmware Selector
Install the img to TF card using balenaEctcher
- Check your existed router to see what's the network ipaddress and dns
-
DNS
202.96.134.33
202.96.128.86
-
- IP ADDRESS(Router internal Ip)
So we need to set the OpenWrt statis to same network:192.168.31.1
There're 3 ways to modify:192.168.31.XXX
-
SSH via Putty
-
Plug to Ethernet cable directly to PC and enter the file system(ssh or LuCi)
-
HDMI to display and control by keyboard
I will show how to use SSH to set it up
Connect the raspberry pi 4B to the PC and disable all other networksyou'll see the default IP address: 192.168.1.1
Type the hostname as:192.168.1.1(just use the port 22)
login as : root
Enter
BOOM!
Modify the /etc/config/network
Change the ipaddr to 192.168.31.188
As far as the ipaddr is in the range of 192.168.31.xx, the OpenWrt will be assigned to same network as the router network. (If you wanna use the pi to dial to modem, that will be another case)
Esc+:wq+Enter to save the changes
Type reboot and check the new IP address
And you see it's already 192.168.31.188
Now you can unplug the ethernet cable and plug to the router's LANAnd log in the LuCi server
IPv4 gateway : 192.168.31.1(router is the gateway)-> Save
Advanced Settings->Use custom servers: the dns we checked in the router->Save
The error shown in the top should be caused without password, use Putty to log in and type :
passwd
-----
------
Finally, try to connect the devices to OpenWrt wifi SSID, and it's already linked to the internetEdit->Add the wifi password
Enable SSID OpenWrt -> Save



