DHCP vs Static IP Address

Hello everyone can some please tell me what’s better to have for a Truenas server, a DHCP vs a Static IP Address

If I were to change from DHCP to a Static IP, would this mean I just need to add my IP address?

From what I have read I understand having a static IP would not allow the server connection to change is this correct? Thank you

Servers should pretty much always have static IP addresses. Whether that’s done by assigning one or more static IPs on the interface on the server itself, or by a DHCP reservation on your router, is mostly “whichever you prefer.” One exception is if you want to use a different IP for one or more apps, in which case you’ll need to have more than one static IP address configured on your server.

2 Likes

Thank you Dan for the fast reply, This is something I could have also done when setting up my Nas system correct?

I want to change it to my IP address I know I have to disable the DCHP first and them add my IP address I just don’t want to mess things up :slight_smile: I know what you’re thinking NAS chicken LOL

Yes, if I understand you correctly. It can’t be done during the initial installation, but once the system’s installed you can configure this using the console text menu or the GUI.

Thank you brother got it, I will look into it a bit more

While old school IT admins love to use static IPs, I think they are a PITA.
By assigning IPs with DHCP, I have one single place where I can configure everything. It is way simpler, makes migrations easier, you find devices simpler if you messed up something VLAN related and many more reasons.

BUT, I also think that TrueNAS (and Proxmox) handle networks in a very weird way.
I think they should allow for multiple DHCP interfaces. And I think that different interfaces with different VLANs should have different MAC addresses. Both is unfortunately not the case for TrueNAS.

…and then you proceed to agree with me. “Static IP addresses,” as I said in the very post you quote, includes those specified by DHCP reservation.

1 Like

I guess it depends on the user and how you like things setup. I like the idea of having a dedicated IP address that way I’m not sharing anything with others using that IP. I’m sure there are security risks as well when using DHCP. None the less thanks for sharing your opinion with us these things are good to know

Pros and cons. Practical to administer everything in one place. Pain in the a… when no server can come up because a problem with your dhcp infra.

3 Likes

Nicely noted :slight_smile: there are advantages and disadvantages of DHCP

Yeah, sorry, I misread.
“Static IP” means for most people, “hardcoded static IP on the interface” and not “DHCP with a static lease”

True, but you most likely have it running redundant or as a home user care more about your internet not working than a network share :slight_smile:

Agreed, this is how I have always interpreted it.
Calling a DHCP reservation “static IP” is ripe for creating a misunderstanding.

1 Like

If the very next sentence specifically lists a DHCP reservation as a way of assigning a static IP address, I’d argue it creates misunderstandings only for people who don’t read very carefully.

The point is that the IP doesn’t change, therefore it’s static. It makes no difference to me or to the other computers on your LAN how that’s accomplished.

2 Likes

:point_up:
This is the crux. Then, as already pointed by @rungekutta, there are two ways to achieve that, with different consequences when devices are moved to a new network (or the infrastructure is redone).

  • Harcoded IP means that settings have to be changed on each and every device with a static IP. Then, the network works “by itself” with switches and routers doing their thing automatically.
  • DHCP reservations means that there’s a single place to configure everything, but the DHCP server is a single point of failure for the whole network.

Sure, context matters. But I wasn’t replying with your usage in mind, just with commentary on what Sara said.

As others have pointed out, dynamic IPs do, sort of, change. The moment your DHCP-reliant server can’t get a lease it no longer gets that “static IP” assigned to it.

DHCP reservations are super convenient, I use them for many different things in my network, but for things I want to be on a specific IP no matter what, I find actual static IPs to be much more reliable.

If you do set a static address in the truenas UI, make sure it’s not inside the range of addresses your DHCP server manages.

1 Like

It is better to have a static ip.

… wait while flames die down…

Now, the reason,

Parts of the TrueNAS middleware allow you to bind functionality to a specific interface or IP.

These parts don’t work with DHCP Reservations, but require “IP Aliases”