Configuring a Static IP Address
So far we have relied upon the DHCP server built into the router to assign IP addresses to the NICs in the server. This is inconvenient for reasons already outlined.
So let us assign static IP addresses to these NICs. This will ensure that the FreeNAS web GUI IP address will no longer change. This is much more expedient when administering a server.
Make sure it is outside of the range of the DHCP server.
There are two ways to do this. You can do it via the FreeNAS web GUI. This is the preferred method in most cases.
The other way is via the console, either directly at the server with a keyboard and monitor, or using an IPMI remote console viewer. This can be useful if you're unable to reach the web GUI.
I have included both methods in the guide so you can see which works best for you.
Configuring Static IP Addresses Via The FreeNAS GUI
Click on “Network” in the left column, and then “Interfaces”.
Click the Add button in the upper right. The “Add Interface” window will pop up.
In this window select the NIC you wish to configure from the “NIC:” drop down selection box.
Give the NIC a name if you wish in the “Interface name:” text box.
Do not tick the “DHCP:” tick box.
Now assign the static IP address to the NIC in the “IPv4 Address:” text box (in Fester’s case this is 192.168.1.138).
Select from the “IPv4 Netmask:” drop down menu (7) the correct value for the subnet mask of your private network (Fester’s is 24, and this will be correct for most cases).
My ISP does not use IPv6 at present so there is nothing to configure for this.
Now scroll down to the bottom of this window and click the “Save” button.
If you attempt to configure a second NIC with an IP address on the same subnet as the first within the FreeNAS web GUI, you will get an error that looks like this:
This is because multiple interfaces on the same subnet is an invalid configuration. For an explanation of why this is the case, see this resource on the FreeNAS Forums.
Configuring Static IP Addresses Using The FreeNAS Console Setup
Start the IPMI remote console viewer, or connect a keyboard and monitor to your server. You should see a screen similar to this.
For “Enter an option from 1-14:” enter 1 and press the “Return/Enter” key.
- Input the number that corresponds to the NIC you wish to configure in “Select an interface (q to quit):” (1).
- Input n for “Delete Interface? (y/n):” (2).
- Input n for “Reset network configuration? (y/n):” (3).
- Input n for “Configure interface for DHCP? (y/n):” (4).
- Input y for “Configure IPv4? (y/n):” (5).
- Give the NIC a name if you wish at “Interface name:” (6). If you don’t want to give it a name then leave it empty and press the “Return/Enter” key.
- Type in the static IP address you require at “IPv4 Address:” (7).
- Now enter the subnet mask of the private network at “IPv4 Netmask:” (8).
- The console should confirm that the configuration has been saved with an “OK”.
- If you don’t need or use IPv6, then just type n at “Configure IPv6? (y/n):” (9).
That’s the static IP addresses assigned.