Lost power, DHCP will not connect

Joe55

Dabbler
Joined
Sep 27, 2017
Messages
10
So my box lost power and on reboot DHCP would not connect. IP address is 0.0.0.0.

I spent a good chunk of time trying to figure this out, ranging from deleting the leases file to restarting the interface, to resetting all configuration files, resetting my router, nothing.

Finally just up and reinstalled the whole OS. That did the trick.

So, I decided to simulate this by powering off my PC (via button). Same thing. Every time.

I might as well use Arch/Ubuntu/Gentoo or Windows Server to host my NAS, since reinstalling the OS every time it loses power is stupid.

I don't know if it happens on a regular reboot, because I don't want to keep reinstalling the OS!
 

Tigersharke

BOfH in User's clothing
Administrator
Moderator
Joined
May 18, 2016
Messages
892
I agree, "reinstalling the OS every time it loses power is stupid." but that was the extreme solution that succeeded. I can virtually guarantee that you shouldn't have to do such a thing, that there is a much better method. It is entirely possible that something is not configured optimally. Some things are done a little differently on FreeBSD compared to Linux distros so I would hope that was not part of the problem. Something I do on my FreeBSD box from time to time is (as root) service netif restart ; dhclient em0 which usually works but if the problem is Comcast or DNS somewhere, I might still not get back online.

If I were a networking expert I could surely give the exact answer and lay everything out in detail, but I am not. I hope others who are more familiar with FreeNAS and networking will provide input soon. However, in the mean time, it is very strongly recommended that you describe your setup in detail, including the version of software used, wired ethernet or wifi, etc.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
This is almost certainly a problem with your set up. However, with no information to go on, it is impossible to comment.
 

Joe55

Dabbler
Joined
Sep 27, 2017
Messages
10
This is almost certainly a problem with your set up. However, with no information to go on, it is impossible to comment.

How is it a problem with my setup?

Vanilla freenas install, no modifications, default settings - power loss/reboot, cannot reconnect to DHCP even 12+ hours later.

And reinstalling FreeNAS lets it connect to the network at least one time before reboot/power loss.

Something I do on my FreeBSD box from time to time is (as root) service netif restart ; dhclient em0 which usually works but if the problem is Comcast or DNS somewhere, I might still not get back online.

No dice. This is what it looks like during bootup:

https://i.imgur.com/aETR0TE.jpg
 
Joined
Dec 29, 2014
Messages
1,135
Whatever is issuing your DHCP addresses (obviously not FreeNAS) isn't giving FreeNAS an IP address. Whatever that is (router or server) is likely part of the problem. It would be easier to provide guidance if you detailed your entire network setup as well as FreeNAS version.
 

Joe55

Dabbler
Joined
Sep 27, 2017
Messages
10
Whatever is issuing your DHCP addresses (obviously not FreeNAS) isn't giving FreeNAS an IP address. Whatever that is (router or server) is likely part of the problem. It would be easier to provide guidance if you detailed your entire network setup as well as FreeNAS version.

Latest stable version of freenas -> switch -> router.

Resetting the router itself does not help, which also flushes out it's dhcp tables. This issue does not occur on any other Linux/Windows OS on this computer and it's only happening with freenas.

Luckily, I can confirm regular reboot does not cause this issue (If it's already happening though, it persists). It's only during a power outage or hard power down. It's irritating, but just means I should get a UPS.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
-- Moderator Note --

The forum rules, conveniently linked at the top of every page in red, require that users need to post relevant information about their systems, including a hardware manifest and other configuration information, which is crucial information to other posters who are trying to provide assistance.

I'm asking the OP to please post some detailed information about their FreeNAS system and network.

I'm also going to note that using DHCP for infrastructure devices such as NAS is not a recommended course of action, as it can lead to all sorts of problems, such as what happens if you have active mounts and your DHCP server crashes or allocates a different IP address to the NAS.

-- Please consider this thread temporarily closed pending further details from the OP --
 

logapon

Cadet
Joined
Feb 15, 2023
Messages
1
I just had the same thing happen on my TrueNAS-SCALE-22.12.0, and I've figured out somewhat of a fix.
  1. Plug a monitor in and select option 7 to use the linux shell
  2. Use "sudo dhclient" to get the networking going
  3. Access web interface at the server's IP address
  4. Go to Networking tab
  5. Select your interface, and add desired IP address under "aliases"
  6. Give the system a reboot
It's not pretty, but doing this seems to have fixed most of my problems. Hopefully it'll help someone else out there.
 
Top