Raspberry Pi Changed IP overnight (twice)

At first I thought I was crazy, but I woke up today and it happened again. Today, and Yesterday My RP4 was a different IP than the one I went to bed with. I have a pretty bare bones Hassio setup, with only one integration so far, the RP4 is connected via ethernet.

Any thoughts?

Reserve the IP address in your router.

1 Like

Hey thanks for the quick reply. To be clear that is not the same thing as setting a static IP, yes? I am looking into that right now and it looks like there is something in my documentation for my router called “DHCP reservation”, does that sound right?

Yep, that’s right.

1 Like

You have two ways of setting a ‘fixed’ ip address, both can be considered “static”
You can do it on the particular device
Or you can do it from your router

The router method is preferred by ‘most’ network specialists as then the management is all done from one place.
You can run into issues with this with some routers, I have been ‘given’ modem/routers by ISP’s that can’t set IP adresses OR have only 25 Slots for addresses (They are now either in the bin or sold on ebay)
I have a Draytek Vigor2762ac which can reserve 300 (on a class C network, I know - but it also covers subnets and vpn instances)

1 Like

Make IP Static

change the IP to your needs.

sudo nano /etc/dhcpcd.conf

interface wlan0
static ip_address=192.168.2.25
static routers=192.168.2.1
static domain_name_servers=192.168.2.1

Thanks that’s really cool. Can you tell from this doc what page I should be looking at? The DHCP reservation thing, was from an old router, I checked and this is actually the router I have.

woops here it is
https://www.verizon.com/supportresources/content/dam/verizon/support/consumer/documents/fqgrouter-userguide.pdf

I found something called static NAT but that doesn’t seem to be quite the same
thinghttps://www.verizon.com/supportresources/content/dam/verizon/support/consumer/documents/fqgrouter-userguide.pdf

According to the document link you gave me it talks about this on page 174

A DHCP server (this is the bit we are talking about here) can either be on your modem or on a router (usually these are combined into the one box these days)
It will Issue addresses in a given range (I think mine was set in 2 to 40 (1 was the hub itself) ) so (such being the case) I’d assign addresses beyond 40.

I tend to assign addresses by use so Infrastucture goes into 240’s, servers into 230’s, TV’s into 220’s etc. Suit yourself though, whatever works for you

1 Like

No, that’s for the address seen by the rest of the internet as “Your House” leave that alone

1 Like

I went to add a new static connection, put in an IP, and - I assumed - that I had to give it the same name (Homeassistant), and the MAC address of the RP4, but it’s saying the name and the MAC address “already exists in Wireless Broadband Router’s database” .

If I edit the RP4 under the connections tab, the only option I see is a checkbox next to the RP4 with “static lease type” that I can check and then hit apply.

edit: it was the static lease type :slight_smile:

There are various ways of tackling this depending upon the manufacturer.
Given what you’ve said, I’d assume you could now go back in, select the record you have created, edit it, to give a different address (say 222 or whatever you find best) then save the record back.
I’m not certain however, I usually just play with the settings till I get what I want.
You may not want to do that in case it screws something up and you can’t revert.
Depends how confident you are.
If it works now for you, you may just want to walk away with a win.

:rofl:

1 Like

The answer is on page 173-174 of the manual.