Subnet mask question

sswingle

Diamond Member
Mar 2, 2000
7,183
45
91
I was adding computers to a network today, and saw an unusual looking subnet mask setup.

The server, IP 192.168.10.2 had the subnet mask of 255.255.255.140
The gateway IP is 192.168.10.1

What does the 140 mean? The network is set up as static IP, but no one has a list of IP's in use, so I was thinking about using 192.168.10.253 and 192.168.10.252 to be safe from conflicts.

I read a few things about subnet mask, and I don't really understand, so if someone could explain what will happen in this situation, that would be greatly appreciated.
 

nightowl

Golden Member
Oct 12, 2000
1,935
0
0
Are you sure that mask is correct? The mask that you listed only allows for 2 hosts per network. Essentially the mask that you have is the same as a 255.255.255.252 or /30 mask. So, in your case you have the gateway address and the server and that is it.
 

Xtremist

Golden Member
Dec 2, 1999
1,342
0
0
Subnetting is something that a lot of people (including myself) get confused about real easily. Having said that, a .140 subnet mask isn't really valid. In binary 140 would be 10001100. The subnet mask essentially tells the IP stack how many bits are reserved for the network and host portion. This allows you to create sub-networks inside a class of addresses. However splitting the mask in non-consecutive bits makes subnetting very... awkward. I don't think most IP stacks would even allow it or know what to do in that case.

Sorry this doesn't help. Just know that that's not really a valid Subnet address at all :)

 

sswingle

Diamond Member
Mar 2, 2000
7,183
45
91
I'm almost positive thats how it was set up. I'll check again tomorrow. The clients were still able to connect to the server for file/print sharing, however I was unable to ping anything...

I assume if it is set up as 255.255.255.140, that making it 255.255.255.0 would be much much better?

What is odd is that no one in that office is computer literate, no one touches the server, and yet all its settings changed since the last time I was in there. Although they did just get cable internet service.... maybe the stupid installer did it.
 

Xtremist

Golden Member
Dec 2, 1999
1,342
0
0
Makes a huge difference. The binary of 240 is: 11110000

Which means 4 bits for network, 4 for hosts. If your subnet is the 192.168.10.1 subnet, your valid IP valid IP range would be 192.168.10.1-192.168.10.15 Of course 1 and 15 are reserved. So 253 and 254 wouldn't work in your situation.
 

sswingle

Diamond Member
Mar 2, 2000
7,183
45
91
Ok, another question. Lets say clients are set up with the 255.255.255.240 mask, and I change the server to 255.255.255.0, and I then set my other two clients to 255.255.255.0.

I then make the second pair of clients a higher IP number like I mentioned before.

Am I correct in thinking that all the clients could then talk to the server, but the clients with the 240 mask can't see the clients with higher IP range?
 

nightowl

Golden Member
Oct 12, 2000
1,935
0
0
If you change the subnet mask to 255.255.255.0 then you can use the entire address range of 1-254 for hosts. Now, your gateway is on 192.168.10.1 so you cannot use that address but you have 2-254 to use for other hosts. You also need to change the subnet mask on the gateway too or you will not be able to access the Internet with any of the hosts outside the 1-15 range.
 

Xtremist

Golden Member
Dec 2, 1999
1,342
0
0
Originally posted by: nightowl
If you change the subnet mask to 255.255.255.0 then you can use the entire address range of 1-254 for hosts. Now, your gateway is on 192.168.10.1 so you cannot use that address but you have 2-254 to use for other hosts. You also need to change the subnet mask on the gateway too or you will not be able to access the Internet with any of the hosts outside the 1-15 range.

With a 240 subnet that's probably not too bad, but he didn't seem to know all of the computers on that network. I'd change it too personally especially since/if they're non-routed IP's anyway, but it's something he needs to be aware of. Changing the mask will work, but ONLY if you do it on all of the systems... An easier way that could be less error prone would be to choose an entirely new network, say the 192.168.11.1 with a mask of 255.255.255.0. That way you can move each system you're aware of over to the new network without having conflicting masks, and still preserve connectivity for any hosts you are unaware of.

Assuming you have the infrastructure and time to do it. Otherwise just change the mask ;)