Second NIC: the change from dhcp to static ip doesn't work

GabrieleMax

Dabbler
Joined
Mar 25, 2023
Messages
15
Hi guys,

I tried by Chrome, Firefox, Edge, Opera, etc. to change the ip address of my second nic from dhcp to static like this https://ibb.co/qWT3r27 but when I press the save button it doesn't work!

I can wait hours but the above page doesn't work and it can't change my network settings, could I change them from command line? Where is the interfaces file?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I can't see anything useful on that screen shot, perhaps because it's far too small. Please just attach images to your posts (or better yet, paste them in) rather than using external image-hosting sites.

But with that said, of course you can configure the network using the CLI--just use the menu.
 

GabrieleMax

Dabbler
Joined
Mar 25, 2023
Messages
15
I can't see anything useful on that screen shot, perhaps because it's far too small. Please just attach images to your posts (or better yet, paste them in) rather than using external image-hosting sites.

But with that said, of course you can configure the network using the CLI--just use the menu.
Thanks for your reply, if you click on the image it'll be 100% but it shows just the configuration page because nothing happen when I click on the save button! :)

Do you know where is the config file? Usually in Debian is on /etc/network/interfaces
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Do you know where is the config file?
No, and it wouldn't matter anyway--messing with the config files is guaranteed to cause problems with the system. Any changes should be done through the TrueNAS API, or through the web UI or CLI menu (both of which use the API on the backend).

The problem you're having is that you're trying to set a second interface to have a second IP on the same subnet as the first. That isn't a valid configuration. See:
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Do you know where is the config file? Usually in Debian is on /etc/network/interfaces
It's in the freeNAS config DB in a table called network_interfaces... but don't mess with it directly and pay attention to the linked resource above.
 

GabrieleMax

Dabbler
Joined
Mar 25, 2023
Messages
15
No, and it wouldn't matter anyway--messing with the config files is guaranteed to cause problems with the system. Any changes should be done through the TrueNAS API, or through the web UI or CLI menu (both of which use the API on the backend).

The problem you're having is that you're trying to set a second interface to have a second IP on the same subnet as the first. That isn't a valid configuration. See:
Thanks for your reply, I need the bonding with two nic to configure them on my Ubiquiti switch this is the reason why I'd like to have two different ip on the same subnet, on Debian I can do it and also on TrueNAS Core... :\
 

GabrieleMax

Dabbler
Joined
Mar 25, 2023
Messages
15
It's in the freeNAS config DB in a table called network_interfaces... but don't mess with it directly and pay attention to the linked resource above.
Thanks for your reply, I thought it was more easy to do it just to edit a file... :\ but... why on Debian can I have two different nic with two different ip on the same subnet and also I can do the same on TrueNAS Core?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I need the bonding with two nic
Then configuring the second NIC with a different IP isn't the way to do it. Delete the first NIC's configuration, create a new interface of type LINK_AGGREGATION, name bond0, member interfaces as your two NICs, then configure that interface with the IP/subnet/etc.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think more interesting to understand is 'what you are trying to do with the different NICs on the same subnet?'

If you're trying to "secure" your services or apps in some way, you're just fooling yourself if you think doing it that way will help.

You're much better to just add an IP address alias to the existing NIC and use that IP address if you just want to use services on a different IP for some reason.

You can, of course, force that to happen on a number of different OSes, including TrueNAS, but why would you want to do that when it makes no sense to do so?
 
Top