1

I set up a pi zero for the first time, flashing Rasberry Pi OS Lite to an 8GB microsd with an ssh and wpa_supplicant.conf file to quickly connect the device to my wifi.

Worked fine for a few hours, was able to pop on the Pimoroni Pirate Audio DAC HAT and install Mopidy. Successfully accessed the server over my home wifi network.

However, today I can no longer ssh in without getting a time out. Message:

ssh: connect to host raspberrypi.local port 22: Connection timed out

I also get a timeout when trying to access the Mopidy server over my internet.

Pi shows up when ping-ed, HOWEVER, I noticed that the last digit of the IP address has changed. For example, it went from: 180.186.0.72 to 180.186.0.73.

I'm new to pi's and to messing with IP addresses, etc, so any tips on trouble shooting are appreciated.

5
  • Can you ssh to it using the new IP address? – Steve Robillard Jun 3 at 18:10
  • @SteveRobillard, doesn't look like it. Previous I was using ssh pi@raspberrypi.local – HJT Jun 3 at 18:17
  • 1
    180.186.0.73 ... your pi has a publicly visible IP4 address? I think your issue is with your whole setup if you have public IP addresses in your LAN – Jaromanda X Jun 3 at 21:52
  • @JaromandaX - that was faux Ip for example, actual initial ip digits are 192. What part of the faux one i made indicates its public? – HJT Jun 3 at 22:38
  • oh, right ... don't worry about 192.168.x.x addresses, they aren't public. Mine is 192.168.1.127 - bet you can't ping me ... private addresses are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 ... they're all safe to put in questions – Jaromanda X Jun 4 at 0:11
0

It sounds like the dhcp lease your pi had expired, and when it was renewed, instead of reissuing the same IP, your router issued a different address. This probably happened several times since you asked the question.

You will need to look at your router's client list and find out what the current ip is for the ip at the time you look.

If you don't want to look up the current ip of your pi every time, there are two ways around this:

  • give your pi a unique hostname, and use the (enabled by default) avahi dynamic name service to ssh to yourpi.local (where yourpi is the name you give it)
  • Examine your router's configuration and determine what it's dhcp address range is (for example, 192.168.1.100-200) and adjust your pi's network configuration to give it a static address in the same subnet but outside the dynamic range (for example, 192.168.1.50). (You should ping this first just to make sure something else isn't using it.)
-1

On your DHCP you need to set Raspberry Pi's IP to static (refer to routers DHCP settings)
Try:

ssh pi@180.186.0.73

...assuming you current IP on the device 180.186.0.73 (and realizing it is a fake IP according to questioner. See comments)

In the /etc/ssh/sshd_config make sure line "Port 22" not commented out like "#Port 22".

4
  • /etc/ssh/sshd_config did have line Port 22 commented, I uncommented it and it did not resolve the issue. – HJT Jun 4 at 0:36
  • @HJT Have you tried to SSH by IP? – Qareke Jun 4 at 12:28
  • Yes - ssh pi@180.186.0.73 produces the same timeout as ssh pi@raspberrypi.local. I think my next step is going to be resetting up the OS with the full raspbian rather than the lite and starting the process from step 1 to try and figure out what resulted in the sudden IP change and ssh issues. – HJT Jun 4 at 17:53
  • @HJT That probably would help because, not only your IP, but the port got changed too. – Qareke Jun 4 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.