Where are the network files located?

Ken_B

Cadet
Joined
Apr 7, 2023
Messages
7
Hi Folks,

I've just installed TrueNAS on a 45Drives box and while I can ping out of the box, the web GUI refuses to start. The port parring (option 2 on the command line interface), works, but the Configure Network interface (option 1) only resets the configuration and does not give me the option to set the IP statically. Therefore, is there a file(s) inside TrueNAS CORE where I can set the following parameters?

  • hostname
  • static IP
  • gateway
  • netmask
  • to specify to load the lagg0 interface (though I think this is working already since I can ping)
Restarting nginx and middlewared had no effect. Rebooting has no effect. Reloading the ISO has no effect (once I get the port paring entered).
Thank you in advance.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
No, there is no simple text file for network config. All TrueNAS config is stored in SQL tables in /data/freenas-v1.db, and can only be altered via the UI or midclt API calls.
 

Ken_B

Cadet
Joined
Apr 7, 2023
Messages
7
Is there a document that outlines the applicable midclt API calls?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
the Configure Network interface (option 1) only resets the configuration and does not give me the option to set the IP statically.
Yes, it does:
1680903726654.png


Default gateway is set using option 4, DNS is set using option 6. Link aggregation is configured by first creating an aggregated interface (option 2), then configuring it (option 1).
 

Ken_B

Cadet
Joined
Apr 7, 2023
Messages
7
Option 1 just resets, then goes back to the main menu for me. I wish I could get the rest of the dialog like you show.
 

Ken_B

Cadet
Joined
Apr 7, 2023
Messages
7
Spoke too soon. GUI now reports up, but network is down (possibly because I used LACP bonding). I'm going to see if removing the bonding has any effect.
 

Ken_B

Cadet
Joined
Apr 7, 2023
Messages
7
OK, finally found the problem; and boy it's a big one.

Via the console only, you can only configure the TrueNAS to work within the VLAN is is a part of!!! Outside the VLAN, you can't even ping the box.

In order to complete the configuration, you have to have a server that has a browser on it, and is part of the same VLAN as your TrueNAS. Only then can you get to the GUI to completely fix what is rendering your installation unusable. Under the "Network>Global Configuration" screen, you will note that 1. NetBIOS-NS is defaulted to OFF; and 2. IPv4 Default Gateway is not set. Once you can fix these settings, everything will work. (These settings assume that you use NetBIOS, and that you do not use IPv6, otherwise you will have to adapt your fix.)
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
ConsoleSetupMenu.png


Default gateway can be set from the console menu, option 4.
 

NickF

Guru
Joined
Jun 12, 2014
Messages
763
OK, finally found the problem; and boy it's a big one.

Via the console only, you can only configure the TrueNAS to work within the VLAN is is a part of!!! Outside the VLAN, you can't even ping the box.

In order to complete the configuration, you have to have a server that has a browser on it, and is part of the same VLAN as your TrueNAS. Only then can you get to the GUI to completely fix what is rendering your installation unusable. Under the "Network>Global Configuration" screen, you will note that 1. NetBIOS-NS is defaulted to OFF; and 2. IPv4 Default Gateway is not set. Once you can fix these settings, everything will work. (These settings assume that you use NetBIOS, and that you do not use IPv6, otherwise you will have to adapt your fix.)
That's not entirely true. By default, any system, TrueNAS or otherwise will only work in the "native" or "untagged" VLAN on the interface it's plugged into. If you are plugged into a Trunk, or a port with "Tagged" VLANs, you can select option 3 in the menu you posted and define a child interface which communicates with a specific VLAN by applying the specific Q-Tag.
 

Ken_B

Cadet
Joined
Apr 7, 2023
Messages
7
When I set up a system, and I set up a gateway, I only need to set it in one place, usually a network config file. This is not rocket science. In TrueNAS, I have to set it in two, not very clear from the console, places. This is not some weird, off-the-wall interface. I presume this is to make the interface more configurable for those off-the-wall cases, but that is not clear from the console interface, especially in light of the fields being labeled differently between the GUI and the Console.

This quote pretty well sums up the facts ...

“If words of command are not clear and distinct, if orders are not thoroughly understood, then the general is to blame. But, if orders are clear and the soldiers nevertheless disobey, then it is the fault of their officers.” - Sun Tzu
 

NickF

Guru
Joined
Jun 12, 2014
Messages
763
When I set up a system, and I set up a gateway, I only need to set it in one place, usually a network config file. This is not rocket science. In TrueNAS, I have to set it in two, not very clear from the console, places. This is not some weird, off-the-wall interface. I presume this is to make the interface more configurable for those off-the-wall cases, but that is not clear from the console interface, especially in light of the fields being labeled differently between the GUI and the Console.

This quote pretty well sums up the facts ...

“If words of command are not clear and distinct, if orders are not thoroughly understood, then the general is to blame. But, if orders are clear and the soldiers nevertheless disobey, then it is the fault of their officers.” - Sun Tzu
There is, and can only ever be, one default gateway in any system. If you did it in more than one place you created a static route, which is not entirely the same thing.
Do you want help setting up VLANs?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
I only need to set it in one place, usually a network config file. This is not rocket science.

Both the UI's Network->Global Configuration and the console menu option 4 set the gateway in the same place: The network_globalconfiguration table's ipv4gateway key in the TrueNAS configuration database /data/freenas-v1.db.

You must remember one of the design goals of TrueNAS was to create an appliance, so end users would have as little scope as possible for trashing the system. All critical configuration items are stored in the configuration database, which the middleware reads to generate ephemeral config files on boot. Even if a user ends up corrupting a config file, a reboot will recreate a known good config with the user's changes gone as if they had never happened.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
And if you set the gateway statically first, before changing the interface configuration, that setting will of course persist. VLANs can be perfectly set up via UI only. Just to global settings first, test and save, then do interfaces.
 
Top