Visit Our UNIX and Linux User Community


Thread Tools Search this Thread
Special Forums IP Networking Subnetting
# 1  
Old 03-11-2017
Linux Subnetting

Dear friends am confused with the logic behind subnetting. i am learning from video tutorial and quite didn't get it
so my question is as below

Subnetting a class C : bits
After subnetting class c address by borrowing one bit from host to network , it leaves host with 7 bit and network increases bit to 25 bits .

According to my video tutorial it stated that theoretically class C address has
one network and 255 hosts. And after subnetting 2 networks with 127 hosts. but i dont think so .... Smilie

i believe class c has around 2097150 network and 255 hosts. i didn't get that logic . please help me get that right in my head.
# 2  
Old 03-11-2017
Say you have a class C network of which has 254 usable host addresses, because and are not usable (2^8-2).

By changing the CIDR suffix to 25 , you create two networks:


The first has 126 usable host addresses (192.168.1.{1..126}, 2^7-2)
The second has 126 usable host addresses (192.168.1.{129..254}), 2^7-2)

The subnet mask of the /24 network is
The subnet mask of the two /25 networks is
This User Gave Thanks to Scrutinizer For This Post:
# 3  
Old 03-11-2017
thanks a lot for wonderful explanation. Does that means

has 254 usable host address and that 254 host has to share only one network address. ie i can have only one network and within that network i cannot have more than 254 computers.

And using that subnetting i get two network with each network having 126 usable host address.

can you please check what i quoted below make sense or its wrong

SmilieSmilielogically every public address without subnetting has only one network address no matter its class A,B or C. With difference class it makes only difference with how much Host it will have .. is that correct SmilieSmilie

Last edited by lobsang; 03-11-2017 at 07:00 AM..
# 4  
Old 03-11-2017

To put it as simply as possible, in any given network range the very first address and the very last address are not usable for hosts. The first address is the network address, and the last address is the broadcast address.

So for you'd have: - Network address (NOT usable for hosts) through - Free IPs (Usable for hosts) - Broadcast address (NOT usable for hosts)

And for /25 sub-nets (and all others besides) it'd be the same: the first address in the range and the last address in the range are not usable for hosts.
These 2 Users Gave Thanks to drysdalk For This Post:
# 5  
Old 03-11-2017
i just came to learn that my public ip address through whatsmyip


since its class A IP address so default subnet mask is
Code:  ie

does that means apart from from and i can use all the rest for host. And i believe its possible within one network

And when some one bought a class A static IP address for personal use. does that means i can have around 16777214 host within a single network.

Last edited by lobsang; 03-11-2017 at 08:47 AM..
# 6  
Old 03-11-2017

That's almost certainly not correct, no. Your Internet provider is extremely unlikely to have the whole of 46./8 allocated to them. That'd be over sixteen million usable IPs, and a fairly large chunk of the Internet. In all likelihood the network range is 46.126.40/24, but it could be anything smaller or a bit larger than that.

My advice in understanding this whole thing would be: forget about all this Class A, B, C stuff. The important thing is the netmask. In day-to-day life you'll seldom encounter any external Internet-live IP ranges that are larger than a /24. In private network ranges it's not unusual for /8 or /16 to be seen, certainly.

I think at this point it would also be helpful to explain what it is you're trying to do, and why you think you need a huge chunk of the 46/8 part of the Internet to do it.

Edited to add: also, there's no way you or anyone anywhere can buy a whole Class A ! The IPv4 address space is almost entirely exhausted worldwide at this point. What almost everyone on domestic or small office broadband does is use an internal private network range, like 10.x.x.x or 192.168.x.x, and then use NAT to talk to the outside world on a single IP or far smaller number of live IPs.
These 2 Users Gave Thanks to drysdalk For This Post:
# 7  
Old 03-11-2017
No. You ARE one, amongst many other clients, of the hosts that your provider hosts in their subnet. I'd bet they'd be not amused if you tried to use another IP in that range - if you were capable to do it at all.

Previous Thread | Next Thread
Test Your Knowledge in Computers #960
Difficulty: Medium
The WannaCry ransomware attack was a May 2017 worldwide cyberattack by the WannaCry ransomware cryptoworm, which targeted computers running Windows by encrypting data and demanding ransom payments in the Bitcoin.
True or False?

3 More Discussions You Might Find Interesting

1. IP Networking


Guys, Anyone could help me understand subnetting. I know a bit in networking but there are things that I don't get them easily. Thank You in advance. (1 Reply)
Discussion started by: etcpasswd
1 Replies

2. IP Networking

Subnetting in 11 steps

As seen on, here is my ip addressing article in full... Original Subnetting in 11 Steps article Subnetting in 11 Steps There are a few things that you will need to know first. I personally use 11 rules that I learned from Mike Vana. Below you will find the 11 rules as well as... (1 Reply)
Discussion started by: jking2100
1 Replies

3. IP Networking


We have subnetted our Internal Network. We used an I.P. range of,,, and mask We created a subnet range of and maske Our routers are configure to route to approprate network. We are able... (2 Replies)
Discussion started by: cassy
2 Replies

Featured Tech Videos