I know how to get to the Edit Interface area to add Aliases for a static ip address.
My questions.
What should the static IP address be set as? Some Dr Google and Youtube vids just use the same as the Interface - If the Interface is 192.168.1.1.164/24 then the static IP address is set as 192.168.1.1.164/24. Others, ignore the Interface IP address 192.168.1.1.164/24 and just say insert your ‘chosen’ IP address.
What is a ‘chosen’ IP address? Chosen from what or chosen how?
Usually your Homenetwork should have a dhcp server ( most likely your router) that gives out ip addresses to each device in your network as soon as it connects to it.
One of the most common default network routers use are 192.168.0.X (where X is a value between 2 and 254). If not set otherwise most dhcp leases are valid vor 14 days. After that, the ip a device recieves can change. In most routers there’s an option to set a static dhcp lease, meaning the device will always get the same ip address when the ip renews.
The other option is to set a device to a static ip, meaning setting the last number of the ip address to any value between 2 and 254.
If you want to use static ips, you should adjust the range for dhcp leases in your dhcp server so that ips don’t get assigned to multiple devices. So edit the dhcp ip range from 2-254 to maybe 100-254. That way ips from 2-100 can be assigned as static ips and ips from 101-254 will be available to be handed out as dchp leases.
So the “Chosen IP” literally means, any ip you want, as long as it’s in your dhcp servers subnet.
“Usually your Homenetwork should have a dhcp server ( most likely your router) that gives out ip addresses to each device in your network as soon as it connects to it.”
Yes. My modem/router has an ethernet IP address and a couple of different IP addresses for 2.4ghz and 5ghz wi fi connections. I would prefer not to fiddle with these. Hence my original question,
“If the Interface is 192.168.1.1.164/24 then the static IP address is [can be] set as 192.168.1.1.164/24”
Don’t set a static address inside your dhcp range otherwise you risk getting an IP conflict.
It’s good to reduce the size of your dhcp range in your router if possible; so you could set the static address outside of the range of addresses that your router can hand out.
You could, but you shouldn’t.
As already said you should adjust your dhcp range in your router and assign truenas (or any device you want on a static ip) outside the dhcp range. Otherwise it could lead to double assigned ip addresses and conflicts in your network.
There’s generally an option that lets you set a start and end for the dhcp range. In a /24 you’re just using the final octet and it’s probably sensible to start the dhcp range from 50 or 100 up to the top of the range, leaving you all the lower numbers to assign statically as you like.
Without knowing your router it’s hard to tell you exactly what to use, but assuming your router is 192.168.0.1, it’s probably safe to use something like 192.168.0.10 - as long as you keep track of what you’ve assigned and don’t put more than one device on the same IP then it really doesn’t matter what IP you assign (from a networking perspective)
Yes, I will need to see if I can actually set a dhcp range in my router. I fully understand that with so many routers around it’s hard to generalise but at least your guidelines can help me know where to even start.
I am still not clear why I should not use the Truenas value on the Interface as my static IP address. People say should not but why not? All I can think about with my very limited knowledge of IP addresses is that if the IP address in my router changes then this can throw offline my Truenas. I guess this is what Dynamic as opposed to Static means.
I have watched many videos supposedly from experts who repeatedly just use their IP address as stated on the Truenas Interface in the Aliases box. So if this is bad practice and shouldn’t be done I just wonder why so many step by step guides just have it all wrong.
As you can tell, I am very new to networking but I bet many people just give up with such confusing and I must say very limited useful basic advice.
Oh well. I’ll keep going for a bit with all this but if I can’t understand even such basic setup things then perhaps networking is not for me.
This is word salad–a collection of meaningful words that don’t convey any meaning at all when put together. I infer that you mean by it “the current dynamic IP address,” and if that’s what you mean, no, you shouldn’t assign that as your static IP address–at least, not unless you change the DHCP settings on your router to exclude that address.
@LarsR has given you solid answers and they’re absolutely correct. Having just rechecked for any further details about your network, I’ve also realised that what I’m suggesting below is exactly the same as LarsR suggested in the first response.
I’ll try to give you a slightly more detailed answer, but if you want to dig deeper you can look to something like Networking Basics: What is IPv4 Subnetting? - there are lot of networking resources available online if you’re interested. It’s not really necessary to understand any of that to continue your journey with Truenas, the essentials are:
do set a static address for your Truenas
do not risk an IP conflict by assigning an address inside your dhcp range (where your router can also assign the address you’ve used) - this is bad for your network
as long as your address is unique and valid on your network, you don’t really need to worry about this any more, the actual address doesn’t matter, it could be 192.168.1.5, 192.168.1.37 or 192.168.1.99 - it won’t make any difference as long as it’s unique and valid on your network
I’m guessing your router is 192.168.1.1, based on that I’ll take an educated guess at some appropriate settings, but you’d need to confirm what you can see in your router’s management interface and share screenshots of exactly what you see before you commit any changes if you’re in any doubt.
You could set your dhcp range to start at: 192.168.1.100 and end at 192.168.1.254; your router can assign addresses from this range when a device requests one, leaving you the addresses from 192.168.1.2 to 192.168.1.99 to assign manually as you like. If you already have any devices with a static address, you need to make sure you don’t assign them twice. Maybe keep a small spreadsheet of your IPs and what you’ve assgined them to.
A static address for your truenas (or any system) is useful in finding it later and can have an entry in DNS to make access easier from a URL - but I suspect we don’t need to confuse anything with DNS at this stage. Knowing for sure which IP your system is on is a good thing - set it and you’re not going to have to reconfigure anything later if your router hands out a different IP at a later time/day. You’re correct in thinking that the address lease changing would cause you problems, it won’t take your Truenas down, but you (and any other systems/drive mappings/services that use it) won’t know where to look on the network to access it - so technically it won’t be offline, but it will effectively be offline until you update where you look!
If the existing value has been handed out by dhcp and you assign it statically, your router might give that same address to another device - things on your network will break if that happens. An IP address can only be used once, assign the same address to two or more devices/interfaces on one network and you’re going to have trouble.
I imagine that choosing an IP address is assumed knowledge to prevent tutorials getting way too long. It can make starting any tech journey difficult at first, but stick with it and you’ll get there.
Your extended explanations and patience are greatly appreciated. My problem on the Forum has been as a total Network and Truenas beginner I don’t really know how to correctly frame my questions never mind responding to well-meant advice. I do my best and hope others can work their way through my waffle.
So, onward with renewed vigour. I will read carefully through your points and do some further research. My next step will be to get into my router and see what’s what regarding dhcp ‘range’ and see if/how I can manually assign an address in the router maybe even with a ‘Truenas’ title if that can be done.
All the dhcp range is, is the block of addresses that your router is configured to assign addresses for.
The 192.168.1.0 /24 address space is 256 addresses (254 of which can be used) - you can think of this as just a big list of IP addresses and every device on your network needs an address. The /24 part means that the first three octets are the same and your working in the last octet. A shortened list will be something like this:
192.168.1.0 - network address, you don’t use this
192.168.1.1 - your router - and in a home network will almost certainly be your default gateway and DNS
192.168.1.10 - you could use this for truenas
192.168.1.20 - you could assign this to another server/service/system
192.168.1.100 - DHCP range start - addresses from here are handled by your router
192.168.1.254 - DHCP range end
192.168.1.255 - broadcast address - dont worry about what this is - but you can’t use it, it just needs to be there
If you were using these settings - you should never manually assign an address inside that DCHP range (all addresses between 192.168.1.100 and 192.168.1.254)
That’s going a little beyond what you need to worry about if your goal is using truenas in a small network, but maybe that helps you understand the DHCP range concept?
What you can do with IP assignments will depend on the functionality of your router. It won’t really have any effect on the network and you can track your IPs in a two column spreadsheet, address on the left and usage on the right. Don’t bother trying to track your DHCP range, that will be subject to change, but track anything you’ve set yourself and remember you can’t use the network address (192.168.1.0) or the broadcast address (192.168.1.255)
Give your truenas the ip 192.168.0.250 in truenas and change the pool end to 192.168.0.150 and lease time to 7 days. And if there is a way to let leases expire, do so on all leases > 192.168.0.150
For static ip adresses you can either use dhcp, but then you will need the mac adress of the network card and the ip would then be in the dhcp range OR just assign it manually in the truenas cli - but make sure to select an ip outside of the dhcp range so it can’t conflict with ips assigned via dhcp. I am asuming the router itself uses 192.168.0.1, right ?
Yes, the shrinking of the DHCP range is in the router settings. Your screenshot shows a device with 192.168.0.225. (5GHz Telstr2DACE6) If you shrink the range,as above, that device would need to get a new address from router over DHCP. It would require a power cycle or something.