Raspberry Pi 4 Unable to access SSH over wifi

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.

Thank you for your help and time!

Image: openwrt-bcm27xx-bcm2711-rpi-4-ext4-factory.img (Latest snapshot)

Procedure:

  1. Flash image to micro SD card
  2. Boot up Raspberry Pi and connect over ethernet
  3. Configure wifi and make sure it's working
  4. Configure network interface to use dhcp (In order to get internet when I connect to my modem)
  5. Unplug Raspberry Pi
  6. Move Raspberry Pi over to modem and connect ethernet cable
  7. Boot up Raspberry Pi
  8. Connect to wifi, internet works but cannot access SSH

Setup:

Modem --> Raspberry Pi --> Computer (Wifi)

/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 'fdd0:700b:1438::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0'
        option proto 'dhcp'
        option ip6assign '60'	

/etc/config/wireless:

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '36'
        option hwmode '11a'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option country 'US'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

Does the RPi respond to pings? Are you SSHing to the right address?

1 Like

do you havec acces pign 192.168.1.1 ? or acces to luci webadmin

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

config interface 'wlan'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '64'
option ifname 'wlan0'
list dns '1.1.1.1'

1 Like

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.

whith rpi4 use arduino with ch340 or arduino board to get acces on it in hard vith ttl console

For serial console to work on a Pi4 you will have to add enable_uart=1 to the config.txt in the boot partition.

uart allready actived by default on rpii4 :wink: only plug and play

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

I ran a few commands for debugging:

root@OpenWrt:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether dc:a6:32:01:fb:66 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::dea6:32ff:fe01:fb66/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-lan state UP qlen 1000
    link/ether dc:a6:32:01:fb:67 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::dea6:32ff:fe01:fb67/64 scope link
       valid_lft forever preferred_lft forever
10: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether dc:a6:32:01:fb:67 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fd6c:d5f1:34b4::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::dea6:32ff:fe01:fb67/64 scope link
       valid_lft forever preferred_lft forever

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr DC:A6:32:01:FB:67
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd6c:d5f1:34b4::1/64 Scope:Global
          inet6 addr: fe80::dea6:32ff:fe01:fb67/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1097 errors:0 dropped:0 overruns:0 frame:0
          TX packets:130 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:123081 (120.1 KiB)  TX bytes:16988 (16.5 KiB)

eth0      Link encap:Ethernet  HWaddr DC:A6:32:01:FB:66
          inet6 addr: fe80::dea6:32ff:fe01:fb66/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:33568 errors:0 dropped:1 overruns:0 frame:0
          TX packets:2121 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2227201 (2.1 MiB)  TX bytes:263112 (256.9 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:378 errors:0 dropped:0 overruns:0 frame:0
          TX packets:378 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:29464 (28.7 KiB)  TX bytes:29464 (28.7 KiB)

wlan0     Link encap:Ethernet  HWaddr DC:A6:32:01:FB:67
          inet6 addr: fe80::dea6:32ff:fe01:fb67/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11986 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11719 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1279158 (1.2 MiB)  TX bytes:1831563 (1.7 MiB)

New /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 'lan'
        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'

My Raspberry Pi will be the main router. I seem to have fixed the SSH issue but now there is no internet.

go to ssh :frowning:

  • connect
  • vi /etc/config/network
  • change config interface 'lan' to config interface 'wan'
    -save and exit
    -uci commit network
    -uci commit
    -reboot

wlan0 are on lan zone and wan are on web zone

How does it connect to the internet? Is there another modem from ISP?
Which protocol does your ISP use? DHCP, PPPoE or something else?

are on dhcp :slight_smile:

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'

/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '36'
        option hwmode '11a'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option country 'US'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'wan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

I'm using a modem from my ISP and it uses DHCP.

So the setup is:
Modem --> Router --> Computer via Wifi

config wifi-iface 'default_radio0'
option device 'radio0'
option network 'wan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'

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.

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . : lan
   Link-local IPv6 Address . . . . . : fe80::28ca:4240:b9fc:15db%3
   IPv4 Address. . . . . . . . . . . : 192.168.1.234
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

uci show network

I can't execute that command since I cannot SSH into the Raspberry Pi and have no monitor to hook it up to...