I've spent all day today trying to setup Openwrt on my Raspberry Pi 4 to replace my current router which broke down yesterday. I've gotten so far as to get wifi and internet working. However I am unable to SSH into my Raspberry Pi afterwards. My setup, procedure, configuration is below.
Quick note, I unfortunately do not have a monitor or a spare ethernet cable, so it's essential that I can SSH to my Raspberry Pi over wifi.
I'm sure this is a simple fix, but I've read through dozens of tutorials and forum posts and could still not figure it out. I'm not an expert when it comes to networking, so I finally gave in and decide to make a post.
u dont have any static interface with dhcp on it !!!!!! u need activate a static interface with ip 192.168.1.1 subnet 255.255.255.0 and activate dhcp on it ! after u get a lan for you and acces on ssh and luci
What is your overall network? Is there already a router or is the Pi going to be the main router?
With LAN as a DHCP client, it has to get its IP from the Ethernet cable, so I suspect (and hope) you have it plugged into a cable or DSL "home gateway" which is acting as a router. You'd have to check the status on that device to know the Pi's IP address.
If there is no DHCP server on the network, the PI will not have an IP address and it will not be possible to communicate with it. In that case you should flash the card again back to defaults and set up a conventional WAN-LAN router where LAN has a static IP.
Thank you for the quick reply! This allowed me to access SSH over wifi but now I have no internet. I have confirmed that I can connect to the internet if I connect the ethernet cable from my modem directly into my laptop.
I can't ping any ips directly from the Pi either. I have also tried changing the DNS to "1.1.1.1" on the pi at /etc/config/dhcp
So doing that made me not able to access the SSH over the wifi again, it also did not fix the no internet issue.
I first changed only /etc/config/network and it didn't work. Then I thought it was because the wifi interface was still lan, so I reflashed the Raspberry Pi and did the same changes and also changed the interface in /etc/config/wireless to wan, which didn't work either.
/etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd6c:d5f1:34b4::/48'
config interface 'wan'
option type 'bridge'
option ifname 'eth0'
option proto 'dhcp'
option ip6assign '60'
option interface 'wlan'
option proto 'static'
option ifname 'wlan0'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '64'
list dns '1.1.1.1'
I tried it 2 times and it still won't allow me to ssh into the Raspberry Pi and there is no internet. Could it be a firewall issue since the interface was changed from lan to wan?
Doing a ipconfig on my Laptop does shows the correct info for the raspberry Pi.