Setting Up Static IP (Peer-to-Peer Connection)

__adrian

Cadet
Joined
Sep 2, 2022
Messages
5
TrueNas Scale 22.02.3

I'm trying to set up a static IP on a second nic. I can configure the interface, but when I click [Test Changes] it spins for 60 sec, then nothing happens. If I refresh the page, the IP and config changes I made are just gone.

What's it testing? How can I find out what the problem was?
 

__adrian

Cadet
Joined
Sep 2, 2022
Messages
5
Some things I'm reading imply you need to set the default gateway manually for a static IP assignment to work - I have done this, but the static IP I'm trying to set is on a different subnet (it's for a peer-to-peer connection). Could this be the problem? Is there a way around it?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Some things I'm reading imply you need to set the default gateway manually for a static IP assignment to work - I have done this, but the static IP I'm trying to set is on a different subnet (it's for a peer-to-peer connection). Could this be the problem? Is there a way around it?

In general, the use of DHCP for infrastructure devices like NAS units is a bad idea. Once you get beyond the simplest networking configuration, DHCP becomes somewhat unwieldy -- what happens if two servers respond with a default route? Or DNS servers? Or NTP servers? Which should be used, and when?

A peer-to-peer connection for a NAS client has no need for a default route. In theory, you just set one side to (e.g.) 10.12.34.5/24 and the other to 10.12.34.6/24 where the network 10.12.34.0/24 is unallocated and unused in the local networking environment. It is easiest to do this if the primary interface has a static IP and a static default gateway as well. While this can often be done via the webUI, getting the order of operations correct is a bit tricky if you're not intimately familiar with networking, because you are doing "brain surgery on self" when you set up the IP interface and default (switching from DHCP to static). So it may be easier to do from the console. Once the primary interface and default are configured from the console, it should be trivial to set up the peer-to-peer link via webUI.
 

__adrian

Cadet
Joined
Sep 2, 2022
Messages
5
to be sure I'm following, you're suggesting I disable dchp on every interface, and assign the appropriate static IPs, starting with the primary?
does setting the primary IP need to be done first (separately)?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
You can only have DHCP on a single interface. Having it on multiple interfaces ends up with incorrect and nondeterministic behaviour. The use of DHCP on infrastructure devices like routers or NAS leads to a variety of problems in the long run, so, yes, I suggest a static configuration after you have managed to get the system bootstrapped (something DHCP is very good at).
 

__adrian

Cadet
Joined
Sep 2, 2022
Messages
5
k, that's what the intent is.
the primary interface is on dhcp, and the second (the one i'm setting up) is not. there are other interfaces, but are as yet unused (nothing plugged in, status is down).
 
Top