Static IP - Hard code in TrueNAS or Statically assign via DHCP

Just wondering what is best!

Is it better to hard code IP address in TrueNAS or to assign the static address via DHCP. If hard coded, then should I also assign my local domain name as well?

Or does it not make a difference either way!

Thanks.

GChuck

Either works.
The difference would be if you ever move your NAS, or reconfigure your network: Reconfigure on the NAS or with the new DHCP server.

If using static ip
You would want to supply DNS server ip address too

I personally prefer static for things like Truenas. I have had times when the dhcp server was down and the device I was trying to get to did not have an address.

2 Likes

DHCP Reservation for me: my router being attached to an UPS helps. Had to fix a few times broken jail IPs but that was due to system changes.

However this is due to a few things, mainly my knowledge about networking being very limited and the ISP hardware I have at home.

For someone that knows what he’s doing, or for the dudes who want to commit and learn new skills, I would suggest the opposite.

I don’t like when devices don’t use DHCP. For example if I misconfigure something in VLAN, I want to see that them getting an IP in the wrong range. But that is just a personal taste.

What I don’t like about the networking in TrueNAS CORE (maybe this is different for SCALE) is that all VLAN interfaces use the same MAC (that can lead to strange issues with OPNsense and I can’t assign multiple static DHCP leases with the same MAC, even if not in the same VLAN) and that you can only use DHCP on one interface. I don’t see any reason for this behavior, maybe some strange FreeBSD limitation?

1 Like

I’m using BIND & ISC-DHCPD on a local linux server at home (will switch to KEA sometime) - My firewall dhcp server could not satisfy my requirements, especially wrt. dynamic dns updates.

IMHO a requirement for using DHCP, for “servers” is to:
MAC-lock the ip address to a “DHCP fixed IP”.
Will also make your firewall rules easier.

I think there are Pro’s & Con’s for using DHCP for “static” servers.

Pro’s:
1:
When moving from one subnet (vlan) to another.
You can predefine the new mac-locked ip in advance, and everything will be in place when moved.
We have often utilized that when working on remote systems, that didn’t have IPMI.

2:
You don’t have to fiddle with any IP settings in the GUI or resolv.conf.

Con’s
1:
DHCP was not made with redundancy in mind.
Meaning if your DHCP server goes down, you cant (easily) switch-in an up to date backup server,.
Well you can do some “pool splitting” in ISC-DHCPD, but then static reservations becomes a challenge.

I think that M$ DHCP can do something, but I use “Free FOSS” stuff.

2:
Remember to set your lease times long (I use 7 days)
Longer than ANY expected outage time on your DHCP server.
Ask me how i know

TIP:
1:
Don’t use DHCP on the PC you use to maintain the DHCP servers with.

2:
I have a disabled DHCP server configured on another linux server (small RasPi).
Just waiting to be activated if/when my primary server does down.
I have to remember to sync the dhcpd.conf from my primary server to the backup server … Once in a while (primarily for sync’ of reservations).

3:
Remember to hand out your preferred NTP server via DHCP too.

…
…

I’ll switch my TrueNAS’es to static, once i have my new Vlans in place.
TrueNAS Data Vlan & Protected IPMI (mgmt) Vlan.

2 Likes

Thanks to all who offered an opinion on this topic.

I run my own internal DNS server and DHCP server (not my router) and I’ve always hard coded the IP address of TrueNAS in TrueNAS. But at the same time, I’ve always created a static reservation for the TrueNAS server in my DHCP server and added DNS records to my DNS server. This has mostly worked well.

The reason I posed this question in the first place, was that recently when trying to open SMB shares on my TrueNAS from any of my Windows boxes, File Explorer could not find the share immediately! But after trying to connect to the share a number of times, it would finally connect. It looked like the share just could not be found via the share name. The TrueNAS server could be found, both by address and name. This mostly affected my nightly backup not completing successfully on occasion.

I fiddled with DNS and DHCP settings for a while with no change, but then, magically, everything started working again properly.

Again, thanks to all who offered suggestions.

GChuck