Setting Up Static IPs
5 minute read.Last Modified 2023-02-03 13:24 EST
This article provides instructions on setting up a network interface with a static IP address or changing the main interface from a DHCP-assigned to a manually-entered static IP address. You must know the DNS name server and default gateway addresses for your IP address.
You can lose your TrueNAS connection if you change the network interface that the web interface uses!
You might need command line knowledge or physical access to the TrueNAS system to fix misconfigured network settings.
When do you configure a static IP address? Static IP addresses are use to set a fixed address for an interface that external devices or websites need to access or remember, such as for VPN access.
Use aliases to add multiple internal IP address, representing containers or applications hosted in a VM, to an existing network interface without having to define a separate network interface.
In the UI, you can add aliases when you add an interface or edit an existing interface. Use the Add button in the Static IP Address widget to add a static IP address.
From the Console setup menu, select option 2 to configure network settings and add alias IP addresses, or option 3 to add a static IP address.
Have the DNS name server addresses and the default gateway for the new IP address, and any static IP address on hand to prevent lost communication with the server. You have only 60 seconds to change and test these network settings before they revert back to the current settings, for example back to DHCP assigned if moving from DHCP to a static IP.
Back up your system to preserve your data and system settings.
As a precaution, grab a screenshot of your current settings in the Global Configuration widget.
If your network changes result in lost communication with the network and you need to return to the DHCP configuration, you can refer to this information to restore communication with your server. Lost communication could require you to reconfigure your network settings using the Console setup menu.
To view a demonstration of this procedure see the tutorial video in the Managing Global Configuration article.
To change an interface from using DHCP to a static IP address:
Click on the interface on the Interfaces widget to open the Edit Interface configuration screen, turn off DHCP and add the new static IP. Click Apply.
If you have only one active network interface the system protects your connection to the interface by displaying the Test Changes dialog. You have 60 seconds to test and save the change before the system discards the change and reverts back to the DHCP-configured IP address.
a. Clear the checkmark from the DHCP checkbox.
b. Click Add in the IP Addresses section of the form and then enter the new static IP address into the field displayed. Select the CIDR number from the dropdown list.
![EditInterfaceAddStaticIP](/images/SCALE/22.02/EditInterfaceAddStaticIP.png "Add IP Addresses")
c. Click Apply. The Network screen displays with a new widget where you can select to either Test Changes or Revert Changes.
![NetworkTestChangesWidget](/images/SCALE/22.02/NetworkTestChangesWidget.png "Test Change Widget")
For home users, use 18.104.22.168 for a DNS name sever address so you can communicate with external networks.
a. Add the IP addresses for the DNS name servers in the Nameserver 1, Nameserver2, and Nameserver3 fields.
![EditGlobalConfiguration](/images/SCALE/22.02/EditGlobalConfiguration.png "Add Nameserver and Default Gateway")
b. Add the IP address for the default gateway in the appropriate field. If the static network is IPv4 enter the gateway in IPv4 Default Gateway, if the static network is IPv6 use IPv6 Default Gateway.
c. Click Save.
The system attempts to connect to the new static IP address. If successful the Save Changes widget displays.
Click Save Changes to make the change to the static IP address permanent or click Revert Changes to discard changes and return to previous settings. The Save Changes confirmation dialog displays. Click SAVE. The system displays a final confirmation that the change is in effect.
Only one interface can use DHCP to assign the IP address and that is likely the primary network interface. If you do not have a existing network interface set to use DHCP you can use it to convert from static IP to DHCP.
To return to using DHCP:
Click Settings on the Global Configuration widget.
Clear the name server fields and the default gateway, and then click Save.
Click on the interface to display the Edit Interface screen.
Remove the static IP address from the IP Address field.
Click Settings to display the Global Configuration configuration form and enter name server and default gateway addresses for the new DHCP-provided IP address. Home user can enter 22.214.171.124 in the Nameserver 1 field.
Click Test Change. If the network settings are correct, the screen displays the Save Changes widget. Click Save Changes.
If the test network operation fails or the system times out, your system returns to the network settings before you attempted the change. Verify the name server and default gateway information to try again.
- Network Interface Screens
- Managing Interfaces
- Setting Up a Network Bridge
- Setting Up a Link Aggregation
- Setting Up a Network VLAN
- Configuring Static Routes