Subnetting

ndee

Lifer
Jul 18, 2000
12,680
1
0
OK, I SO don't understand subnetting, like 192.168.0.48/28. How do I make such a mask? Anyone got a dummy-tutorial for that kinda stuff?

Thanks.
 

Santa

Golden Member
Oct 11, 1999
1,168
0
0
To make a 28 bit subnetwork mask you basically have 4 groups of 8 (1) seperated by (.) dots.

11111111.11111111.11111111.11100000

This translates into 255.255.255.224 for the subnet mask.

Each bit represents a number based upon its location. In group of 8 places between the dots the placement is [128][64][32][16][8][4][2][1]
so since you have 11111111 you add up 128+64+32+16+8+4+2+1 to get your 255
and you the last octet is a 11100000 you add up 128+64+32 to get your 224.

This should answer your question about how to create the mask but you will want to look at the site to see what you can do with it in terms of creating a group of subnetworks with a certain number of host per subnetwork.
 

ndee

Lifer
Jul 18, 2000
12,680
1
0
Originally posted by: Santa
To make a 28 bit subnetwork mask you basically have 4 groups of 8 (1) seperated by (.) dots.

11111111.11111111.11111111.11100000

This translates into 255.255.255.224 for the subnet mask.

Each bit represents a number based upon its location. In group of 8 places between the dots the placement is [128][64][32][16][8][4][2][1]
so since you have 11111111 you add up 128+64+32+16+8+4+2+1 to get your 255
and you the last octet is a 11100000 you add up 128+64+32 to get your 224.

This should answer your question about how to create the mask but you will want to look at the site to see what you can do with it in terms of creating a group of subnetworks with a certain number of host per subnetwork.

so in the CIDR, the number tells me the number of bits are being used for the subnet? Ah, I think I get it. I read something good on experts-exchange.com. So, what are some practical uses of a subnet? I just can't imagine something right now.
 

Confused

Elite Member
Nov 13, 2000
14,166
0
0
Originally posted by: ndee
So, what are some practical uses of a subnet? I just can't imagine something right now.

You have a Class B address (such as 192.168.x.x), but you don't want one HUGE subnet of 65k hosts, because you will have a huge collision domain, so you can break it up into smaller subnets, each with their own collision domain. The most basic way is to break it up into 254 subnets, each with 254 hosts, for example 192.168.0.x/24 (255.255.255.0). Or, you could split it up into more subnets, each with less hosts, or fewer subnets, each with more hosts.

This way, you can keep different "departments" or "rooms" in a big corporation seperate, so that they don't all talk.

VERY VERY basic explanation (i've got to go out soon) but i'm sure others here will explain better! :)


Confused
 

Santa

Golden Member
Oct 11, 1999
1,168
0
0
Actually ndee has a Class C address.

192 is actually 11 which falls into Class C range

But other than that your correct about the reasons for subnetting.
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
The 192.168.0.0 - 192.168.255.255 address range is a collection of 256 class C addresses.

The first bits still refer to network class even though it isn't really pertinent anymore.
 

Saltin

Platinum Member
Jul 21, 2001
2,175
0
0
Spidey,

Are you saying that 192.168.0.48 /28 isnt a classless IP address?

Given, it's likely a bad example, as there would be almost no need to subnet in this manner in a private address space, but the principal still stands no? Classes are determined by subnet masks, not the IP address.

I'll defer to your knowledge here, but that's the way I always understood it.
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
Saltin,

The subnet mask is a way to "create subnetworks from a network class". The class of an IP address is determined by the most significant bits in the first octet.

0xxx = Class A 1. - 126.
01111111 = reserved 127.
10xxxx = class B 128.-191.
110xxx = class C 192.-223.
111xxx = class D (multicast)

True that in today's classless world we don't talk or use network class much anymore, but for the concept of subnetting to really sink in you have to talk about classfull addressing first. /28 is indeed classless notation, but it doesn't change the fact that the first octect is 192, making that a class C address.

-edit- I know you know the ins and outs of IP addressing, I'm just trying to do a through explanation for other folks. :)
 

Santa

Golden Member
Oct 11, 1999
1,168
0
0
To determine if something is of Class A, B, or C it is defined as looking at the first few bits in the first octet of the address.

Its as simple as that.

Classless subnetting or Classless Inter-Domain Routing you don't say he has a "Class C" anymore only that he is using a /28 or 28 but network mask.

Saying that he has a Class A B or C means you are looking at the old way of networking and based upon the first few bits is the way you determine what class he is in.

[It appears Spidey beat me in.. oh well his is more descriptive with binary numbers and dots :) ]
 

kt

Diamond Member
Apr 1, 2000
6,031
1,346
136
Originally posted by: Saltin
Spidey,

Are you saying that 192.168.0.48 /28 isnt a classless IP address?

Given, it's likely a bad example, as there would be almost no need to subnet in this manner in a private address space, but the principal still stands no? Classes are determined by subnet masks, not the IP address.

I'll defer to your knowledge here, but that's the way I always understood it.

192.168.0.48/28 is a Class C Classless IP address if you want to be anally accurate. As I understand it, whenever you don't use the default subnet mask (ie, you use part of the host ID to create subnet ID) for a particular network class then your IP address becomes classless. Regardless, 192.168.xxx.xxx is still part of Class C network whether it is classless or classful.
 

Santa

Golden Member
Oct 11, 1999
1,168
0
0
Until someone actually creates an RFC saying that Class C = /24 or Class C = 255.255.255.0 wheter it is a Class C will always be wholeheartedly dependent on the first few significant bits in the first octet of the address.

Just us being Anal I guess :)
 

skyking

Lifer
Nov 21, 2001
22,543
5,589
146
I need a little advice along the same lines: I am running a freebsd computer for a router, with the inside interface at 192.168.y.1
I'd like to add a wireless segment, but keep it as seperate as possible for security. Would I be best off to add another NIC, at 192.168.x.1, and change rc.firewall.dynip accordingly?