Sign in with
Sign up | Sign in
Your question
Solved

Dual Nics for accessing network, and dedicated NAS

Last response: in Networking
Share
November 24, 2011 7:11:40 AM

Here's my situation, I'm trying to setup a server with two nics, one of which is connected to the network, and the other connected to a NAS via crossover. I've never done anything with subnetting, but I was thinking I could just set the main nic to 192.168.10.20 with a subnet of 255.255.255.0 and the other to
192.168.10.250 with a subnet of 255.255.255.240 and the nas nic set to
192.168.10.251

Am I thinking through this right, or is there a better way to do this?

Thanks for any input!

Mick

Best solution

November 25, 2011 12:43:06 AM

Hi Mick,

You are correct in that with this type of configuration you will want each NIC on a separate subnet. Doing this will prevent you from having unexpected routing problems out of your server. However, your proposed configuration doesn’t actually achieve this. Technically both of those addresses are in the subnet you defined for your primary NIC which will almost defiantly cause problems.

Without going too far into subnetting (there are entire books on it if you are interested) a netmask mask of 255.255.255.0 defines a subnet with 254 hosts. Every IP from 192.168.10.1 to 192.168.10.254 would be on that subnet. Technically, even 192.168.10.0 and 192.168.10.255 are on the subnet, but they are reserved for the network ID and Broadcast respectively. Because of this, using 192.168.10.250 on the other NIC could confuse the internal routing of the server. If a packet was generated for 192.168.1.251, a possible address for your NAS, the server would not know if it should send it out NIC1 or NIC2 since that address is on both subnets. This could result in unexpected behavior.

To fix this, you can set up the primary NIC as you described (192.168.10.20 255.255.255.0) but you should set your NAS NIC to something like 192.168.20.250. You could even use the same subnet mask of 255.255.255.0 since we changed the value of the third octet of the address. You would then give the NAS any other 182.168.20.X address you like.

If you really want to get fancy with the subnetting, you would use a netmask of 255.255.255.252 which allows only two hosts. Since you are using a crossover cable there can only be two hosts. This could look something like:

Server NIC2: 192.168.20.250 255.255.255.252
NAS: 192.168.20.249 255.255.255.252

When using a 255.255.255.252 mask like this you need to be sure that you use the correct two addresses. For example, 192.168.20.250 and 192.168.20.251 would not work with a 255.255.255.252 subnet mask because the .251 address is reserved as the broadcast address for that subnet.

I hope you find this helpful. Best of luck with your project.

Andrew
Share
November 25, 2011 4:22:44 AM

Great info! Thanks!
m
0
l
Related resources
November 28, 2011 8:54:51 PM

So I applied this setup, and found that when I have the 'backup network' enabled I loose internet access on nat system, I assume because it's trying to use its default gateway, which isn't connected to the internet. It also prevented incoming email, I imagine for the same reasons.

Any thoughts? Thanks again!
m
0
l
November 28, 2011 9:06:13 PM

Make sure you have the default gateway for the internet side set correctly. On the non-internet side, don't set a default gateway. Just leave it blank. This will force all unknown iPs to go out the internet link.
m
0
l
November 28, 2011 11:15:04 PM

I think that got it (and makes sense too!). Thanks!
m
0
l
December 1, 2011 11:33:23 PM

Best answer selected by 229Mick.
m
0
l
!