I know this isn’t a homeassistant question and this isn’t a linux forum, but I’m taking advantage of this being one of the most helpful forums with people who happen to be linux knowledgable around. So with all flattery done, here is my question.
My normal setup is to use a reserved dhcp address to tie a machines mac address to a reserved IP address. Think of it as a cross between static and DHCP. This works great for everything except my raspberry pi’s. Some of my RPI’s seem to understand, others won’t pickup the address to save their lives.
I’m doing my network config in the /etc/network/interfaces file.
I set interface eth0 for inet manual, sometimes it gets it and sometimes it doesn’t. Once it gets it, it seems to be rock solid. The problem is getting the RPI to find it the first time.
I have tried inet dhcp and have finally resorted to inet static and all the ip address, netmask, gateway, broadcast stuff to go along with it.
To clarify, your DHCP server is setup to assign static IPs out to your Pi’s via their MAC address, but some are not working and require a manually setup static IP address in the interfaces file?
That is the correct term, I was just making sure I was correctly understanding your situation. I have DHCP reservations setup for multiple services I run on my network from HA to my OctoPi and just setting the interfaces to DHCP has always worked.
For devices having issues pulling the proper IP, check the /var/log/syslog for and DHCP errors as it should be working as configured, unless it is connecting via wired AND wifi at the same time that could throw a wrench in your workings.
Just wired. DHCP is being served by cisco home router. Works for everything else, just RPIs don’t seem to like it… Oh well, I have to go compile openzwave now. Grrrrr LOL
This may not be a linux solution, but if you want your Raspberry Pi(s) to have a static address, have you thought about assigning the IP address via your router? If your router’s firmware allows it, input the mac address of the Raspberry Pi’s in question into your router and have the router assign the Pi a specific address. This makes the process a lot simpler.
Then ya i’d see what the syslog says on the Pi to see what’s going on with the DHCP request, the router may not be responding fast enough. It’s hard to say since the router usually doesn’t have decent enough logs to debug from.
Thats what I’ve ended up doing. But I would prefer the DHCP reservation method, and in either case I would like to know why the DHCP reservation isn’t working.
I know, I was more hoping that someone had a “oh yea, with RPI’s you need to do this” kind of an answer. It’s not enough of a pain to research it much deeper.
I know it’s the right DHCPd replying to it, because it grabs a different dhcp address than the one reserved for it. Nothing else has a reservation for that address so it’s not a dup address thing. I’ve verified the MAC addressess several times, and cut and pasted it from the address it gets. I cleared the address it got from the dhcp queue so it wouldn’t think it had a reservation already…
What it sounds like to me is happening is that the router think’s it’s already assigned that IP out for some reason or another. If it really bothers you, like it’d bother the crap outta me, factory reset it and put your settings back in. I know it sounds brutal but the leases file may have been corrupted some how in the router’s storage.