Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

From my understanding the networks is as follows

Class A: 10.0.0.1 - 10.255.255.254
Class B: 172.16.0.1 - 172.16.255.254
Class C: 192.168.0.1 - 192.168.0.254

But then I look at ifconfig virbr0 on my Linux computer:

virbr0    Link encap:Ethernet  HWaddr 42:40:99:CB:02:7F  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:2842 (2.7 KiB)

Here the IP address is 192.168.122.1. Is that an allowed IP?

And if so, is 192.168 than actually a Class B network?

share|improve this question
add comment

6 Answers

up vote 16 down vote accepted

Yes it is a valid private IP address.
Classful IP addressing is outdated and can be confusing at times. A class C address is an address with a 255.255.255.0 subnet mask. The 192.168.0.0 block of addresses was originally supposed to be 256 separate Class C addresses. The range would be 192.168.0.0-192.168.255.255. Valid subnets were 192.168.0.0, 192.168.1.0, 192.168.2.0, etc.

Nowadays, Classful IP addressing has gone away. We now have something called CIDR. With CIDR, all you really need to know is that these addresses are valid private IP addresses:

10.0.0.0-10.255.255.255
172.16.0.0-172.31.255.255
192.168.0.0-192.168.255.255

How you divide those up into subnets is up to you.

share|improve this answer
    
Very interesting. Okay, so if I have a 192.168 network I assume I should use 255.255.0.0 as subnet? –  Louise Hoffman Jun 10 '10 at 22:15
1  
I wouldn't use 255.255.0.0 as a subnet mask. You generally don't want that many hosts on a single broadcast domain. Use one of the 192.168.x.0 networks (preferably not 192.168.0.0 or 192.168.1.0 as they're way too common) and use a 255.255.255.0 subnet mask. Do you envision yourself having more than 254 devices on your network? –  Jason Berg Jun 10 '10 at 22:19
    
@Louise Hoffman: No, the 255.255.0.0 is the smallest netmask you can use for the 192.168.0.0/16 private network. You can divide the remaining 16 bits into multiple subnets as you wish, remembering that you need at least two bits for host information (two hosts, a broadcast and a network address). –  mpez0 Jun 11 '10 at 1:38
add comment

Classful networking is no longer used, instead you need to look into classless inter-domain routing. Also that is a valid IP that is in one of the ranged reserved for private use (See RFC 1918). You might also want to read this post about sub netting.

share|improve this answer
3  
+1 for making reference to RFC1918 which should be standard primer reading material for anyone involved with networking. –  Jeremy Bouse Jun 11 '10 at 2:56
add comment

As Kyle mentioned, there are no classes anymore, and haven't been for almost 15 years.

The private network IP ranges are:
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255

share|improve this answer
add comment

RFC1918 as has been posted, and should be read. Excerpt:

"3. Private Address Space

The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private internets:

 10.0.0.0        -   10.255.255.255  (10/8 prefix)
 172.16.0.0      -   172.31.255.255  (172.16/12 prefix)
 192.168.0.0     -   192.168.255.255 (192.168/16 prefix)

We will refer to the first block as "24-bit block", the second as "20-bit block", and to the third as "16-bit" block. Note that (in pre-CIDR notation) the first block is nothing but a single class A network number, while the second block is a set of 16 contiguous class B network numbers, and third block is a set of 256 contiguous class C network numbers."

Subnet Calculator / Planner

share|improve this answer
add comment

Absolutely, 192.168.122.1 is a valid IP address. However, it is a "private" address, which means essentially that it is not allowed to be directly exposed to the internet.

The "class A", "class B", "class C" terminology is no longer technically correct, although the terms are still used as shorthand for the network sizes they represented. Kyle pointed out the informative wikipedia article on CIDR and the very useful question and answer about subnet construction.

So, the best response to your question about 192.168 being a class B network is that the question is not meaningful. You can put 192.168.122.1 in a "class B" size network by using the mask 255.255.0.0. Or you can put it in a "class C" size network by using the mask 255.255.255.0. Both are equally valid, although in practice having a "class B" sized subnet is a recipe for a pitifully slow network.

share|improve this answer
add comment

No, there is a block of 256 class C networks reserved for local use, 192.168.0 through 192.168.255.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.