[Solved] loosing the ssh connection adding a static IP Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
ghezzia
Posts: 15
Joined: Fri Nov 19, 2021 4:30 pm

[Solved] loosing the ssh connection adding a static IP

Post by ghezzia »

Good morning,
I would set up a static IP and, once I enabled it in the dietpi-config -> Ethernet, of course, I lose the SHH connection.
The problem is that using the terminal from a mac I'm not able to connect to the new static IP (.100) any longer. I have to connect a video and a keyboard to the p zero board and reconfigure a dynamic IP.
Am I doing something wrong?
thanks in advance for any suggestion
Last edited by ghezzia on Mon Nov 22, 2021 10:21 pm, edited 1 time in total.
ghezzia
Posts: 15
Joined: Fri Nov 19, 2021 4:30 pm

Re: loosing the ssh connection adding a static IP

Post by ghezzia »

Just an update:
when I try to connect, the terminal shows me this message:

Code: Select all

ssh: connect to host 192.168.1.100 port 22: Host is down

[Process Completed]
Just in case it means something.
ghezzia
Posts: 15
Joined: Fri Nov 19, 2021 4:30 pm

Re: loosing the ssh connection adding a static IP

Post by ghezzia »

Another quick update:
I just notice that in the configuration area of my router the device does not appear, even if I'm easily working on it without any problem, with the screen and the keyboard connected to it.
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: loosing the ssh connection adding a static IP

Post by Joulinar »

are you sure your STATIC IP is located in same network segment than your DHCP IP? While setting STATIC IP, there is an option to copy DHCP to STATIC. Did you tried this option?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
ghezzia
Posts: 15
Joined: Fri Nov 19, 2021 4:30 pm

Re: loosing the ssh connection adding a static IP

Post by ghezzia »

Hi @Joulinar ,
thanks for the message.
I'm not sure what you mean with "the same network segment". Since the beginning, I had worked on the same router (the zero connected with an ethernet cable the mac via wifi.
Just to show you what I see when I modify the network I attach a screenshot.
After this screenshot, I apply to save all changes and restart networking.
Is this the error?
Attachments
Schermata 2021-11-22 alle 10.59.59.png
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: loosing the ssh connection adding a static IP

Post by Joulinar »

looks like there is a mismatch. According the screen shot, your current IP is 192.168.1.15 but you are trying to apply an IP address 192.168.0.15. This is a complete different network segment. Therefore I'm not wondering that your system is not reachable after you applied the setting.

Can you switch to DHCP. Once rebooted, go into network configuration again. Switch to STATIC. Now you should see on top a COPY. Copy current address to "Static". Hit this one and apply the settings.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
ghezzia
Posts: 15
Joined: Fri Nov 19, 2021 4:30 pm

Re: loosing the ssh connection adding a static IP

Post by ghezzia »

Thanks a lot for the suggestion.
Using “copy current address to static” works perfectly.
Topic solved ;)
Post Reply