It keeps changing beetween,, etc. Is there a way to solve this without giving raspberry pi a static address? Because I ssh to the raspberry pi, or visit it on my browser, and it's slightly annoying to keep finding and changing the addresses. Thanks a lot!

  • This is most likely due to your DHCP server being misconfigured. Do you have access to the DHCP server?
    – Seamus
    Jul 24 '20 at 8:23
  • Once you get your DHCP server sorted, here's an answer that might help with keeping the same IP address.
    – Seamus
    Jul 24 '20 at 8:44
  • @Seamus It's my router.
    – Tomas
    Jul 24 '20 at 8:49
  • You should log into the router, and have a look at the DHCP configuration. You can also follow the proposal in this answer. Edit your /etc/dhcpcd.conf and add a line: inform (or whatever address you choose). This should keep your IP address constant, but still report it to the router/DHCP server - so it's always in the list of leases.
    – Seamus
    Jul 24 '20 at 9:32

This shouldn't happen with a properly configured DHCP server.

You can either reserve an IP Address in your router OR request the DHCP server to assign one. E.g. the following in /etc/dhcpcd.conf will request an address on wlan0.

interface wlan0

NOTE This will only work if you request an IP Address within the range managed by the DHCP server which is available, otherwise the DHCP server will allocate an address as normal.

See How to set up networking/WiFi

  • Thank you, will try it out. It's just a router in my flat I am renting.
    – Tomas
    Jul 24 '20 at 9:10

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.