Two networks on one TN?

Joined
Apr 26, 2015
Messages
320
I have a 10.0.0.x IP on the main interface of this system but I also need servers from 10.1.1..x network to have access.
How can I safely do this since the server is in production so I cannot afford to make a mistake and taking down the shares.
 

c77dk

Patron
Joined
Nov 27, 2019
Messages
468
If you have an unused interface on the server you can hook this up to the new network, but otherwise just route the traffic to your current interface
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Is the second network connected to the same "wire" or reachable via a router? What are the netmasks/prefix lengths of those networks?
 
Joined
Apr 26, 2015
Messages
320
All of the networks are on the same switch but have different gateways. They don't need to talk together but when/if they do, that is done via firewall.

So in this case, if I can add a new network on a free interface, I can give machines in the 10.1.1.1 range access to a share on the TN host.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Do you mean you run the two networks on an unmanaged switch without separate VLANs?
 
Joined
Apr 26, 2015
Messages
320
Hi,

No VLANs, just multiple networks on the same switch.
For example, some hosts are in the 10.0.0.x network and have their gw set to 10.0.0.1. Other hosts are on a 10.1.1.x network and have their gw set to 10.1.1.1.

There was a power limitation, not enough power to add all the gear we needed but this works fine.
Problem is that hosts on 10.1.1.x need their own share for backups.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I don't understand what power has to do with network addressing and topology, but anyway ...

1. You can have as many shares on a single IP address as you like.
2. You can add a static route to your TrueNAS for the other network to reach the devices there.
3. If you must add an IP address in the second network to your TrueNAS you can add it to the same interface saving a cable and a switch port.
4. If you have a free switchport, cable, and interface just configure the IP address on that interface.

Changing the network configuration will interrupt network connectivity for a second or two so better pick a maintenance window outside office hours.
 
Joined
Apr 26, 2015
Messages
320
You said
>Do you mean you run the two networks on an unmanaged switch without separate VLANs?

I didn't mention unmanaged but yes, without separate VLANs.
I explained why power had to do with it, just FYI, limited hardware.

Based on your input, doing something like this would be fine then. The hardware is remote to me so I just have to figure out why it's in an unknown state but then this should work right?

2022-04-27_123729.jpg
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I understand that you cannot add network gear due to power constraints. But why run two separate networks at all if everything is connected to the same broadcast domain, anyway?

Not that you cannot have two interfaces use DHCP. And using static configuration is very much recommended.
I suggest you first go to Network > Global Configuration and statically configure the default gateway and DNS configuration for the network you already have. Then you can change the configuration for bxe0 to a static address.

Once that works you can either add the second address and network to bxe0 or to some other interface if you prefer.
 
Joined
Apr 26, 2015
Messages
320
As with the power, you're probably not interested in why the setup is how it is :).
There are actually more networks but they don't conflict. The different devices just use their own gateway.
It's an unusual setup I guess but it evolved that way because of various circumstances.

Anyhow, yes, I see why you mention DHCP. I completely forgot about that and didn't even notice it in the image I shared.
This server was configured at another location then dropped off to its new location with DHCP enabled.
The IP is static in that the DHCP server knows about the MAC so assigns the same IP all the time.

So my question is... if I change the config as you mentioned, what's the best way of doing it so there is barely any down time?
I think the clients don't have any configuration to try and re-connect to the NFS server if it goes missing. I'm not sure how long that would take however.
 
Joined
Apr 26, 2015
Messages
320
Anyone?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
First set your default gateway and DNS server, then change your IP address to static, then add your second IP address.
What precisely do you expect? There is no other method but using the UI one step at a time.

The interfaces will toggle (down-up) for a second, but NFS in general is stateless and clients will reconnect or not even notice.
 
Joined
Apr 26, 2015
Messages
320
>What precisely do you expect? There is no other method but using the UI one step at a time.

This is a strange question. I don't 'expect' anything nor did I question your suggestion.
I'm simply looking to accomplish what I need to without causing any down time since it's a production environment.

I'm just looking for some insight from those that know truenas better than I do, especially since I've read plenty of posts saying that with bsd, it's better to do this kind of thing from the command line.

If I knew the answers, I would not be asking, I would be helping others instead :).

I'll give this a try but you didn't tell me if this would disrupt traffic since I would have to plan this or find a way for clients to automatically re-connect if they lose the connection.
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Yes, but I already told you the steps in a previous post. And now I told you again. Interfaces will go down and up again. Clients will "reconnect". Quotation marks because there is no concept of a connection in NFS. NFS was designed in a way that you can reboot the server without the client even noticing. As long as the client does not actively read or write during the reboot. And you wrote you were using NFS - or did I get that wrong?

If you use anything else, anything can happen and what precisely depends on the client and the protocol used.
 
Joined
Apr 26, 2015
Messages
320
You told me interfaces would go down when I added an IP which I already did but it seems in the wrong way.
Then you told me about adding a gw which I'll do and that's what I'm asking about since I'm not changing the config this time, just making it static so don't know for sure if this also causes a hiccup in the client connections.

I simply like to have some idea what to expect when doing things like this so I don't end up in a bigger mess. Better to ask for clarity than coming back and saying everything broke, help! :).
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Every time you click on the Test/Save combo all interfaces will be reconfigured and hence toggle. As far as I know. For example all jails will lose connectivity which corroborates my statement. The problem with the jails is a bug supposed to be fixed in 13 release. But an interface toggle will not destroy an NFS mount. It can affect an ongoing operation, but that depends on whether the mount is "hard", "soft", or "intr" on the client side. A hard mount will simply stall the client until the server comes back.
 
Joined
Apr 26, 2015
Messages
320
That's what I was wondering about to be safe. Just wanted to better understand what I was going to do and know what to expect.

Thank you for the clarification.
 
Joined
Apr 26, 2015
Messages
320
I did as you suggested.
I added a static route, 10.0.0.0.24 and 10.0.0.1 gw.
When I saved it, everything went dark, I lost access to the GUI and all of the clients lost nfs access.

Now I'm on the remote console, removing the static and having to reboot to see what happens.
If that comes back, then I'll have to check the clients since they might need a reboot if they weren't able to reconnect.

I'll update when done but this is what I was trying to avoid by asking plenty of questions before doing anything.

Update: Clients were able to re-connect.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I told you to set the default gateway, not to add a static route for a /24.

To move from DHCP to static configuration:

1. In Network > General Configuration set default gateway and DNS server statically and save.
2. In Network > Interfaces > <your interface> remove DHCP and set the IP address.
 
Joined
Apr 26, 2015
Messages
320
Did you notice at all how many times you've said 'I told you'? You even corroborated your own statement, for whom, your own benefit?

I've told you I asked for help because I wasn't sure what I was doing.
I then asked for clarity because I'm not 100% of what I'm doing and didn't want to take anything down. I've told YOU that.

Why help people if all you want to do is point out how amazing you are when you know they aren't yet.
All you are doing is making those who are still learning feel small and unsure about what they are doing.
I really really wish people like you didn't exist in forums. You are much more frustration than help.
I don't make people feel crappy when I help them. I help them because I want to help people learn, not to make myself feel mighty.

Please don't bother helping me again Mr know it all sage of the TrueNas forums.
 
Top