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
Am I thinking through this right, or is there a better way to do this?
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.
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.
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.